Changeset 99164 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Mar 24, 2023 6:20:40 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp
r98797 r99164 2637 2637 Log(("vmexit: Loading host-state failed. uExitReason=%u rc=%Rrc\n", uExitReason, VBOXSTRICTRC_VAL(rcStrict))); 2638 2638 2639 /* 2640 * Restore non-zero Secondary-processor based VM-execution controls 2641 * when the "activate secondary controls" bit was not set. 2642 */ 2643 if (pVmcs->u32RestoreProcCtls2) 2644 { 2645 Assert(!(pVmcs->u32ProcCtls & VMX_PROC_CTLS_USE_SECONDARY_CTLS)); 2646 pVmcs->u32ProcCtls2 = pVmcs->u32RestoreProcCtls2; 2647 pVmcs->u32RestoreProcCtls2 = 0; 2648 } 2649 2639 2650 if (VM_IS_HM_ENABLED(pVCpu->CTX_SUFF(pVM))) 2640 2651 { … … 6394 6405 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_ProcCtls2Allowed1); 6395 6406 } 6396 else 6407 else if (pVmcs->u32ProcCtls2) 6397 6408 { 6398 6409 /* 6399 6410 * If the "activate secondary controls" is clear, then the secondary processor-based VM-execution controls 6400 * is treated as 0. We must not fail/assert here. Microsoft Hyper-V relies on this behavior.6411 * is treated as 0. 6401 6412 * 6402 6413 * See Intel spec. 26.2.1.1 "VM-Execution Control Fields". 6414 * 6415 * Since this is a rather rare occurrence (only observed for a few VM-entries with Microsoft Hyper-V 6416 * enabled Windows Server 2008 R2 guest), it's not worth changing every place that reads this control to 6417 * also check the "activate secondary controls" bit. Instead, we temporarily save the guest programmed 6418 * control here, zero out the value the rest of our code uses and restore the guest programmed value 6419 * on VM-exit. 6403 6420 */ 6404 pVmcs->u32ProcCtls2 = 0; 6421 pVmcs->u32RestoreProcCtls2 = pVmcs->u32ProcCtls2; 6422 pVmcs->u32ProcCtls2 = 0; 6405 6423 } 6406 6424 … … 7812 7830 * See Intel spec. 24.11.4 "Software Access to Related Structures". 7813 7831 */ 7814 PVMXVVMCS const pVmcs = &pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs;7815 Assert(pVmcs);7816 7832 Assert(IEM_VMX_HAS_CURRENT_VMCS(pVCpu)); 7817 7833 … … 7836 7852 */ 7837 7853 iemVmxVmentrySaveNmiBlockingFF(pVCpu); 7854 7855 PVMXVVMCS pVmcs = &pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs; 7856 Assert(pVmcs); 7838 7857 7839 7858 rc = iemVmxVmentryCheckGuestState(pVCpu, pszInstr);
Note:
See TracChangeset
for help on using the changeset viewer.