- Timestamp:
- Oct 1, 2018 5:42:25 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpumctx.h
r74479 r74542 634 634 uint32_t uAutoMsrAreaR3; 635 635 #endif 636 /** 0x368 - Padding. */ 637 uint8_t abPadding[0x3f0 - 0x368]; 636 /** 0x368 - The MSR bitmap - R0 ptr. */ 637 R0PTRTYPE(void *) pvMsrBitmapR0; 638 #if HC_ARCH_BITS == 32 639 uint32_t uMsrBitmapR0; 640 #endif 641 /** 0x370 - The MSR bitmap - R3 ptr. */ 642 R3PTRTYPE(void *) pvMsrBitmapR3; 643 #if HC_ARCH_BITS == 32 644 uint32_t uMsrBitmapR3; 645 #endif 646 /** 0x378 - Padding. */ 647 uint8_t abPadding[0x3f0 - 0x378]; 638 648 } vmx; 639 649 } CPUM_UNION_NM(s); … … 741 751 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pvVmwriteBitmapR0, 8); 742 752 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pAutoMsrAreaR0, 8); 753 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pvMsrBitmapR0, 8); 743 754 AssertCompileMemberOffset(CPUMCTX, hwvirt.enmHwvirt, 0x3f0); 744 755 AssertCompileMemberOffset(CPUMCTX, hwvirt.fLocalForcedActions, 0x3f4); -
trunk/include/VBox/vmm/hm_vmx.h
r74523 r74542 3025 3025 /** The size of the VMREAD/VMWRITE-bitmap (in pages). */ 3026 3026 #define VMX_V_VMREAD_VMWRITE_BITMAP_PAGES 1 3027 3028 /** The size of the MSR bitmap (in bytes). */ 3029 #define VMX_V_MSR_BITMAP_SIZE X86_PAGE_4K_SIZE 3030 /** The size of the MSR bitmap (in pages). */ 3031 #define VMX_V_MSR_BITMAP_PAGES 1 3027 3032 3028 3033 /** The size of the auto-load/store MSR area (in bytes). */ … … 3824 3829 kVmxVDiag_Vmentry_HostSysenterEspEip, 3825 3830 kVmxVDiag_Vmentry_LongModeCS, 3831 kVmxVDiag_Vmentry_MsrBitmapPtrReadPhys, 3826 3832 kVmxVDiag_Vmentry_MsrLoad, 3827 3833 kVmxVDiag_Vmentry_MsrLoadCount, -
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r74523 r74542 310 310 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_HostSysenterEspEip , "HostSysenterEspEip" ), 311 311 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_LongModeCS , "LongModeCS" ), 312 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_MsrBitmapPtrReadPhys , "MsrBitmapPtrReadPhys" ), 312 313 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_MsrLoad , "MsrLoad" ), 313 314 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_MsrLoadCount , "MsrLoadCount" ), -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r74541 r74542 4133 4133 if (pVmcs->u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS) 4134 4134 { 4135 if ( (pVmcs->u64AddrMsrBitmap.u & X86_PAGE_4K_OFFSET_MASK) 4136 || (pVmcs->u64AddrMsrBitmap.u >> IEM_GET_GUEST_CPU_FEATURES(pVCpu)->cVmxMaxPhysAddrWidth) 4137 || !PGMPhysIsGCPhysNormal(pVCpu->CTX_SUFF(pVM), pVmcs->u64AddrMsrBitmap.u)) 4135 RTGCPHYS const GCPhysMsrBitmap = pVmcs->u64AddrMsrBitmap.u; 4136 if ( (GCPhysMsrBitmap & X86_PAGE_4K_OFFSET_MASK) 4137 || (GCPhysMsrBitmap >> IEM_GET_GUEST_CPU_FEATURES(pVCpu)->cVmxMaxPhysAddrWidth) 4138 || !PGMPhysIsGCPhysNormal(pVCpu->CTX_SUFF(pVM), GCPhysMsrBitmap)) 4138 4139 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_AddrMsrBitmap); 4140 4141 /* Read the MSR bitmap. */ 4142 Assert(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap)); 4143 int rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), 4144 GCPhysMsrBitmap, VMX_V_MSR_BITMAP_SIZE); 4145 if (RT_FAILURE(rc)) 4146 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_MsrBitmapPtrReadPhys); 4139 4147 } 4140 4148 -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r74512 r74542 954 954 pVCpu->cpum.s.Guest.hwvirt.vmx.pAutoMsrAreaR3 = NULL; 955 955 } 956 if (pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3) 957 { 958 SUPR3PageFreeEx(pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3, VMX_V_MSR_BITMAP_PAGES); 959 pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3 = NULL; 960 } 956 961 } 957 962 } … … 1036 1041 */ 1037 1042 Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pAutoMsrAreaR3); 1038 rc = SUPR3PageAllocEx(VMX_V_AUTOMSR_AREA_PAGES, 0 /* fFlags */, 1039 (void **)&pVCpu->cpum.s.Guest.hwvirt.vmx.pAutoMsrAreaR3, 1043 rc = SUPR3PageAllocEx(VMX_V_AUTOMSR_AREA_PAGES, 0 /* fFlags */, (void **)&pVCpu->cpum.s.Guest.hwvirt.vmx.pAutoMsrAreaR3, 1040 1044 &pVCpu->cpum.s.Guest.hwvirt.vmx.pAutoMsrAreaR0, NULL /* paPages */); 1041 1045 if (RT_FAILURE(rc)) … … 1044 1048 LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's auto-load/store MSR area\n", pVCpu->idCpu, 1045 1049 VMX_V_AUTOMSR_AREA_PAGES)); 1050 break; 1051 } 1052 1053 /* 1054 * Allocate the MSR bitmap. 1055 */ 1056 Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3); 1057 rc = SUPR3PageAllocEx(VMX_V_MSR_BITMAP_PAGES, 0 /* fFlags */, (void **)&pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3, 1058 &pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR0, NULL /* paPages */); 1059 if (RT_FAILURE(rc)) 1060 { 1061 Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3); 1062 LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's MSR bitmap\n", pVCpu->idCpu, 1063 VMX_V_MSR_BITMAP_PAGES)); 1046 1064 break; 1047 1065 } -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r74479 r74542 166 166 GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.pAutoMsrAreaR0); 167 167 GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.pAutoMsrAreaR3); 168 GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.pvMsrBitmapR0); 169 GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.pvMsrBitmapR3); 168 170 GEN_CHECK_OFF(CPUMCTX, hwvirt.enmHwvirt); 169 171 GEN_CHECK_OFF(CPUMCTX, hwvirt.fLocalForcedActions);
Note:
See TracChangeset
for help on using the changeset viewer.