Changeset 50426 in vbox
- Timestamp:
- Feb 12, 2014 1:16:33 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 92215
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r50285 r50426 2750 2750 { \ 2751 2751 uint32_t uAttr = ASMGetSegAttr((selValue)); \ 2752 fValidSelector = RT_BOOL(uAttr != ~0U&& (uAttr & X86_DESC_P)); \2752 fValidSelector = RT_BOOL(uAttr != UINT32_MAX && (uAttr & X86_DESC_P)); \ 2753 2753 } \ 2754 2754 if (fValidSelector) \ … … 2774 2774 NOREF(pVM); 2775 2775 int rc = VERR_INTERNAL_ERROR_5; 2776 2777 /* 2778 * Quick fix for regression #7240. Restore the host state if we've messed 2779 * it up already, otherwise all we'll get it all wrong below! 2780 */ 2781 if ( (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_REQUIRED) 2782 && (pVCpu->hm.s.vmx.fRestoreHostFlags & ~VMX_RESTORE_HOST_REQUIRED)) 2783 VMXRestoreHostState(pVCpu->hm.s.vmx.fRestoreHostFlags, &pVCpu->hm.s.vmx.RestoreHost); 2776 2784 2777 2785 /* … … 2899 2907 2900 2908 /* 2901 * IDT limit is practically 0xfff. Therefore if the host has the limit as 0xfff, VT-x bloating the limit to 0xffff 2902 * is not a problem as it's not possible to get at them anyway. See Intel spec. 6.14.1 "64-Bit Mode IDT" and 2903 * Intel spec. 6.2 "Exception and Interrupt Vectors". 2909 * IDT limit is effectively capped at 0xfff. (See Intel spec. 6.14.1 "64-Bit Mode IDT" 2910 * and Intel spec. 6.2 "Exception and Interrupt Vectors".) Therefore if the host has the limit as 0xfff, VT-x 2911 * bloating the limit to 0xffff shouldn't cause any different CPU behavior. However, several hosts either insists 2912 * on 0xfff being the limit (Windows Patch Guard) or uses the limit for other purposes (darwin puts the CPU ID in there 2913 * but botches sidt alignment in at least one consumer). So, we're only allowing IDTR.LIMIT to be left at 0xffff on 2914 * hosts where we are pretty sure it won't cause trouble. 2904 2915 */ 2905 if (Idtr.cbIdt < 0x0fff) 2916 # if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) 2917 if (Idtr.cbIdt < 0x0fff) 2918 # else 2919 if (Idtr.cbIdt != 0xffff) 2920 # endif 2906 2921 { 2907 2922 pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_IDTR; … … 6638 6653 Log4Func(("Restoring Host State: fRestoreHostFlags=%#RX32 HostCpuId=%u\n", pVCpu->hm.s.vmx.fRestoreHostFlags, idCpu)); 6639 6654 VMXRestoreHostState(pVCpu->hm.s.vmx.fRestoreHostFlags, &pVCpu->hm.s.vmx.RestoreHost); 6640 pVCpu->hm.s.vmx.fRestoreHostFlags = 0;6641 }6655 } 6656 pVCpu->hm.s.vmx.fRestoreHostFlags = 0; 6642 6657 #endif 6643 6658 … … 6869 6884 if ( (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_REQUIRED) 6870 6885 && (pVCpu->hm.s.vmx.fRestoreHostFlags & ~VMX_RESTORE_HOST_REQUIRED)) 6871 {6872 6886 VMXRestoreHostState(pVCpu->hm.s.vmx.fRestoreHostFlags, &pVCpu->hm.s.vmx.RestoreHost); 6873 6874 } 6887 pVCpu->hm.s.vmx.fRestoreHostFlags = 0; 6888 6875 6889 /* Restore the host MSRs as we're leaving VT-x context. */ 6876 6890 if ( pVM->hm.s.fAllow64BitGuests
Note:
See TracChangeset
for help on using the changeset viewer.