Changeset 70000 in vbox for trunk/include/VBox
- Timestamp:
- Dec 8, 2017 5:57:18 AM (7 years ago)
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r69764 r70000 1203 1203 /** @name Nested Hardware-Virtualization Helpers. 1204 1204 * @{ */ 1205 VMM_INT_DECL(bool) CPUMCanSvmNstGstTakePhysIntr(P CCPUMCTX pCtx);1205 VMM_INT_DECL(bool) CPUMCanSvmNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx); 1206 1206 VMM_INT_DECL(bool) CPUMCanSvmNstGstTakeVirtIntr(PCCPUMCTX pCtx); 1207 1207 VMM_INT_DECL(uint8_t) CPUMGetSvmNstGstInterrupt(PCCPUMCTX pCtx); … … 1327 1327 * 1328 1328 * @returns @c true if in intercept is set, @c false otherwise. 1329 * @param p Ctx Pointer to the context.1330 * @param fIntercept The SVM control/instruction intercept,1331 * see SVM_CTRL_INTERCEPT_*.1332 * /1333 DECLINLINE(bool) CPUMIsGuestSvmCtrlInterceptSet(PCCPUMCTX pCtx, uint64_t fIntercept) 1334 { 1335 Assert(!pCtx->hwvirt.svm.fHMCachedVmcb); 1329 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1330 * @param pCtx Pointer to the context. 1331 * @param fIntercept The SVM control/instruction intercept, see 1332 * SVM_CTRL_INTERCEPT_*. 1333 */ 1334 DECLINLINE(bool) CPUMIsGuestSvmCtrlInterceptSet(PVMCPU pVCpu, PCPUMCTX pCtx, uint64_t fIntercept) 1335 { 1336 1336 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1337 return pVmcb && (pVmcb->ctrl.u64InterceptCtrl & fIntercept); 1337 if (!pVmcb) 1338 return false; 1339 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1340 return RT_BOOL(pVmcb->ctrl.u64InterceptCtrl & fIntercept); 1341 return HMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx, fIntercept); 1338 1342 } 1339 1343 1340 1344 /** 1341 * Checks if the guest VMCB has the specified CR read intercept 1342 * active. 1345 * Checks if the guest VMCB has the specified CR read intercept active. 1343 1346 * 1344 1347 * @returns @c true if in intercept is set, @c false otherwise. 1345 * @param pCtx Pointer to the context. 1346 * @param uCr The CR register number (0 to 15). 1347 */ 1348 DECLINLINE(bool) CPUMIsGuestSvmReadCRxInterceptSet(PCCPUMCTX pCtx, uint8_t uCr) 1349 { 1350 Assert(!pCtx->hwvirt.svm.fHMCachedVmcb); 1348 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1349 * @param pCtx Pointer to the context. 1350 * @param uCr The CR register number (0 to 15). 1351 */ 1352 DECLINLINE(bool) CPUMIsGuestSvmReadCRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uCr) 1353 { 1354 Assert(uCr < 16); 1351 1355 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1352 return pVmcb && (pVmcb->ctrl.u16InterceptRdCRx & (1 << uCr)); 1356 if (!pVmcb) 1357 return false; 1358 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1359 return RT_BOOL(pVmcb->ctrl.u16InterceptRdCRx & (UINT16_C(1) << uCr)); 1360 return HMIsGuestSvmReadCRxInterceptSet(pVCpu, pCtx, uCr); 1353 1361 } 1354 1362 1355 1363 /** 1356 * Checks if the guest VMCB has the specified CR write intercept 1357 * active. 1364 * Checks if the guest VMCB has the specified CR write intercept active. 1358 1365 * 1359 1366 * @returns @c true if in intercept is set, @c false otherwise. 1360 * @param pCtx Pointer to the context. 1361 * @param uCr The CR register number (0 to 15). 1362 */ 1363 DECLINLINE(bool) CPUMIsGuestSvmWriteCRxInterceptSet(PCCPUMCTX pCtx, uint8_t uCr) 1364 { 1365 Assert(!pCtx->hwvirt.svm.fHMCachedVmcb); 1367 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1368 * @param pCtx Pointer to the context. 1369 * @param uCr The CR register number (0 to 15). 1370 */ 1371 DECLINLINE(bool) CPUMIsGuestSvmWriteCRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uCr) 1372 { 1373 Assert(uCr < 16); 1366 1374 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1367 return pVmcb && (pVmcb->ctrl.u16InterceptWrCRx & (1 << uCr)); 1375 if (!pVmcb) 1376 return false; 1377 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1378 return RT_BOOL(pVmcb->ctrl.u16InterceptWrCRx & (UINT16_C(1) << uCr)); 1379 return HMIsGuestSvmWriteCRxInterceptSet(pVCpu, pCtx, uCr); 1368 1380 } 1369 1381 1370 1382 /** 1371 * Checks if the guest VMCB has the specified DR read intercept 1372 * active. 1383 * Checks if the guest VMCB has the specified DR read intercept active. 1373 1384 * 1374 1385 * @returns @c true if in intercept is set, @c false otherwise. 1386 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1375 1387 * @param pCtx Pointer to the context. 1376 1388 * @param uDr The DR register number (0 to 15). 1377 1389 */ 1378 DECLINLINE(bool) CPUMIsGuestSvmReadDRxInterceptSet(P CCPUMCTX pCtx, uint8_t uDr)1379 { 1380 Assert( !pCtx->hwvirt.svm.fHMCachedVmcb);1390 DECLINLINE(bool) CPUMIsGuestSvmReadDRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uDr) 1391 { 1392 Assert(uDr < 16); 1381 1393 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1382 return pVmcb && (pVmcb->ctrl.u16InterceptRdDRx & (1 << uDr)); 1394 if (!pVmcb) 1395 return false; 1396 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1397 return RT_BOOL(pVmcb->ctrl.u16InterceptRdDRx & (UINT16_C(1) << uDr)); 1398 return HMIsGuestSvmReadDRxInterceptSet(pVCpu, pCtx, uDr); 1383 1399 } 1384 1400 1385 1401 /** 1386 * Checks if the guest VMCB has the specified DR write intercept 1387 * active. 1402 * Checks if the guest VMCB has the specified DR write intercept active. 1388 1403 * 1389 1404 * @returns @c true if in intercept is set, @c false otherwise. 1405 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1390 1406 * @param pCtx Pointer to the context. 1391 1407 * @param uDr The DR register number (0 to 15). 1392 1408 */ 1393 DECLINLINE(bool) CPUMIsGuestSvmWriteDRxInterceptSet(P CCPUMCTX pCtx, uint8_t uDr)1394 { 1395 Assert( !pCtx->hwvirt.svm.fHMCachedVmcb);1409 DECLINLINE(bool) CPUMIsGuestSvmWriteDRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uDr) 1410 { 1411 Assert(uDr < 16); 1396 1412 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1397 return pVmcb && (pVmcb->ctrl.u16InterceptWrDRx & (1 << uDr)); 1413 if (!pVmcb) 1414 return false; 1415 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1416 return RT_BOOL(pVmcb->ctrl.u16InterceptWrDRx & (UINT16_C(1) << uDr)); 1417 return HMIsGuestSvmWriteDRxInterceptSet(pVCpu, pCtx, uDr); 1398 1418 } 1399 1419 1400 1420 /** 1401 * Checks if the guest VMCB has the specified exception 1402 * intercept active.1403 * 1404 * @ returns true if in intercept is active, false otherwise.1421 * Checks if the guest VMCB has the specified exception intercept active. 1422 * 1423 * @returns @c true if in intercept is active, @c false otherwise. 1424 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1405 1425 * @param pCtx Pointer to the context. 1406 1426 * @param uVector The exception / interrupt vector. 1407 1427 */ 1408 DECLINLINE(bool) CPUMIsGuestSvmXcptInterceptSet(PCCPUMCTX pCtx, uint8_t uVector) 1409 { 1410 Assert(!pCtx->hwvirt.svm.fHMCachedVmcb); 1428 DECLINLINE(bool) CPUMIsGuestSvmXcptInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uVector) 1429 { 1411 1430 Assert(uVector < 32); 1412 1431 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1413 return pVmcb && (pVmcb->ctrl.u32InterceptXcpt & (UINT32_C(1) << uVector)); 1432 if (!pVmcb) 1433 return false; 1434 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1435 return RT_BOOL(pVmcb->ctrl.u32InterceptXcpt & (UINT32_C(1) << uVector)); 1436 return HMIsGuestSvmXcptInterceptSet(pVCpu, pCtx, uVector); 1414 1437 } 1415 1438 #endif /* !IN_RC */ … … 1418 1441 * Checks if we are executing inside an SVM nested hardware-virtualized guest. 1419 1442 * 1420 * @returns true if in SVM nested-guest mode,false otherwise.1443 * @returns @c true if in SVM nested-guest mode, @c false otherwise. 1421 1444 * @param pCtx Pointer to the context. 1422 1445 */ … … 1431 1454 return pVmcb && (pVmcb->ctrl.u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMRUN); 1432 1455 #else 1433 RT_NOREF(pCtx);1456 NOREF(pCtx); 1434 1457 return false; 1435 1458 #endif … … 1439 1462 * Checks if we are executing inside a VMX nested hardware-virtualized guest. 1440 1463 * 1441 * @returns true if in VMX nested-guest mode,false otherwise.1464 * @returns @c true if in VMX nested-guest mode, @c false otherwise. 1442 1465 * @param pCtx Pointer to the context. 1443 1466 */ … … 1445 1468 { 1446 1469 /** @todo Intel. */ 1447 RT_NOREF(pCtx);1470 NOREF(pCtx); 1448 1471 return false; 1449 1472 } … … 1452 1475 * Checks if we are executing inside a nested hardware-virtualized guest. 1453 1476 * 1454 * @returns true if in SVM/VMX nested-guest mode,false otherwise.1477 * @returns @c true if in SVM/VMX nested-guest mode, @c false otherwise. 1455 1478 * @param pCtx Pointer to the context. 1456 1479 */ -
trunk/include/VBox/vmm/hm_svm.h
r69996 r70000 1085 1085 } while (0) 1086 1086 1087 VMM_INT_DECL(bool) HMIsGuestSvmCtrlInterceptSet(PVMCPU pVCpu, PCPUMCTX pCtx, uint64_t fIntercept); 1088 VMM_INT_DECL(bool) HMIsGuestSvmReadCRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uCr); 1089 VMM_INT_DECL(bool) HMIsGuestSvmWriteCRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uCr); 1090 VMM_INT_DECL(bool) HMIsGuestSvmReadDRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uDr); 1091 VMM_INT_DECL(bool) HMIsGuestSvmWriteDRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uDr); 1092 VMM_INT_DECL(bool) HMIsGuestSvmXcptInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uVector); 1093 VMM_INT_DECL(bool) HMCanSvmNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx); 1087 1094 1088 1095 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.