Changeset 62334 in vbox
- Timestamp:
- Jul 19, 2016 4:03:23 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 108871
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r62321 r62334 4903 4903 the rest of the VM run (until VM reset). See @bugref{8432#c7}. */ 4904 4904 pVCpu->hm.s.vmx.fSwitchedTo64on32 = true; 4905 Log4(("Load[%RU32]: hmR0VmxSetupVMRunHandler: selected 64-bit switcher\n", pVCpu->idCpu)); 4905 4906 } 4906 4907 #else … … 4924 4925 # ifdef VBOX_ENABLE_64_BITS_GUESTS 4925 4926 /* Keep using the 64-bit switcher even though we're in 32-bit because of bad Intel design. See @bugref{8432#c7}. 4926 * Except if Real-on-V86 is active, clear the 64-bit switcher flag because now we know the guest is in a sane 4927 * state where it's safe to use the 32-bit switcher again. 4927 * If Real-on-V86 is active, clear the 64-bit switcher flag because now we know the guest is in a sane 4928 * state where it's safe to use the 32-bit switcher. Otherwise check the guest state if it's safe to use 4929 * the much faster 32-bit switcher again. 4928 4930 */ 4929 if (pVCpu->hm.s.vmx.RealMode.fRealOnV86Active)4930 pVCpu->hm.s.vmx.fSwitchedTo64on32 = false;4931 4932 4931 if (!pVCpu->hm.s.vmx.fSwitchedTo64on32) 4932 { 4933 if (pVCpu->hm.s.vmx.pfnStartVM != VMXR0StartVM32) 4934 Log4(("Load[%RU32]: hmR0VmxSetupVMRunHandler: selected 32-bit switcher\n", pVCpu->idCpu)); 4933 4935 pVCpu->hm.s.vmx.pfnStartVM = VMXR0StartVM32; 4936 } 4934 4937 else 4935 4938 { 4936 Assert(!pVCpu->hm.s.vmx.RealMode.fRealOnV86Active);4937 4939 Assert(pVCpu->hm.s.vmx.pfnStartVM == VMXR0SwitcherStartVM64); 4938 if ( hmR0VmxIs32BitSwitcherSafe(pVCpu, pMixedCtx))4940 if (pVCpu->hm.s.vmx.RealMode.fRealOnV86Active || hmR0VmxIs32BitSwitcherSafe(pVCpu, pMixedCtx)) 4939 4941 { 4940 4942 pVCpu->hm.s.vmx.fSwitchedTo64on32 = false; 4941 4943 pVCpu->hm.s.vmx.pfnStartVM = VMXR0StartVM32; 4942 } 4944 HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_EFER_MSR | HM_CHANGED_VMX_ENTRY_CTLS | HM_CHANGED_VMX_EXIT_CTLS | HM_CHANGED_HOST_CONTEXT); 4945 Log4(("Load[%RU32]: hmR0VmxSetupVMRunHandler: selected 32-bit switcher (safe)\n", pVCpu->idCpu)); 4946 } 4943 4947 } 4944 4948 # else … … 8750 8754 * Load the host state bits as we may've been preempted (only happens when 8751 8755 * thread-context hooks are used or when hmR0VmxSetupVMRunHandler() changes pfnStartVM). 8756 * Note that the 64-on-32 switcher saves the (64-bit) host state into the VMCS and 8757 * if we change the switcher back to 32-bit, we *must* save the 32-bit host state here. 8758 * See @bugref{8432}. 8752 8759 */ 8753 /** @todo Why should hmR0VmxSetupVMRunHandler() changing pfnStartVM have8754 * any effect to the host state needing to be saved? */8755 8760 if (HMCPU_CF_IS_PENDING(pVCpu, HM_CHANGED_HOST_CONTEXT)) 8756 8761 { 8757 /* This ASSUMES that pfnStartVM has been set up already. */8758 8762 int rc = hmR0VmxSaveHostState(pVM, pVCpu); 8759 8763 AssertRC(rc); … … 8898 8902 pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_REQUIRED; /* Host state messed up by VT-x, we must restore. */ 8899 8903 #endif 8904 #if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) 8905 /* The 64-on-32 switcher maintains uVmcsState on its own and we need to leave it alone here. */ 8906 if (pVCpu->hm.s.vmx.pfnStartVM != VMXR0SwitcherStartVM64) 8907 pVCpu->hm.s.vmx.uVmcsState |= HMVMX_VMCS_STATE_LAUNCHED; /* Use VMRESUME instead of VMLAUNCH in the next run. */ 8908 #else 8900 8909 pVCpu->hm.s.vmx.uVmcsState |= HMVMX_VMCS_STATE_LAUNCHED; /* Use VMRESUME instead of VMLAUNCH in the next run. */ 8910 #endif 8901 8911 #ifdef VBOX_STRICT 8902 8912 hmR0VmxCheckHostEferMsr(pVCpu); /* Verify that VMRUN/VMLAUNCH didn't modify host EFER. */
Note:
See TracChangeset
for help on using the changeset viewer.