Changeset 72643 in vbox for trunk/include
- Timestamp:
- Jun 21, 2018 4:02:03 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123151
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r72522 r72643 1376 1376 * @param pCtx Current CPU context. 1377 1377 */ 1378 DECLINLINE(bool) CPUMIsGuestInLongModeEx(PC PUMCTX pCtx)1378 DECLINLINE(bool) CPUMIsGuestInLongModeEx(PCCPUMCTX pCtx) 1379 1379 { 1380 1380 return (pCtx->msrEFER & MSR_K6_EFER_LMA) == MSR_K6_EFER_LMA; … … 1452 1452 if (!pVmcb) 1453 1453 return false; 1454 if ( !pCtx->hwvirt.svm.fHMCachedVmcb)1455 return RT_BOOL(pVmcb->ctrl.u64InterceptCtrl &fIntercept);1456 return HMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx,fIntercept);1454 if (HMHasGuestSvmVmcbCached(pVCpu)) 1455 return HMIsGuestSvmCtrlInterceptSet(pVCpu, fIntercept); 1456 return RT_BOOL(pVmcb->ctrl.u64InterceptCtrl & fIntercept); 1457 1457 } 1458 1458 … … 1471 1471 if (!pVmcb) 1472 1472 return false; 1473 if ( !pCtx->hwvirt.svm.fHMCachedVmcb)1474 return RT_BOOL(pVmcb->ctrl.u16InterceptRdCRx & (UINT16_C(1) << uCr));1475 return HMIsGuestSvmReadCRxInterceptSet(pVCpu, pCtx, uCr);1473 if (HMHasGuestSvmVmcbCached(pVCpu)) 1474 return HMIsGuestSvmReadCRxInterceptSet(pVCpu, uCr); 1475 return RT_BOOL(pVmcb->ctrl.u16InterceptRdCRx & (UINT16_C(1) << uCr)); 1476 1476 } 1477 1477 … … 1490 1490 if (!pVmcb) 1491 1491 return false; 1492 if ( !pCtx->hwvirt.svm.fHMCachedVmcb)1493 return RT_BOOL(pVmcb->ctrl.u16InterceptWrCRx & (UINT16_C(1) << uCr));1494 return HMIsGuestSvmWriteCRxInterceptSet(pVCpu, pCtx, uCr);1492 if (HMHasGuestSvmVmcbCached(pVCpu)) 1493 return HMIsGuestSvmWriteCRxInterceptSet(pVCpu, uCr); 1494 return RT_BOOL(pVmcb->ctrl.u16InterceptWrCRx & (UINT16_C(1) << uCr)); 1495 1495 } 1496 1496 … … 1509 1509 if (!pVmcb) 1510 1510 return false; 1511 if ( !pCtx->hwvirt.svm.fHMCachedVmcb)1512 return RT_BOOL(pVmcb->ctrl.u16InterceptRdDRx & (UINT16_C(1) << uDr));1513 return HMIsGuestSvmReadDRxInterceptSet(pVCpu, pCtx, uDr);1511 if (HMHasGuestSvmVmcbCached(pVCpu)) 1512 return HMIsGuestSvmReadDRxInterceptSet(pVCpu, uDr); 1513 return RT_BOOL(pVmcb->ctrl.u16InterceptRdDRx & (UINT16_C(1) << uDr)); 1514 1514 } 1515 1515 … … 1528 1528 if (!pVmcb) 1529 1529 return false; 1530 if ( !pCtx->hwvirt.svm.fHMCachedVmcb)1531 return RT_BOOL(pVmcb->ctrl.u16InterceptWrDRx & (UINT16_C(1) << uDr));1532 return HMIsGuestSvmWriteDRxInterceptSet(pVCpu, pCtx, uDr);1530 if (HMHasGuestSvmVmcbCached(pVCpu)) 1531 return HMIsGuestSvmWriteDRxInterceptSet(pVCpu, uDr); 1532 return RT_BOOL(pVmcb->ctrl.u16InterceptWrDRx & (UINT16_C(1) << uDr)); 1533 1533 } 1534 1534 … … 1547 1547 if (!pVmcb) 1548 1548 return false; 1549 if ( !pCtx->hwvirt.svm.fHMCachedVmcb)1550 return RT_BOOL(pVmcb->ctrl.u32InterceptXcpt & (UINT32_C(1) << uVector));1551 return HMIsGuestSvmXcptInterceptSet(pVCpu, pCtx, uVector);1549 if (HMHasGuestSvmVmcbCached(pVCpu)) 1550 return HMIsGuestSvmXcptInterceptSet(pVCpu, uVector); 1551 return RT_BOOL(pVmcb->ctrl.u32InterceptXcpt & (UINT32_C(1) << uVector)); 1552 1552 } 1553 1553 … … 1564 1564 { 1565 1565 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1566 Assert(pVmcb); 1567 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1568 return pVmcb->ctrl.IntCtrl.n.u1VIntrMasking; 1569 return HMIsGuestSvmVirtIntrMasking(pVCpu, pCtx); 1566 if (!pVmcb) 1567 return false; 1568 if (HMHasGuestSvmVmcbCached(pVCpu)) 1569 return HMIsGuestSvmVirtIntrMasking(pVCpu); 1570 return pVmcb->ctrl.IntCtrl.n.u1VIntrMasking; 1570 1571 } 1571 1572 … … 1582 1583 { 1583 1584 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1584 Assert(pVmcb); 1585 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1586 return pVmcb->ctrl.NestedPagingCtrl.n.u1NestedPaging; 1587 return HMIsGuestSvmNestedPagingEnabled(pVCpu, pCtx); 1585 if (!pVmcb) 1586 return false; 1587 if (HMHasGuestSvmVmcbCached(pVCpu)) 1588 return HMIsGuestSvmNestedPagingEnabled(pVCpu); 1589 return pVmcb->ctrl.NestedPagingCtrl.n.u1NestedPaging; 1588 1590 } 1589 1591 … … 1600 1602 { 1601 1603 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 1602 Assert(pVmcb); 1603 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 1604 return pVmcb->ctrl.u16PauseFilterCount; 1605 return HMGetGuestSvmPauseFilterCount(pVCpu, pCtx); 1604 if (!pVmcb) 1605 return false; 1606 if (HMHasGuestSvmVmcbCached(pVCpu)) 1607 return HMGetGuestSvmPauseFilterCount(pVCpu); 1608 return pVmcb->ctrl.u16PauseFilterCount; 1606 1609 } 1607 1610 -
trunk/include/VBox/vmm/cpum.mac
r71833 r72643 270 270 .hwvirt.svm.cPauseFilterThreshold resw 1 271 271 .hwvirt.svm.fInterceptEvents resb 1 272 .hwvirt.svm.fHMCachedVmcb resb 1273 272 alignb 8 274 273 .hwvirt.svm.pvMsrBitmapR0 RTR0PTR_RES 1 -
trunk/include/VBox/vmm/cpumctx.h
r72510 r72643 511 511 /** 0x3c4 - Whether the injected event is subject to event intercepts. */ 512 512 bool fInterceptEvents; 513 /** 0x3c5 - Whether parts of the VMCB are cached (and potentially modified) by HM. */ 514 bool fHMCachedVmcb; 515 /** 0x3c6 - Padding. */ 516 bool afPadding[2]; 513 /** 0x3c5 - Padding. */ 514 bool afPadding[3]; 517 515 /** 0x3c8 - MSR permission bitmap - R0 ptr. */ 518 516 R0PTRTYPE(void *) pvMsrBitmapR0; … … 764 762 765 763 /** @name CPUMCTX_EXTRN_XXX 766 * Used toparts of the CPUM state that is externalized and needs fetching764 * Used for parts of the CPUM state that is externalized and needs fetching 767 765 * before use. 768 766 * … … 893 891 | CPUMCTX_EXTRN_SYSENTER_MSRS | CPUMCTX_EXTRN_TSC_AUX | CPUMCTX_EXTRN_OTHER_MSRS) 894 892 893 /** Hardware-virtualization (SVM or VMX) state is kept externally. */ 894 #define CPUMCTX_EXTRN_HWVIRT UINT64_C(0x0000020000000000) 895 895 896 /** Mask of bits the keepers can use for state tracking. */ 896 897 #define CPUMCTX_EXTRN_KEEPER_STATE_MASK UINT64_C(0xffff000000000000) … … 905 906 #define CPUMCTX_EXTRN_NEM_WIN_MASK UINT64_C(0x0007000000000000) 906 907 908 /** HM/SVM: Inhibit maskable interrupts (VMCPU_FF_INHIBIT_INTERRUPTS). */ 909 #define CPUMCTX_EXTRN_HM_SVM_INT_SHADOW UINT64_C(0x0001000000000000) 910 /** HM/SVM: Nested-guest interrupt pending (VMCPU_FF_INTERRUPT_NESTED_GUEST). */ 911 #define CPUMCTX_EXTRN_HM_SVM_HWVIRT_VIRQ UINT64_C(0x0002000000000000) 912 /** HM/SVM: Mask. */ 913 #define CPUMCTX_EXTRN_HM_SVM_MASK UINT64_C(0x0003000000000000) 914 915 /** HM/VMX: Guest-interruptibility state (VMCPU_FF_INHIBIT_INTERRUPTS, 916 * VMCPU_FF_BLOCK_NMIS). */ 917 #define CPUMCTX_EXTRN_HM_VMX_INT_STATE UINT64_C(0x0001000000000000) 918 /** HM/VMX: Mask. */ 919 #define CPUMCTX_EXTRN_HM_VMX_MASK UINT64_C(0x0001000000000000) 920 907 921 /** All CPUM state bits, not including keeper specific ones. */ 908 #define CPUMCTX_EXTRN_ALL UINT64_C(0x00000 1fffffffffc)922 #define CPUMCTX_EXTRN_ALL UINT64_C(0x000003fffffffffc) 909 923 /** @} */ 910 924 -
trunk/include/VBox/vmm/hm.h
r72599 r72643 216 216 VMMR0_INT_DECL(void) HMR0NotifyCpumModifiedHostCr0(PVMCPU VCpu); 217 217 VMMR0_INT_DECL(bool) HMR0SuspendPending(void); 218 VMMR0_INT_DECL(int) HMR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt); 219 VMMR0_INT_DECL(int) HMR0ImportStateOnDemand(PVMCPU pVCpu, PCPUMCTX pCtx, uint64_t fWhat); 218 220 219 221 # if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) -
trunk/include/VBox/vmm/hm_svm.h
r72065 r72643 1067 1067 /** Cache of the LBR virtualization bit. */ 1068 1068 bool fLbrVirt; 1069 /** Whether the VMCB is cached by HM. */ 1070 bool fCacheValid; 1069 1071 /** Alignment. */ 1070 bool afPadding0[ 5];1072 bool afPadding0[4]; 1071 1073 } SVMNESTEDVMCBCACHE; 1072 1074 #pragma pack() … … 1076 1078 typedef const SVMNESTEDVMCBCACHE *PCSVMNESTEDVMCBCACHE; 1077 1079 AssertCompileSizeAlignment(SVMNESTEDVMCBCACHE, 8); 1078 1079 #ifdef IN_RING01080 VMMR0DECL(int) SVMR0InvalidatePage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCVirt);1081 #endif /* IN_RING0 */1082 1080 1083 1081 /** … … 1140 1138 * Don't add any more functions here unless there is no other option. 1141 1139 */ 1142 VMM_INT_DECL(bool) HMIsGuestSvmCtrlInterceptSet(PVMCPU pVCpu, PCPUMCTX pCtx, uint64_t fIntercept); 1143 VMM_INT_DECL(bool) HMIsGuestSvmReadCRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uCr); 1144 VMM_INT_DECL(bool) HMIsGuestSvmWriteCRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uCr); 1145 VMM_INT_DECL(bool) HMIsGuestSvmReadDRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uDr); 1146 VMM_INT_DECL(bool) HMIsGuestSvmWriteDRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uDr); 1147 VMM_INT_DECL(bool) HMIsGuestSvmXcptInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uVector); 1148 VMM_INT_DECL(bool) HMIsGuestSvmVirtIntrMasking(PVMCPU pVCpu, PCCPUMCTX pCtx); 1149 VMM_INT_DECL(bool) HMIsGuestSvmNestedPagingEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx); 1150 VMM_INT_DECL(uint16_t) HMGetGuestSvmPauseFilterCount(PVMCPU pVCpu, PCCPUMCTX pCtx); 1140 VMM_INT_DECL(bool) HMHasGuestSvmVmcbCached(PVMCPU pVCpu); 1141 VMM_INT_DECL(bool) HMIsGuestSvmCtrlInterceptSet(PVMCPU pVCpu, uint64_t fIntercept); 1142 VMM_INT_DECL(bool) HMIsGuestSvmReadCRxInterceptSet(PVMCPU pVCpu, uint8_t uCr); 1143 VMM_INT_DECL(bool) HMIsGuestSvmWriteCRxInterceptSet(PVMCPU pVCpu, uint8_t uCr); 1144 VMM_INT_DECL(bool) HMIsGuestSvmReadDRxInterceptSet(PVMCPU pVCpu, uint8_t uDr); 1145 VMM_INT_DECL(bool) HMIsGuestSvmWriteDRxInterceptSet(PVMCPU pVCpu, uint8_t uDr); 1146 VMM_INT_DECL(bool) HMIsGuestSvmXcptInterceptSet(PVMCPU pVCpu, uint8_t uVector); 1147 VMM_INT_DECL(bool) HMIsGuestSvmVirtIntrMasking(PVMCPU pVCpu); 1148 VMM_INT_DECL(bool) HMIsGuestSvmNestedPagingEnabled(PVMCPU pVCpu); 1149 VMM_INT_DECL(uint16_t) HMGetGuestSvmPauseFilterCount(PVMCPU pVCpu); 1150 1151 1151 /** @} */ 1152 1152 -
trunk/include/VBox/vmm/hm_vmx.h
r69107 r72643 2535 2535 } 2536 2536 2537 #ifdef IN_RING02538 VMMR0DECL(int) VMXR0InvalidatePage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCVirt);2539 VMMR0DECL(int) VMXR0InvalidatePhysPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys);2540 #endif /* IN_RING0 */2541 2542 2537 /** @} */ 2543 2538 -
trunk/include/VBox/vmm/iem.h
r72592 r72643 218 218 | CPUMCTX_EXTRN_DR7 /* for memory breakpoints */ ) 219 219 220 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 221 /** The CPUMCTX_EXTRN_XXX mask needed when calling IEMExecSvmVmexit(). 222 * IEM will ASSUME the caller has ensured these are already present. */ 223 # define IEM_CPUMCTX_EXTRN_SVM_VMEXIT_MASK ( CPUMCTX_EXTRN_RSP \ 224 | CPUMCTX_EXTRN_RAX \ 225 | CPUMCTX_EXTRN_RIP \ 226 | CPUMCTX_EXTRN_RFLAGS \ 227 | CPUMCTX_EXTRN_CS \ 228 | CPUMCTX_EXTRN_SS \ 229 | CPUMCTX_EXTRN_DS \ 230 | CPUMCTX_EXTRN_ES \ 231 | CPUMCTX_EXTRN_GDTR \ 232 | CPUMCTX_EXTRN_IDTR \ 233 | CPUMCTX_EXTRN_CR_MASK \ 234 | CPUMCTX_EXTRN_EFER \ 235 | CPUMCTX_EXTRN_DR6 \ 236 | CPUMCTX_EXTRN_DR7 \ 237 | CPUMCTX_EXTRN_OTHER_MSRS \ 238 | CPUMCTX_EXTRN_HWVIRT) 239 #endif 220 240 221 241 VMMDECL(VBOXSTRICTRC) IEMExecOne(PVMCPU pVCpu);
Note:
See TracChangeset
for help on using the changeset viewer.