Changeset 91291 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 16, 2021 10:04:16 PM (3 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h
r91289 r91291 563 563 * Copy the IO permission bitmap into the cache. 564 564 */ 565 Assert (pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pvIoBitmap));566 rc = PGMPhysSimpleReadGCPhys(pVM, pVCpu->cpum.GstCtx.hwvirt.svm. CTX_SUFF(pvIoBitmap), GCPhysIOBitmap,567 SVM_IOPM_PAGES * X86_PAGE_4K_SIZE);565 AssertCompile(sizeof(pVCpu->cpum.GstCtx.hwvirt.svm.abIoBitmap) == SVM_IOPM_PAGES * X86_PAGE_4K_SIZE); 566 rc = PGMPhysSimpleReadGCPhys(pVM, pVCpu->cpum.GstCtx.hwvirt.svm.abIoBitmap, GCPhysIOBitmap, 567 sizeof(pVCpu->cpum.GstCtx.hwvirt.svm.abIoBitmap)); 568 568 if (RT_FAILURE(rc)) 569 569 { … … 989 989 990 990 SVMIOIOEXITINFO IoExitInfo; 991 void *pvIoBitmap = pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pvIoBitmap); 992 bool const fIntercept = CPUMIsSvmIoInterceptSet(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, 993 fStrIo, &IoExitInfo); 991 bool const fIntercept = CPUMIsSvmIoInterceptSet(pVCpu->cpum.GstCtx.hwvirt.svm.abMsrBitmap, u16Port, enmIoType, cbReg, 992 cAddrSizeBits, iEffSeg, fRep, fStrIo, &IoExitInfo); 994 993 if (fIntercept) 995 994 { -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r91289 r91291 4962 4962 if (CPUMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx, SVM_CTRL_INTERCEPT_IOIO_PROT)) 4963 4963 { 4964 void *pvIoBitmap = pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pvIoBitmap);4965 4964 SVMIOIOEXITINFO IoExitInfo; 4966 4965 IoExitInfo.u = pVmcbNstGst->ctrl.u64ExitInfo1; 4967 bool const fIntercept = hmR0SvmIsIoInterceptSet(p vIoBitmap, &IoExitInfo);4966 bool const fIntercept = hmR0SvmIsIoInterceptSet(pVCpu->cpum.GstCtx.hwvirt.svm.abIoBitmap, &IoExitInfo); 4968 4967 if (fIntercept) 4969 4968 NST_GST_VMEXIT_CALL_RET(pVCpu, uExitCode, uExitInfo1, uExitInfo2); -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r91289 r91291 1018 1018 { 1019 1019 Assert(pVM->cpum.s.GuestFeatures.fSvm); 1020 for (VMCPUID i = 0; i < pVM->cCpus; i++) 1021 { 1022 PVMCPU pVCpu = pVM->apCpusR3[i]; 1023 1024 if (pVCpu->cpum.s.Guest.hwvirt.svm.pvIoBitmapR3) 1025 { 1026 SUPR3PageFreeEx(pVCpu->cpum.s.Guest.hwvirt.svm.pvIoBitmapR3, SVM_IOPM_PAGES); 1027 pVCpu->cpum.s.Guest.hwvirt.svm.pvIoBitmapR3 = NULL; 1028 } 1029 } 1020 RT_NOREF(pVM); 1030 1021 } 1031 1022 … … 1051 1042 AssertCompile(SVM_VMCB_PAGES * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.Vmcb)); 1052 1043 AssertCompile(SVM_MSRPM_PAGES * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.abMsrBitmap)); 1053 1054 /* 1055 * Allocate the IOPM (IO Permission bitmap). 1056 * 1057 * This need not be physically contiguous pages because we re-use the ring-0 1058 * allocated IOPM while executing the nested-guest using hardware-assisted SVM 1059 * because it's identical (we trap all IO accesses). 1060 * 1061 * This one is just used for caching the IOPM from guest physical memory in 1062 * case the guest hypervisor allows direct access to some IO ports. 1063 */ 1064 Assert(!pVCpu->cpum.s.Guest.hwvirt.svm.pvIoBitmapR3); 1065 rc = SUPR3PageAllocEx(SVM_IOPM_PAGES, 0 /* fFlags */, &pVCpu->cpum.s.Guest.hwvirt.svm.pvIoBitmapR3, 1066 &pVCpu->cpum.s.Guest.hwvirt.svm.pvIoBitmapR0, NULL /* paPages */); 1067 if (RT_FAILURE(rc)) 1068 { 1069 Assert(!pVCpu->cpum.s.Guest.hwvirt.svm.pvIoBitmapR3); 1070 LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's IO permission bitmap\n", pVCpu->idCpu, 1071 SVM_IOPM_PAGES)); 1072 break; 1073 } 1044 AssertCompile(SVM_IOPM_PAGES * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.abIoBitmap)); 1074 1045 } 1075 1046 … … 2631 2602 SSMR3PutMem(pSSM, &pGstCtx->hwvirt.svm.Vmcb, sizeof(pGstCtx->hwvirt.svm.Vmcb)); 2632 2603 SSMR3PutMem(pSSM, &pGstCtx->hwvirt.svm.abMsrBitmap[0], sizeof(pGstCtx->hwvirt.svm.abMsrBitmap)); 2633 SSMR3PutMem(pSSM, pGstCtx->hwvirt.svm.pvIoBitmapR3, SVM_IOPM_PAGES << X86_PAGE_4K_SHIFT);2604 SSMR3PutMem(pSSM, &pGstCtx->hwvirt.svm.abIoBitmap[0], sizeof(pGstCtx->hwvirt.svm.abIoBitmap)); 2634 2605 SSMR3PutU32(pSSM, pGstCtx->hwvirt.fLocalForcedActions); 2635 2606 SSMR3PutBool(pSSM, pGstCtx->hwvirt.fGif); … … 2915 2886 SSMR3GetStructEx(pSSM, &pGstCtx->hwvirt.svm.HostState, sizeof(pGstCtx->hwvirt.svm.HostState), 2916 2887 0 /* fFlags */, g_aSvmHwvirtHostState, NULL /* pvUser */); 2917 SSMR3GetMem(pSSM, &pGstCtx->hwvirt.svm.Vmcb, sizeof(pGstCtx->hwvirt.svm.Vmcb));2888 SSMR3GetMem(pSSM, &pGstCtx->hwvirt.svm.Vmcb, sizeof(pGstCtx->hwvirt.svm.Vmcb)); 2918 2889 SSMR3GetMem(pSSM, &pGstCtx->hwvirt.svm.abMsrBitmap[0], sizeof(pGstCtx->hwvirt.svm.abMsrBitmap)); 2919 SSMR3GetMem(pSSM, pGstCtx->hwvirt.svm.pvIoBitmapR3, SVM_IOPM_PAGES << X86_PAGE_4K_SHIFT);2890 SSMR3GetMem(pSSM, &pGstCtx->hwvirt.svm.abIoBitmap[0], sizeof(pGstCtx->hwvirt.svm.abIoBitmap)); 2920 2891 SSMR3GetU32(pSSM, &pGstCtx->hwvirt.fLocalForcedActions); 2921 2892 SSMR3GetBool(pSSM, &pGstCtx->hwvirt.fGif); … … 4134 4105 pHlp->pfnPrintf(pHlp, " cPauseFilterThreshold = %RU32\n", pCtx->hwvirt.svm.cPauseFilterThreshold); 4135 4106 pHlp->pfnPrintf(pHlp, " fInterceptEvents = %u\n", pCtx->hwvirt.svm.fInterceptEvents); 4136 pHlp->pfnPrintf(pHlp, " pvIoBitmapR3 = %p\n", pCtx->hwvirt.svm.pvIoBitmapR3);4137 pHlp->pfnPrintf(pHlp, " pvIoBitmapR0 = %RKv\n", pCtx->hwvirt.svm.pvIoBitmapR0);4138 4107 } 4139 4108 else if (fVmx) -
trunk/src/VBox/VMM/include/CPUMInternal.mac
r91289 r91291 233 233 .Guest.hwvirt.svm.Vmcb resb 4096 234 234 .Guest.hwvirt.svm.abMsrBitmap resb 8192 235 .Guest.hwvirt.svm.abIoBitmap resb 12288 235 236 .Guest.hwvirt.svm.uMsrHSavePa resq 1 236 237 .Guest.hwvirt.svm.GCPhysVmcb resq 1 … … 241 242 .Guest.hwvirt.svm.cPauseFilterThreshold resw 1 242 243 .Guest.hwvirt.svm.fInterceptEvents resb 1 243 alignb 8244 .Guest.hwvirt.svm.pvIoBitmapR0 RTR0PTR_RES 1245 alignb 8246 .Guest.hwvirt.svm.pvIoBitmapR3 RTR3PTR_RES 1247 244 248 245 ;.unnamed_padding.1 resb 0 -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r91289 r91291 130 130 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.Vmcb); 131 131 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.abMsrBitmap); 132 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.abIoBitmap); 132 133 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.uMsrHSavePa); 133 134 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.GCPhysVmcb); … … 137 138 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.cPauseFilterThreshold); 138 139 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.fInterceptEvents); 139 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.pvIoBitmapR0);140 GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.pvIoBitmapR3);141 140 GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.GCPhysVmxon); 142 141 GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.GCPhysVmcs); -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r91290 r91291 251 251 CHECK_MEMBER_ALIGNMENT(VMCPU, cpum.s.Guest.hwvirt.svm.Vmcb, 4096); 252 252 CHECK_MEMBER_ALIGNMENT(VMCPU, cpum.s.Guest.hwvirt.svm.abMsrBitmap, 4096); 253 CHECK_MEMBER_ALIGNMENT(VMCPU, cpum.s.Guest.hwvirt.svm.abIoBitmap, 4096); 253 254 254 255 PVM pVM = NULL; NOREF(pVM);
Note:
See TracChangeset
for help on using the changeset viewer.