Changeset 73140 in vbox
- Timestamp:
- Jul 16, 2018 9:06:51 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
-
VMMAll/HMSVMAll.cpp (modified) (1 diff)
-
VMMR0/HMSVMR0.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp
r72967 r73140 164 164 * However, with nested-guests, the state -can- change on trips to ring-3 for we might 165 165 * try to inject a nested-guest physical interrupt and cause a SVM_EXIT_INTR #VMEXIT for 166 * the nested-guest from ring-3. Hence we signal the required CPU state change here. 166 * the nested-guest from ring-3. Import the complete state here as we will be swapping 167 * to the guest VMCB after the #VMEXIT. 167 168 */ 168 /** @todo Figure out why using HM_CHANGED_SVM_VMEXIT_MASK instead of 169 * HM_CHANGED_ALL_GUEST breaks nested guests (XP Pro, DSL etc.), see also 170 * hmR0SvmHandleExitNested(). */ 171 AssertMsg(!(pVCpu->cpum.GstCtx.fExtrn & IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK), 172 ("fExtrn=%#RX64 fExtrnMbz=%#RX64\n", pVCpu->cpum.GstCtx.fExtrn, IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK)); 169 CPUMImportGuestStateOnDemand(pVCpu, CPUMCTX_EXTRN_ALL); 170 AssertMsg(!(pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_ALL), 171 ("fExtrn=%#RX64 fExtrnMbz=%#RX64\n", pVCpu->cpum.GstCtx.fExtrn, CPUMCTX_EXTRN_ALL)); 173 172 ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_ALL_GUEST); 174 173 } -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r73115 r73140 158 158 && CPUMIsGuestSvmCtrlInterceptSet((a_pVCpu), &(a_pVCpu)->cpum.GstCtx, SVM_CTRL_INTERCEPT_SHUTDOWN)) \ 159 159 { \ 160 HMSVM_CPUMCTX_IMPORT_STATE((a_pVCpu), IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK); \160 HMSVM_CPUMCTX_IMPORT_STATE((a_pVCpu), HMSVM_CPUMCTX_EXTRN_ALL); \ 161 161 return VBOXSTRICTRC_TODO(IEMExecSvmVmexit((a_pVCpu), SVM_EXIT_SHUTDOWN, 0, 0)); \ 162 162 } \ … … 3265 3265 pVCpu->hm.s.rcLastExitToR3 = rcExit; 3266 3266 3267 /* On our way back from ring-3 reload the guest state if there is a possibility of it being changed. */ 3268 if (rcExit != VINF_EM_RAW_INTERRUPT) 3267 /* On our way back from ring-3, reload the guest-CPU state if it may change while in ring-3. */ 3268 if ( rcExit != VINF_EM_RAW_INTERRUPT 3269 || CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.GstCtx)) 3269 3270 { 3270 3271 Assert(!(pVCpu->cpum.GstCtx.fExtrn & HMSVM_CPUMCTX_EXTRN_ALL)); … … 3755 3756 { 3756 3757 Log4(("Intercepting NMI -> #VMEXIT\n")); 3757 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK);3758 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, HMSVM_CPUMCTX_EXTRN_ALL); 3758 3759 return IEMExecSvmVmexit(pVCpu, SVM_EXIT_NMI, 0, 0); 3759 3760 } … … 3796 3797 { 3797 3798 Log4(("Intercepting INTR -> #VMEXIT\n")); 3798 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK);3799 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, HMSVM_CPUMCTX_EXTRN_ALL); 3799 3800 return IEMExecSvmVmexit(pVCpu, SVM_EXIT_INTR, 0, 0); 3800 3801 } … … 5173 5174 Assert(pSvmTransient->u64ExitCode <= SVM_EXIT_MAX); 5174 5175 5175 /** @todo Figure out why using IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK instead of 5176 * HMSVM_CPUMCTX_EXTRN_ALL breaks nested guests (XP Pro, DSL etc.), see 5177 * also HMSvmNstGstVmExitNotify(). */ 5176 /* 5177 * We import the complete state here because we use separate VMCBs for the guest and the 5178 * nested-guest, and the guest's VMCB is used after the #VMEXIT. We can only save/restore 5179 * the #VMEXIT specific state if we used the same VMCB for both guest and nested-guest. 5180 */ 5178 5181 #define NST_GST_VMEXIT_CALL_RET(a_pVCpu, a_uExitCode, a_uExitInfo1, a_uExitInfo2) \ 5179 5182 do { \ … … 5399 5402 * get an SMI #VMEXIT here so simply ignore rather than causing a corresponding 5400 5403 * nested-guest #VMEXIT. 5404 * 5405 * We shall import the complete state here as we may cause #VMEXITs from ring-3 5406 * while trying to inject interrupts, see comment at the top of this function. 5401 5407 */ 5402 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK);5408 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_ALL); 5403 5409 return hmR0SvmExitIntr(pVCpu, pSvmTransient); 5404 5410 }
Note:
See TracChangeset
for help on using the changeset viewer.

