VirtualBox

Changeset 72619 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Jun 19, 2018 7:12:46 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123118
Message:

VMM: Temporarily put the old RDTSC[P] code back and enabled it (reverted r123092). bugref:6973

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r72609 r72619  
    62556255{
    62566256    HMSVM_VALIDATE_EXIT_HANDLER_PARAMS();
     6257#if 0 /** @todo Needs testing. @bugref{6973} */
    62576258    VBOXSTRICTRC rcStrict = IEMExecDecodedRdtsc(pVCpu, hmR0SvmGetInstrLengthHwAssist(pVCpu, pCtx, 2));
    62586259    if (rcStrict == VINF_SUCCESS)
     
    62636264    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtsc);
    62646265    return VBOXSTRICTRC_TODO(rcStrict);
     6266#else
     6267    int rc = EMInterpretRdtsc(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(pCtx));
     6268    if (RT_LIKELY(rc == VINF_SUCCESS))
     6269    {
     6270        pSvmTransient->fUpdateTscOffsetting = true;
     6271        hmR0SvmAdvanceRipHwAssist(pVCpu, pCtx, 2);
     6272        HMSVM_CHECK_SINGLE_STEP(pVCpu, rc);
     6273    }
     6274    else
     6275    {
     6276        AssertMsgFailed(("hmR0SvmExitRdtsc: EMInterpretRdtsc failed with %Rrc\n", rc));
     6277        rc = VERR_EM_INTERPRETER;
     6278    }
     6279    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtsc);
     6280    return rc;
     6281#endif
    62656282}
    62666283
     
    62726289{
    62736290    HMSVM_VALIDATE_EXIT_HANDLER_PARAMS();
     6291#if 0 /** @todo Needs testing. @bugref{6973} */
    62746292    VBOXSTRICTRC rcStrict = IEMExecDecodedRdtscp(pVCpu, hmR0SvmGetInstrLengthHwAssist(pVCpu, pCtx, 3));
    62756293    if (rcStrict == VINF_SUCCESS)
     
    62806298    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtscp);
    62816299    return VBOXSTRICTRC_TODO(rcStrict);
     6300#else
     6301    int rc = EMInterpretRdtscp(pVCpu->CTX_SUFF(pVM), pVCpu, pCtx);
     6302    if (RT_LIKELY(rc == VINF_SUCCESS))
     6303    {
     6304        pSvmTransient->fUpdateTscOffsetting = true;
     6305        hmR0SvmAdvanceRipHwAssist(pVCpu, pCtx, 3);
     6306        HMSVM_CHECK_SINGLE_STEP(pVCpu, rc);
     6307    }
     6308    else
     6309    {
     6310        AssertMsgFailed(("hmR0SvmExitRdtsc: EMInterpretRdtscp failed with %Rrc\n", rc));
     6311        rc = VERR_EM_INTERPRETER;
     6312    }
     6313    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtscp);
     6314    return rc;
     6315#endif
    62826316}
    62836317
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r72606 r72619  
    1191711917{
    1191811918    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     11919#if 0 /** @todo Needs testing. @bugref{6973} */
    1191911920    int rc = hmR0VmxSaveGuestCR4(pVCpu, pMixedCtx);      /* Needed for CPL < 0 only, really. */
    1192011921    rc    |= hmR0VmxSaveGuestRegsForIemExec(pVCpu, pMixedCtx, false /*fMemory*/, false /*fNeedRsp*/);
     
    1193211933    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtsc);
    1193311934    return rcStrict;
     11935#else
     11936    int rc = hmR0VmxSaveGuestCR4(pVCpu, pMixedCtx);
     11937    AssertRCReturn(rc, rc);
     11938
     11939    PVM pVM = pVCpu->CTX_SUFF(pVM);
     11940    rc = EMInterpretRdtsc(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx));
     11941    if (RT_LIKELY(rc == VINF_SUCCESS))
     11942    {
     11943        rc = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
     11944        Assert(pVmxTransient->cbInstr == 2);
     11945        /* If we get a spurious VM-exit when offsetting is enabled, we must reset offsetting on VM-reentry. See @bugref{6634}. */
     11946        if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING)
     11947            pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
     11948    }
     11949    else
     11950        rc = VERR_EM_INTERPRETER;
     11951    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtsc);
     11952    return rc;
     11953#endif
    1193411954}
    1193511955
     
    1194111961{
    1194211962    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     11963#if 0 /** @todo Needs testing. @bugref{6973} */
    1194311964    int rc = hmR0VmxSaveGuestCR4(pVCpu, pMixedCtx);      /* Needed for CPL < 0 only, really. */
    1194411965    rc    |= hmR0VmxSaveGuestRegsForIemExec(pVCpu, pMixedCtx, false /*fMemory*/, false /*fNeedRsp*/);
     
    1195711978    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtscp);
    1195811979    return rcStrict;
     11980#else
     11981    int rc = hmR0VmxSaveGuestCR4(pVCpu, pMixedCtx);
     11982    rc    |= hmR0VmxSaveGuestAutoLoadStoreMsrs(pVCpu, pMixedCtx);  /* For MSR_K8_TSC_AUX */
     11983    AssertRCReturn(rc, rc);
     11984
     11985    PVM pVM = pVCpu->CTX_SUFF(pVM);
     11986    rc = EMInterpretRdtscp(pVM, pVCpu, pMixedCtx);
     11987    if (RT_SUCCESS(rc))
     11988    {
     11989        rc  = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
     11990        Assert(pVmxTransient->cbInstr == 3);
     11991        /* If we get a spurious VM-exit when offsetting is enabled, we must reset offsetting on VM-reentry. See @bugref{6634}. */
     11992        if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING)
     11993            pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
     11994    }
     11995    else
     11996    {
     11997        AssertMsgFailed(("hmR0VmxExitRdtscp: EMInterpretRdtscp failed with %Rrc\n", rc));
     11998        rc = VERR_EM_INTERPRETER;
     11999    }
     12000    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdtscp);
     12001    return rc;
     12002#endif
    1195912003}
    1196012004
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette