Changeset 74523 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Sep 28, 2018 12:43:19 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r74457 r74523 56 56 VMXV_DIAG_DESC(kVmxVDiag_Vmxon_Cpl , "Cpl" ), 57 57 VMXV_DIAG_DESC(kVmxVDiag_Vmxon_Cr0Fixed0 , "Cr0Fixed0" ), 58 VMXV_DIAG_DESC(kVmxVDiag_Vmxon_Cr0Fixed1 , "Cr0Fixed1" ), 58 59 VMXV_DIAG_DESC(kVmxVDiag_Vmxon_Cr4Fixed0 , "Cr4Fixed0" ), 60 VMXV_DIAG_DESC(kVmxVDiag_Vmxon_Cr4Fixed1 , "Cr4Fixed1" ), 59 61 VMXV_DIAG_DESC(kVmxVDiag_Vmxon_Intercept , "Intercept" ), 60 62 VMXV_DIAG_DESC(kVmxVDiag_Vmxon_LongModeCS , "LongModeCS" ), -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r74520 r74523 2747 2747 if (fUnrestrictedGuest) 2748 2748 u64Cr0Fixed0 &= ~(X86_CR0_PE | X86_CR0_PG); 2749 if ( ~pVmcs->u64GuestCr0.u &u64Cr0Fixed0)2749 if ((pVmcs->u64GuestCr0.u & u64Cr0Fixed0) != u64Cr0Fixed0) 2750 2750 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_GuestCr0Fixed0); 2751 2751 … … 2766 2766 /* CR4 MB1 bits. */ 2767 2767 uint64_t const u64Cr4Fixed0 = CPUMGetGuestIa32VmxCr4Fixed0(pVCpu); 2768 if ( ~pVmcs->u64GuestCr4.u &u64Cr4Fixed0)2768 if ((pVmcs->u64GuestCr4.u & u64Cr4Fixed0) != u64Cr4Fixed0) 2769 2769 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_GuestCr4Fixed0); 2770 2770 … … 3733 3733 /* CR0 MB1 bits. */ 3734 3734 uint64_t const u64Cr0Fixed0 = CPUMGetGuestIa32VmxCr0Fixed0(pVCpu); 3735 if ( ~pVmcs->u64HostCr0.u &u64Cr0Fixed0)3735 if ((pVmcs->u64HostCr0.u & u64Cr0Fixed0) != u64Cr0Fixed0) 3736 3736 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_HostCr0Fixed0); 3737 3737 … … 3746 3746 /* CR4 MB1 bits. */ 3747 3747 uint64_t const u64Cr4Fixed0 = CPUMGetGuestIa32VmxCr4Fixed0(pVCpu); 3748 if ( ~pVmcs->u64HostCr4.u &u64Cr4Fixed0)3748 if ((pVmcs->u64HostCr4.u & u64Cr4Fixed0) != u64Cr4Fixed0) 3749 3749 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_HostCr4Fixed0); 3750 3750 … … 5592 5592 } 5593 5593 5594 /* CR0 MB1 bits. */ 5595 uint64_t const uCr0Fixed0 = CPUMGetGuestIa32VmxCr0Fixed0(pVCpu); 5596 if (~pVCpu->cpum.GstCtx.cr0 & uCr0Fixed0) 5597 { 5598 Log(("vmxon: CR0 fixed0 bits cleared -> #GP(0)\n")); 5599 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmxon_Cr0Fixed0; 5600 return iemRaiseGeneralProtectionFault0(pVCpu); 5601 } 5602 5603 /* CR4 MB1 bits. */ 5604 uint64_t const uCr4Fixed0 = CPUMGetGuestIa32VmxCr4Fixed0(pVCpu); 5605 if (~pVCpu->cpum.GstCtx.cr4 & uCr4Fixed0) 5606 { 5607 Log(("vmxon: CR4 fixed0 bits cleared -> #GP(0)\n")); 5608 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmxon_Cr4Fixed0; 5609 return iemRaiseGeneralProtectionFault0(pVCpu); 5594 /* CR0. */ 5595 { 5596 /* CR0 MB1 bits. */ 5597 uint64_t const uCr0Fixed0 = CPUMGetGuestIa32VmxCr0Fixed0(pVCpu); 5598 if ((pVCpu->cpum.GstCtx.cr0 & uCr0Fixed0) != uCr0Fixed0) 5599 { 5600 Log(("vmxon: CR0 fixed0 bits cleared -> #GP(0)\n")); 5601 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmxon_Cr0Fixed0; 5602 return iemRaiseGeneralProtectionFault0(pVCpu); 5603 } 5604 5605 /* CR0 MBZ bits. */ 5606 uint64_t const uCr0Fixed1 = CPUMGetGuestIa32VmxCr0Fixed1(pVCpu); 5607 if (pVCpu->cpum.GstCtx.cr0 & ~uCr0Fixed1) 5608 { 5609 Log(("vmxon: CR0 fixed1 bits set -> #GP(0)\n")); 5610 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmxon_Cr0Fixed1; 5611 return iemRaiseGeneralProtectionFault0(pVCpu); 5612 } 5613 } 5614 5615 /* CR4. */ 5616 { 5617 /* CR4 MB1 bits. */ 5618 uint64_t const uCr4Fixed0 = CPUMGetGuestIa32VmxCr4Fixed0(pVCpu); 5619 if ((pVCpu->cpum.GstCtx.cr4 & uCr4Fixed0) != uCr4Fixed0) 5620 { 5621 Log(("vmxon: CR4 fixed0 bits cleared -> #GP(0)\n")); 5622 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmxon_Cr4Fixed0; 5623 return iemRaiseGeneralProtectionFault0(pVCpu); 5624 } 5625 5626 /* CR4 MBZ bits. */ 5627 uint64_t const uCr4Fixed1 = CPUMGetGuestIa32VmxCr4Fixed1(pVCpu); 5628 if (pVCpu->cpum.GstCtx.cr4 & ~uCr4Fixed1) 5629 { 5630 Log(("vmxon: CR4 fixed1 bits set -> #GP(0)\n")); 5631 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmxon_Cr4Fixed1; 5632 return iemRaiseGeneralProtectionFault0(pVCpu); 5633 } 5610 5634 } 5611 5635
Note:
See TracChangeset
for help on using the changeset viewer.