VirtualBox

Ignore:
Timestamp:
Feb 26, 2019 4:39:10 AM (6 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Get rid of temporary IEMExecOne in-place of IEMExecDecodedXXX VMX instructions.

File:
1 edited

Legend:

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

    r76993 r77463  
    234234    } while (0)
    235235
    236 # ifdef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
    237 /** Macro that executes a VMX instruction in IEM. */
    238 #  define HMVMX_IEM_EXEC_VMX_INSTR_RET(a_pVCpu) \
    239     do { \
    240         int rc = HMVMX_CPUMCTX_IMPORT_STATE((a_pVCpu), HMVMX_CPUMCTX_EXTRN_ALL); \
    241         AssertRCReturn(rc, rc); \
    242         VBOXSTRICTRC rcStrict = IEMExecOne((a_pVCpu)); \
    243         if (rcStrict == VINF_SUCCESS) \
    244             ASMAtomicUoOrU64(&(a_pVCpu)->hm.s.fCtxChanged, HM_CHANGED_ALL_GUEST); \
    245         else if (rcStrict == VINF_IEM_RAISED_XCPT) \
    246         { \
    247             rcStrict = VINF_SUCCESS; \
    248             ASMAtomicUoOrU64(&(a_pVCpu)->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK); \
    249         } \
    250         return VBOXSTRICTRC_VAL(rcStrict); \
    251     } while (0)
    252 
    253 # endif /* VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM */
    254236#endif /* VBOX_WITH_NESTED_HWVIRT_VMX */
    255237
     
    58975879
    58985880
    5899 # ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
    59005881/**
    59015882 * Decodes the memory operand of an instruction that caused a VM-exit.
     
    61636144    return VINF_SUCCESS;
    61646145}
    6165 # endif /* !VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM */
    61666146#endif /* VBOX_WITH_NESTED_HWVIRT_VMX */
    61676147
     
    1346513445{
    1346613446    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13467 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13447
    1346813448    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1346913449    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     
    1349213472    }
    1349313473    return rcStrict;
    13494 #else
    13495     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13496 #endif
    1349713474}
    1349813475
     
    1350413481{
    1350513482    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13506 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13483
    1350713484    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1350813485    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMENTRY_MASK);
     
    1351613493    Assert(rcStrict != VINF_IEM_RAISED_XCPT);
    1351713494    return rcStrict;
    13518 #else
    13519     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13520 #endif
    1352113495}
    1352213496
     
    1352813502{
    1352913503    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13530 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13504
    1353113505    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1353213506    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     
    1355513529    }
    1355613530    return rcStrict;
    13557 #else
    13558     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13559 #endif
    1356013531}
    1356113532
     
    1356713538{
    1356813539    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13569 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13540
    1357013541    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1357113542    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     
    1359413565    }
    1359513566    return rcStrict;
    13596 #else
    13597     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13598 #endif
    1359913567}
    1360013568
     
    1360613574{
    1360713575    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13608 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13576
    1360913577    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1361013578    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     
    1363413602    }
    1363513603    return rcStrict;
    13636 #else
    13637     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13638 #endif
    1363913604}
    1364013605
     
    1364613611{
    1364713612    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13648 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13613
    1364913614    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1365013615    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMENTRY_MASK);
     
    1365813623    Assert(rcStrict != VINF_IEM_RAISED_XCPT);
    1365913624    return rcStrict;
    13660 #else
    13661     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13662 #endif
    1366313625}
    1366413626
     
    1367013632{
    1367113633    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13672 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13634
    1367313635    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1367413636    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     
    1369813660    }
    1369913661    return rcStrict;
    13700 #else
    13701     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13702 #endif
    1370313662}
    1370413663
     
    1371013669{
    1371113670    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13712 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13671
    1371313672    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1371413673    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_CR4 | IEM_CPUMCTX_EXTRN_EXEC_DECODED_NO_MEM_MASK);
     
    1372913688    }
    1373013689    return rcStrict;
    13731 #else
    13732     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13733 #endif
    1373413690}
    1373513691
     
    1374113697{
    1374213698    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13743 #ifndef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
     13699
    1374413700    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1374513701    rc    |= HMVMX_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_SREG_MASK
     
    1376813724    }
    1376913725    return rcStrict;
    13770 #else
    13771     HMVMX_IEM_EXEC_VMX_INSTR_RET(pVCpu);
    13772 #endif
    1377313726}
    1377413727
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