VirtualBox

Changeset 73988 in vbox


Ignore:
Timestamp:
Aug 31, 2018 9:43:26 AM (6 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Make sure RSP, segment regs are imported as it's required in hmR0VmxDecodeMemOperand.
Also, ignore specifying changing of GPRs (RSP is the sole exception in VMX code) that are always
assumed to be present (RAX, RBX, RCX) as its not consistently done everywhere and in some places
it's currently not possible to determine what changed without more APIs (e.g. VMCALL calling into GIM).

File:
1 edited

Legend:

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

    r73987 r73988  
    58915891    Assert(pGCPtrMem);
    58925892    Assert(!CPUMIsGuestInRealOrV86Mode(pVCpu));
     5893    HMVMX_CPUMCTX_ASSERT(pVCpu, CPUMCTX_EXTRN_GPRS_MASK | CPUMCTX_EXTRN_SREG_MASK | CPUMCTX_EXTRN_EFER | CPUMCTX_EXTRN_CR0);
    58935894
    58945895    static uint64_t const s_auAddrSizeMasks[]   = { UINT64_C(0xffff), UINT64_C(0xffffffff), UINT64_C(0xffffffffffffffff) };
     
    1135611357     */
    1135711358    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    11358     rc    |= hmR0VmxImportGuestState(pVCpu, IEM_CPUMCTX_EXTRN_EXEC_DECODED_NO_MEM_MASK | CPUMCTX_EXTRN_RAX | CPUMCTX_EXTRN_RCX);
     11359    rc    |= hmR0VmxImportGuestState(pVCpu, IEM_CPUMCTX_EXTRN_EXEC_DECODED_NO_MEM_MASK);
    1135911360    AssertRCReturn(rc, rc);
    1136011361
     
    1137011371        rcStrict = IEMExecDecodedCpuid(pVCpu, pVmxTransient->cbInstr);
    1137111372        if (rcStrict == VINF_SUCCESS)
    11372             ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS | HM_CHANGED_GUEST_RAX
    11373                                                      | HM_CHANGED_GUEST_RCX | HM_CHANGED_GUEST_RDX    | HM_CHANGED_GUEST_RBX);
     11373            ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS);
    1137411374        else if (rcStrict == VINF_IEM_RAISED_XCPT)
    1137511375        {
     
    1143411434        if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TSC_OFFSETTING)
    1143511435            pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
    11436         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS
    11437                                                  | HM_CHANGED_GUEST_RAX | HM_CHANGED_GUEST_RDX);
     11436        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS);
    1143811437    }
    1143911438    else if (rcStrict == VINF_IEM_RAISED_XCPT)
     
    1146311462        if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TSC_OFFSETTING)
    1146411463            pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
    11465         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS
    11466                                                  | HM_CHANGED_GUEST_RAX | HM_CHANGED_GUEST_RDX | HM_CHANGED_GUEST_RCX);
     11464        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS);
    1146711465    }
    1146811466    else if (rcStrict == VINF_IEM_RAISED_XCPT)
     
    1155411552    int rc = hmR0VmxReadExitQualVmcs(pVCpu, pVmxTransient);
    1155511553    rc    |= hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    11556     rc    |= hmR0VmxImportGuestState(pVCpu, IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK | CPUMCTX_EXTRN_DS);
     11554    rc    |= hmR0VmxImportGuestState(pVCpu, IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
    1155711555    AssertRCReturn(rc, rc);
    1155811556
     
    1341913417
    1342013418    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    13421     rc    |= hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_SREG_MASK | IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
     13419    rc    |= hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     13420                                          | IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
    1342213421    rc    |= hmR0VmxReadExitInstrInfoVmcs(pVmxTransient);
    1342313422    rc    |= hmR0VmxReadExitQualVmcs(pVCpu, pVmxTransient);
     
    1349013489
    1349113490    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    13492     rc    |= hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_SREG_MASK | IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
     13491    rc    |= hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     13492                                          | IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
    1349313493    rc    |= hmR0VmxReadExitInstrInfoVmcs(pVmxTransient);
    1349413494    rc    |= hmR0VmxReadExitQualVmcs(pVCpu, pVmxTransient);
     
    1354513545
    1354613546    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    13547     rc    |= hmR0VmxImportGuestState(pVCpu, IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
     13547    rc    |= hmR0VmxImportGuestState(pVCpu, IEM_CPUMCTX_EXTRN_EXEC_DECODED_NO_MEM_MASK);
    1354813548    AssertRCReturn(rc, rc);
    1354913549
     
    1357313573
    1357413574    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    13575     rc    |= hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_SREG_MASK | IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
     13575    rc    |= hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     13576                                          | IEM_CPUMCTX_EXTRN_EXEC_DECODED_MEM_MASK);
    1357613577    rc    |= hmR0VmxReadExitInstrInfoVmcs(pVmxTransient);
    1357713578    rc    |= hmR0VmxReadExitQualVmcs(pVCpu, pVmxTransient);
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