VirtualBox

Changeset 92023 in vbox for trunk/src


Ignore:
Timestamp:
Oct 25, 2021 10:34:48 AM (3 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Removed superfluous call to hmR0VmxImportGuestState in hmR0VmxExitMovToCrX.

File:
1 edited

Legend:

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

    r91839 r92023  
    80508050     *
    80518051     * The longjmp exit path can't check these CR3 force-flags and call code that takes a lock again. We cover for it here.
    8052      */
    8053     if (VMMRZCallRing3IsEnabled(pVCpu))
    8054     {
    8055         if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_CR3))
    8056         {
    8057             Assert(!(ASMAtomicUoReadU64(&pCtx->fExtrn) & CPUMCTX_EXTRN_CR3));
    8058             PGMUpdateCR3(pVCpu, CPUMGetGuestCR3(pVCpu), false /* fPdpesMapped */);
    8059             Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_CR3));
    8060         }
     8052     *
     8053     * The force-flag is checked first as it's cheaper for potential superfluous calls to this function.
     8054     */
     8055    if (   VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_CR3)
     8056        && VMMRZCallRing3IsEnabled(pVCpu))
     8057    {
     8058        Assert(!(ASMAtomicUoReadU64(&pCtx->fExtrn) & CPUMCTX_EXTRN_CR3));
     8059        PGMUpdateCR3(pVCpu, CPUMGetGuestCR3(pVCpu), false /* fPdpesMapped */);
     8060        Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_CR3));
    80618061    }
    80628062
     
    1393613936 * VM-exit helper for MOV to CRx (CRx write).
    1393713937 */
    13938 static VBOXSTRICTRC hmR0VmxExitMovToCrX(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr, uint8_t iGReg, uint8_t iCrReg)
    13939 {
    13940     int rc = hmR0VmxImportGuestState(pVCpu, pVmcsInfo, IEM_CPUMCTX_EXTRN_MUST_MASK);
    13941     AssertRCReturn(rc, rc);
     13938static VBOXSTRICTRC hmR0VmxExitMovToCrX(PVMCPUCC pVCpu, uint8_t cbInstr, uint8_t iGReg, uint8_t iCrReg)
     13939{
     13940    HMVMX_CPUMCTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_MUST_MASK);
    1394213941
    1394313942    VBOXSTRICTRC rcStrict = IEMExecDecodedMovCRxWrite(pVCpu, cbInstr, iCrReg, iGReg);
     
    1566915668                   || !(pVmcsInfo->u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW));
    1567015669
    15671             rcStrict = hmR0VmxExitMovToCrX(pVCpu, pVmcsInfo, pVmxTransient->cbExitInstr, iGReg, iCrReg);
     15670            rcStrict = hmR0VmxExitMovToCrX(pVCpu, pVmxTransient->cbExitInstr, iGReg, iCrReg);
    1567215671            AssertMsg(   rcStrict == VINF_SUCCESS
    1567315672                      || rcStrict == VINF_PGM_SYNC_CR3, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
     
    1713717136            }
    1713817137            else
    17139                 rcStrict = hmR0VmxExitMovToCrX(pVCpu, pVmxTransient->pVmcsInfo, pVmxTransient->cbExitInstr, iGReg, iCrReg);
     17138            {
     17139                int const rc = hmR0VmxImportGuestState(pVCpu, pVmxTransient->pVmcsInfo, IEM_CPUMCTX_EXTRN_MUST_MASK);
     17140                AssertRCReturn(rc, rc);
     17141                rcStrict = hmR0VmxExitMovToCrX(pVCpu, pVmxTransient->cbExitInstr, iGReg, iCrReg);
     17142            }
    1714017143            break;
    1714117144        }
Note: See TracChangeset for help on using the changeset viewer.

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