- Timestamp:
- May 3, 2019 8:21:44 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r78220 r78371 3162 3162 } 3163 3163 3164 3165 /** 3166 * Gets the read and write permission bits for an MSR in an MSR bitmap. 3167 * 3168 * @returns VMXMSRPM_XXX - the MSR permission. 3169 * @param pvMsrBitmap Pointer to the MSR bitmap. 3170 * @param idMsr The MSR to get permissions for. 3171 * 3172 * @sa hmR0VmxSetMsrPermission. 3173 */ 3174 VMM_INT_DECL(uint32_t) CPUMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr) 3175 { 3176 AssertPtrReturn(pvMsrBitmap, VMXMSRPM_EXIT_RD | VMXMSRPM_EXIT_WR); 3177 3178 uint8_t const * const pbMsrBitmap = (uint8_t const * const)pvMsrBitmap; 3179 3180 /* 3181 * MSR Layout: 3182 * Byte index MSR range Interpreted as 3183 * 0x000 - 0x3ff 0x00000000 - 0x00001fff Low MSR read bits. 3184 * 0x400 - 0x7ff 0xc0000000 - 0xc0001fff High MSR read bits. 3185 * 0x800 - 0xbff 0x00000000 - 0x00001fff Low MSR write bits. 3186 * 0xc00 - 0xfff 0xc0000000 - 0xc0001fff High MSR write bits. 3187 * 3188 * A bit corresponding to an MSR within the above range causes a VM-exit 3189 * if the bit is 1 on executions of RDMSR/WRMSR. If an MSR falls out of 3190 * the MSR range, it always cause a VM-exit. 3191 * 3192 * See Intel spec. 24.6.9 "MSR-Bitmap Address". 3193 */ 3194 uint32_t const offBitmapRead = 0; 3195 uint32_t const offBitmapWrite = 0x800; 3196 uint32_t offMsr; 3197 uint32_t iBit; 3198 if (idMsr <= UINT32_C(0x00001fff)) 3199 { 3200 offMsr = 0; 3201 iBit = idMsr; 3202 } 3203 else if (idMsr - UINT32_C(0xc0000000) <= UINT32_C(0x00001fff)) 3204 { 3205 offMsr = 0x400; 3206 iBit = idMsr - UINT32_C(0xc0000000); 3207 } 3208 else 3209 { 3210 LogFunc(("Warning! Out of range MSR %#RX32\n", idMsr)); 3211 return VMXMSRPM_EXIT_RD | VMXMSRPM_EXIT_WR; 3212 } 3213 3214 /* 3215 * Get the MSR read permissions. 3216 */ 3217 uint32_t fRet; 3218 uint32_t const offMsrRead = offBitmapRead + offMsr; 3219 Assert(offMsrRead + (iBit >> 3) < offBitmapWrite); 3220 if (ASMBitTest(pbMsrBitmap + offMsrRead, iBit)) 3221 fRet = VMXMSRPM_EXIT_RD; 3222 else 3223 fRet = VMXMSRPM_ALLOW_RD; 3224 3225 /* 3226 * Get the MSR write permissions. 3227 */ 3228 uint32_t const offMsrWrite = offBitmapWrite + offMsr; 3229 Assert(offMsrWrite + (iBit >> 3) < X86_PAGE_4K_SIZE); 3230 if (ASMBitTest(pbMsrBitmap + offMsrWrite, iBit)) 3231 fRet |= VMXMSRPM_EXIT_WR; 3232 else 3233 fRet |= VMXMSRPM_ALLOW_WR; 3234 3235 Assert(VMXMSRPM_IS_FLAG_VALID(fRet)); 3236 return fRet; 3237 } 3238 3239 3240 /** 3241 * Gets the permission bits for the specified I/O port from the given I/O bitmaps. 3242 * 3243 * @returns @c true if the I/O port access must cause a VM-exit, @c false otherwise. 3244 * @param pvIoBitmapA Pointer to I/O bitmap A. 3245 * @param pvIoBitmapB Pointer to I/O bitmap B. 3246 * @param uPort The I/O port being accessed. 3247 * @param cbAccess The size of the I/O access in bytes (1, 2 or 4 bytes). 3248 */ 3249 VMM_INT_DECL(bool) CPUMGetVmxIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort, 3250 uint8_t cbAccess) 3251 { 3252 Assert(cbAccess == 1 || cbAccess == 2 || cbAccess == 4); 3253 3254 /* 3255 * If the I/O port access wraps around the 16-bit port I/O space, 3256 * we must cause a VM-exit. 3257 * 3258 * See Intel spec. 25.1.3 "Instructions That Cause VM Exits Conditionally". 3259 */ 3260 /** @todo r=ramshankar: Reading 1, 2, 4 bytes at ports 0xffff, 0xfffe and 0xfffc 3261 * respectively are valid and do not constitute a wrap around from what I 3262 * understand. Verify this later. */ 3263 uint32_t const uPortLast = uPort + cbAccess; 3264 if (uPortLast > 0x10000) 3265 return true; 3266 3267 /* Read the appropriate bit from the corresponding IO bitmap. */ 3268 void const *pvIoBitmap = uPort < 0x8000 ? pvIoBitmapA : pvIoBitmapB; 3269 return ASMBitTest(pvIoBitmap, uPort); 3270 } 3271 3272 3273 /** 3274 * Determines whether an IOIO intercept is active for the nested-guest or not. 3275 * 3276 * @param pvIoBitmap Pointer to the nested-guest IO bitmap. 3277 * @param u16Port The IO port being accessed. 3278 * @param enmIoType The type of IO access. 3279 * @param cbReg The IO operand size in bytes. 3280 * @param cAddrSizeBits The address size bits (for 16, 32 or 64). 3281 * @param iEffSeg The effective segment number. 3282 * @param fRep Whether this is a repeating IO instruction (REP prefix). 3283 * @param fStrIo Whether this is a string IO instruction. 3284 * @param pIoExitInfo Pointer to the SVMIOIOEXITINFO struct to be filled. 3285 * Optional, can be NULL. 3286 */ 3287 VMM_INT_DECL(bool) CPUMIsSvmIoInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg, 3288 uint8_t cAddrSizeBits, uint8_t iEffSeg, bool fRep, bool fStrIo, 3289 PSVMIOIOEXITINFO pIoExitInfo) 3290 { 3291 Assert(cAddrSizeBits == 16 || cAddrSizeBits == 32 || cAddrSizeBits == 64); 3292 Assert(cbReg == 1 || cbReg == 2 || cbReg == 4 || cbReg == 8); 3293 3294 /* 3295 * The IOPM layout: 3296 * Each bit represents one 8-bit port. That makes a total of 0..65535 bits or 3297 * two 4K pages. 3298 * 3299 * For IO instructions that access more than a single byte, the permission bits 3300 * for all bytes are checked; if any bit is set to 1, the IO access is intercepted. 3301 * 3302 * Since it's possible to do a 32-bit IO access at port 65534 (accessing 4 bytes), 3303 * we need 3 extra bits beyond the second 4K page. 3304 */ 3305 static const uint16_t s_auSizeMasks[] = { 0, 1, 3, 0, 0xf, 0, 0, 0 }; 3306 3307 uint16_t const offIopm = u16Port >> 3; 3308 uint16_t const fSizeMask = s_auSizeMasks[(cAddrSizeBits >> SVM_IOIO_OP_SIZE_SHIFT) & 7]; 3309 uint8_t const cShift = u16Port - (offIopm << 3); 3310 uint16_t const fIopmMask = (1 << cShift) | (fSizeMask << cShift); 3311 3312 uint8_t const *pbIopm = (uint8_t *)pvIoBitmap; 3313 Assert(pbIopm); 3314 pbIopm += offIopm; 3315 uint16_t const u16Iopm = *(uint16_t *)pbIopm; 3316 if (u16Iopm & fIopmMask) 3317 { 3318 if (pIoExitInfo) 3319 { 3320 static const uint32_t s_auIoOpSize[] = 3321 { SVM_IOIO_32_BIT_OP, SVM_IOIO_8_BIT_OP, SVM_IOIO_16_BIT_OP, 0, SVM_IOIO_32_BIT_OP, 0, 0, 0 }; 3322 3323 static const uint32_t s_auIoAddrSize[] = 3324 { 0, SVM_IOIO_16_BIT_ADDR, SVM_IOIO_32_BIT_ADDR, 0, SVM_IOIO_64_BIT_ADDR, 0, 0, 0 }; 3325 3326 pIoExitInfo->u = s_auIoOpSize[cbReg & 7]; 3327 pIoExitInfo->u |= s_auIoAddrSize[(cAddrSizeBits >> 4) & 7]; 3328 pIoExitInfo->n.u1Str = fStrIo; 3329 pIoExitInfo->n.u1Rep = fRep; 3330 pIoExitInfo->n.u3Seg = iEffSeg & 7; 3331 pIoExitInfo->n.u1Type = enmIoType; 3332 pIoExitInfo->n.u16Port = u16Port; 3333 } 3334 return true; 3335 } 3336 3337 /** @todo remove later (for debugging as VirtualBox always traps all IO 3338 * intercepts). */ 3339 AssertMsgFailed(("CPUMSvmIsIOInterceptActive: We expect an IO intercept here!\n")); 3340 return false; 3341 } 3342 3343 3344 /** 3345 * Gets the MSR permission bitmap byte and bit offset for the specified MSR. 3346 * 3347 * @returns VBox status code. 3348 * @param idMsr The MSR being requested. 3349 * @param pbOffMsrpm Where to store the byte offset in the MSR permission 3350 * bitmap for @a idMsr. 3351 * @param puMsrpmBit Where to store the bit offset starting at the byte 3352 * returned in @a pbOffMsrpm. 3353 */ 3354 VMM_INT_DECL(int) CPUMGetSvmMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit) 3355 { 3356 Assert(pbOffMsrpm); 3357 Assert(puMsrpmBit); 3358 3359 /* 3360 * MSRPM Layout: 3361 * Byte offset MSR range 3362 * 0x000 - 0x7ff 0x00000000 - 0x00001fff 3363 * 0x800 - 0xfff 0xc0000000 - 0xc0001fff 3364 * 0x1000 - 0x17ff 0xc0010000 - 0xc0011fff 3365 * 0x1800 - 0x1fff Reserved 3366 * 3367 * Each MSR is represented by 2 permission bits (read and write). 3368 */ 3369 if (idMsr <= 0x00001fff) 3370 { 3371 /* Pentium-compatible MSRs. */ 3372 uint32_t const bitoffMsr = idMsr << 1; 3373 *pbOffMsrpm = bitoffMsr >> 3; 3374 *puMsrpmBit = bitoffMsr & 7; 3375 return VINF_SUCCESS; 3376 } 3377 3378 if ( idMsr >= 0xc0000000 3379 && idMsr <= 0xc0001fff) 3380 { 3381 /* AMD Sixth Generation x86 Processor MSRs. */ 3382 uint32_t const bitoffMsr = (idMsr - 0xc0000000) << 1; 3383 *pbOffMsrpm = 0x800 + (bitoffMsr >> 3); 3384 *puMsrpmBit = bitoffMsr & 7; 3385 return VINF_SUCCESS; 3386 } 3387 3388 if ( idMsr >= 0xc0010000 3389 && idMsr <= 0xc0011fff) 3390 { 3391 /* AMD Seventh and Eighth Generation Processor MSRs. */ 3392 uint32_t const bitoffMsr = (idMsr - 0xc0010000) << 1; 3393 *pbOffMsrpm = 0x1000 + (bitoffMsr >> 3); 3394 *puMsrpmBit = bitoffMsr & 7; 3395 return VINF_SUCCESS; 3396 } 3397 3398 *pbOffMsrpm = 0; 3399 *puMsrpmBit = 0; 3400 return VERR_OUT_OF_RANGE; 3401 } 3402 -
trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp
r78220 r78371 319 319 #endif /* !IN_RC */ 320 320 321 /**322 * Gets the MSR permission bitmap byte and bit offset for the specified MSR.323 *324 * @returns VBox status code.325 * @param idMsr The MSR being requested.326 * @param pbOffMsrpm Where to store the byte offset in the MSR permission327 * bitmap for @a idMsr.328 * @param puMsrpmBit Where to store the bit offset starting at the byte329 * returned in @a pbOffMsrpm.330 */331 VMM_INT_DECL(int) HMGetSvmMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit)332 {333 Assert(pbOffMsrpm);334 Assert(puMsrpmBit);335 336 /*337 * MSRPM Layout:338 * Byte offset MSR range339 * 0x000 - 0x7ff 0x00000000 - 0x00001fff340 * 0x800 - 0xfff 0xc0000000 - 0xc0001fff341 * 0x1000 - 0x17ff 0xc0010000 - 0xc0011fff342 * 0x1800 - 0x1fff Reserved343 *344 * Each MSR is represented by 2 permission bits (read and write).345 */346 if (idMsr <= 0x00001fff)347 {348 /* Pentium-compatible MSRs. */349 uint32_t const bitoffMsr = idMsr << 1;350 *pbOffMsrpm = bitoffMsr >> 3;351 *puMsrpmBit = bitoffMsr & 7;352 return VINF_SUCCESS;353 }354 355 if ( idMsr >= 0xc0000000356 && idMsr <= 0xc0001fff)357 {358 /* AMD Sixth Generation x86 Processor MSRs. */359 uint32_t const bitoffMsr = (idMsr - 0xc0000000) << 1;360 *pbOffMsrpm = 0x800 + (bitoffMsr >> 3);361 *puMsrpmBit = bitoffMsr & 7;362 return VINF_SUCCESS;363 }364 365 if ( idMsr >= 0xc0010000366 && idMsr <= 0xc0011fff)367 {368 /* AMD Seventh and Eighth Generation Processor MSRs. */369 uint32_t const bitoffMsr = (idMsr - 0xc0010000) << 1;370 *pbOffMsrpm = 0x1000 + (bitoffMsr >> 3);371 *puMsrpmBit = bitoffMsr & 7;372 return VINF_SUCCESS;373 }374 375 *pbOffMsrpm = 0;376 *puMsrpmBit = 0;377 return VERR_OUT_OF_RANGE;378 }379 380 381 /**382 * Determines whether an IOIO intercept is active for the nested-guest or not.383 *384 * @param pvIoBitmap Pointer to the nested-guest IO bitmap.385 * @param u16Port The IO port being accessed.386 * @param enmIoType The type of IO access.387 * @param cbReg The IO operand size in bytes.388 * @param cAddrSizeBits The address size bits (for 16, 32 or 64).389 * @param iEffSeg The effective segment number.390 * @param fRep Whether this is a repeating IO instruction (REP prefix).391 * @param fStrIo Whether this is a string IO instruction.392 * @param pIoExitInfo Pointer to the SVMIOIOEXITINFO struct to be filled.393 * Optional, can be NULL.394 */395 VMM_INT_DECL(bool) HMIsSvmIoInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,396 uint8_t cAddrSizeBits, uint8_t iEffSeg, bool fRep, bool fStrIo,397 PSVMIOIOEXITINFO pIoExitInfo)398 {399 Assert(cAddrSizeBits == 16 || cAddrSizeBits == 32 || cAddrSizeBits == 64);400 Assert(cbReg == 1 || cbReg == 2 || cbReg == 4 || cbReg == 8);401 402 /*403 * The IOPM layout:404 * Each bit represents one 8-bit port. That makes a total of 0..65535 bits or405 * two 4K pages.406 *407 * For IO instructions that access more than a single byte, the permission bits408 * for all bytes are checked; if any bit is set to 1, the IO access is intercepted.409 *410 * Since it's possible to do a 32-bit IO access at port 65534 (accessing 4 bytes),411 * we need 3 extra bits beyond the second 4K page.412 */413 static const uint16_t s_auSizeMasks[] = { 0, 1, 3, 0, 0xf, 0, 0, 0 };414 415 uint16_t const offIopm = u16Port >> 3;416 uint16_t const fSizeMask = s_auSizeMasks[(cAddrSizeBits >> SVM_IOIO_OP_SIZE_SHIFT) & 7];417 uint8_t const cShift = u16Port - (offIopm << 3);418 uint16_t const fIopmMask = (1 << cShift) | (fSizeMask << cShift);419 420 uint8_t const *pbIopm = (uint8_t *)pvIoBitmap;421 Assert(pbIopm);422 pbIopm += offIopm;423 uint16_t const u16Iopm = *(uint16_t *)pbIopm;424 if (u16Iopm & fIopmMask)425 {426 if (pIoExitInfo)427 {428 static const uint32_t s_auIoOpSize[] =429 { SVM_IOIO_32_BIT_OP, SVM_IOIO_8_BIT_OP, SVM_IOIO_16_BIT_OP, 0, SVM_IOIO_32_BIT_OP, 0, 0, 0 };430 431 static const uint32_t s_auIoAddrSize[] =432 { 0, SVM_IOIO_16_BIT_ADDR, SVM_IOIO_32_BIT_ADDR, 0, SVM_IOIO_64_BIT_ADDR, 0, 0, 0 };433 434 pIoExitInfo->u = s_auIoOpSize[cbReg & 7];435 pIoExitInfo->u |= s_auIoAddrSize[(cAddrSizeBits >> 4) & 7];436 pIoExitInfo->n.u1Str = fStrIo;437 pIoExitInfo->n.u1Rep = fRep;438 pIoExitInfo->n.u3Seg = iEffSeg & 7;439 pIoExitInfo->n.u1Type = enmIoType;440 pIoExitInfo->n.u16Port = u16Port;441 }442 return true;443 }444 445 /** @todo remove later (for debugging as VirtualBox always traps all IO446 * intercepts). */447 AssertMsgFailed(("CPUMSvmIsIOInterceptActive: We expect an IO intercept here!\n"));448 return false;449 }450 451 321 452 322 /** -
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r78220 r78371 859 859 860 860 /** 861 * Gets the read and write permission bits for an MSR in an MSR bitmap.862 *863 * @returns VMXMSRPM_XXX - the MSR permission.864 * @param pvMsrBitmap Pointer to the MSR bitmap.865 * @param idMsr The MSR to get permissions for.866 *867 * @sa hmR0VmxSetMsrPermission.868 */869 VMM_INT_DECL(uint32_t) HMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr)870 {871 AssertPtrReturn(pvMsrBitmap, VMXMSRPM_EXIT_RD | VMXMSRPM_EXIT_WR);872 873 uint8_t const * const pbMsrBitmap = (uint8_t const * const)pvMsrBitmap;874 875 /*876 * MSR Layout:877 * Byte index MSR range Interpreted as878 * 0x000 - 0x3ff 0x00000000 - 0x00001fff Low MSR read bits.879 * 0x400 - 0x7ff 0xc0000000 - 0xc0001fff High MSR read bits.880 * 0x800 - 0xbff 0x00000000 - 0x00001fff Low MSR write bits.881 * 0xc00 - 0xfff 0xc0000000 - 0xc0001fff High MSR write bits.882 *883 * A bit corresponding to an MSR within the above range causes a VM-exit884 * if the bit is 1 on executions of RDMSR/WRMSR. If an MSR falls out of885 * the MSR range, it always cause a VM-exit.886 *887 * See Intel spec. 24.6.9 "MSR-Bitmap Address".888 */889 uint32_t const offBitmapRead = 0;890 uint32_t const offBitmapWrite = 0x800;891 uint32_t offMsr;892 uint32_t iBit;893 if (idMsr <= UINT32_C(0x00001fff))894 {895 offMsr = 0;896 iBit = idMsr;897 }898 else if (idMsr - UINT32_C(0xc0000000) <= UINT32_C(0x00001fff))899 {900 offMsr = 0x400;901 iBit = idMsr - UINT32_C(0xc0000000);902 }903 else904 {905 LogFunc(("Warning! Out of range MSR %#RX32\n", idMsr));906 return VMXMSRPM_EXIT_RD | VMXMSRPM_EXIT_WR;907 }908 909 /*910 * Get the MSR read permissions.911 */912 uint32_t fRet;913 uint32_t const offMsrRead = offBitmapRead + offMsr;914 Assert(offMsrRead + (iBit >> 3) < offBitmapWrite);915 if (ASMBitTest(pbMsrBitmap + offMsrRead, iBit))916 fRet = VMXMSRPM_EXIT_RD;917 else918 fRet = VMXMSRPM_ALLOW_RD;919 920 /*921 * Get the MSR write permissions.922 */923 uint32_t const offMsrWrite = offBitmapWrite + offMsr;924 Assert(offMsrWrite + (iBit >> 3) < X86_PAGE_4K_SIZE);925 if (ASMBitTest(pbMsrBitmap + offMsrWrite, iBit))926 fRet |= VMXMSRPM_EXIT_WR;927 else928 fRet |= VMXMSRPM_ALLOW_WR;929 930 Assert(VMXMSRPM_IS_FLAG_VALID(fRet));931 return fRet;932 }933 934 935 /**936 * Gets the permission bits for the specified I/O port from the given I/O bitmaps.937 *938 * @returns @c true if the I/O port access must cause a VM-exit, @c false otherwise.939 * @param pvIoBitmapA Pointer to I/O bitmap A.940 * @param pvIoBitmapB Pointer to I/O bitmap B.941 * @param uPort The I/O port being accessed.942 * @param cbAccess The size of the I/O access in bytes (1, 2 or 4 bytes).943 */944 VMM_INT_DECL(bool) HMGetVmxIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort, uint8_t cbAccess)945 {946 Assert(cbAccess == 1 || cbAccess == 2 || cbAccess == 4);947 948 /*949 * If the I/O port access wraps around the 16-bit port I/O space,950 * we must cause a VM-exit.951 *952 * See Intel spec. 25.1.3 "Instructions That Cause VM Exits Conditionally".953 */954 /** @todo r=ramshankar: Reading 1, 2, 4 bytes at ports 0xffff, 0xfffe and 0xfffc955 * respectively are valid and do not constitute a wrap around from what I956 * understand. Verify this later. */957 uint32_t const uPortLast = uPort + cbAccess;958 if (uPortLast > 0x10000)959 return true;960 961 /* Read the appropriate bit from the corresponding IO bitmap. */962 void const *pvIoBitmap = uPort < 0x8000 ? pvIoBitmapA : pvIoBitmapB;963 return ASMBitTest(pvIoBitmap, uPort);964 }965 966 967 /**968 861 * Dumps the virtual VMCS state to the release log. 969 862 * -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h
r77902 r78371 990 990 SVMIOIOEXITINFO IoExitInfo; 991 991 void *pvIoBitmap = pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pvIoBitmap); 992 bool const fIntercept = HMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep,992 bool const fIntercept = CPUMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, 993 993 fStrIo, &IoExitInfo); 994 994 if (fIntercept) … … 1039 1039 uint16_t offMsrpm; 1040 1040 uint8_t uMsrpmBit; 1041 int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);1041 int rc = CPUMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit); 1042 1042 if (RT_SUCCESS(rc)) 1043 1043 { -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r78239 r78371 3064 3064 Assert(pbIoBitmapA); 3065 3065 Assert(pbIoBitmapB); 3066 return HMGetVmxIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess);3066 return CPUMGetVmxIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess); 3067 3067 } 3068 3068 … … 7759 7759 { 7760 7760 Assert(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap)); 7761 uint32_t fMsrpm = HMGetVmxMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr);7761 uint32_t fMsrpm = CPUMGetVmxMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr); 7762 7762 if (uExitReason == VMX_EXIT_RDMSR) 7763 7763 return RT_BOOL(fMsrpm & VMXMSRPM_EXIT_RD); -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r78220 r78371 872 872 uint16_t offMsrpm; 873 873 uint8_t uMsrpmBit; 874 int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);874 int rc = CPUMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit); 875 875 AssertRC(rc); 876 876 … … 5145 5145 const bool fStrIo = pIoExitInfo->n.u1Str; 5146 5146 5147 return HMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, fStrIo,5147 return CPUMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, fStrIo, 5148 5148 NULL /* pIoExitInfo */); 5149 5149 } … … 5237 5237 uint16_t offMsrpm; 5238 5238 uint8_t uMsrpmBit; 5239 int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);5239 int rc = CPUMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit); 5240 5240 if (RT_SUCCESS(rc)) 5241 5241 { -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r78370 r78371 1550 1550 * include both a read -and- a write permission! 1551 1551 * 1552 * @sa HMGetVmxMsrPermission.1552 * @sa CPUMGetVmxMsrPermission. 1553 1553 * @remarks Can be called with interrupts disabled. 1554 1554 */ … … 2207 2207 if (pVmcsInfo->u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS) 2208 2208 { 2209 uint32_t const fMsrpm = HMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, pGuestMsrLoad->u32Msr);2209 uint32_t const fMsrpm = CPUMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, pGuestMsrLoad->u32Msr); 2210 2210 if (fIsEferMsr) 2211 2211 { … … 2905 2905 #ifdef VBOX_STRICT 2906 2906 Assert(pVmcsInfo->pvMsrBitmap); 2907 uint32_t const fMsrpmEfer = HMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, MSR_K6_EFER);2907 uint32_t const fMsrpmEfer = CPUMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, MSR_K6_EFER); 2908 2908 Assert(fMsrpmEfer == VMXMSRPM_EXIT_RD_WR); 2909 2909 #endif … … 10839 10839 * @param pcLoops Pointer to the number of executed loops. 10840 10840 * 10841 * @sa hmR0VmxRunGuestCodeNormal ().10841 * @sa hmR0VmxRunGuestCodeNormal. 10842 10842 */ 10843 10843 static VBOXSTRICTRC hmR0VmxRunGuestCodeNested(PVMCPU pVCpu, uint32_t *pcLoops) … … 13671 13671 { 13672 13672 Assert(pVmcsInfo->pvMsrBitmap); 13673 uint32_t fMsrpm = HMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, idMsr);13673 uint32_t fMsrpm = CPUMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, idMsr); 13674 13674 if (fMsrpm & VMXMSRPM_ALLOW_RD) 13675 13675 { … … 13816 13816 { 13817 13817 Assert(pVmcsInfo->pvMsrBitmap); 13818 uint32_t fMsrpm = HMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, idMsr);13818 uint32_t fMsrpm = CPUMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, idMsr); 13819 13819 if (fMsrpm & VMXMSRPM_ALLOW_WR) 13820 13820 { … … 14870 14870 * Hacks its way around the lovely mesa driver's backdoor accesses. 14871 14871 * 14872 * @sa hmR0SvmHandleMesaDrvGp 14872 * @sa hmR0SvmHandleMesaDrvGp. 14873 14873 */ 14874 14874 static int hmR0VmxHandleMesaDrvGp(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PCPUMCTX pCtx) … … 14890 14890 * 14891 14891 * @returns true if it is, false if it isn't. 14892 * @sa hmR0SvmIsMesaDrvGp 14892 * @sa hmR0SvmIsMesaDrvGp. 14893 14893 */ 14894 14894 DECLINLINE(bool) hmR0VmxIsMesaDrvGp(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PCPUMCTX pCtx)
Note:
See TracChangeset
for help on using the changeset viewer.