Changeset 97096 in vbox for trunk/include/VBox
- Timestamp:
- Oct 11, 2022 8:47:28 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r97070 r97096 1959 1959 DECLINLINE(bool) CPUMIsGuestInNestedHwvirtMode(PCCPUMCTX pCtx) 1960 1960 { 1961 #if 0 1961 1962 return CPUMIsGuestInVmxNonRootMode(pCtx) || CPUMIsGuestInSvmNestedHwVirtMode(pCtx); 1963 #else 1964 if (pCtx->hwvirt.enmHwvirt == CPUMHWVIRT_NONE) 1965 return false; 1966 if (pCtx->hwvirt.enmHwvirt == CPUMHWVIRT_VMX) 1967 { 1968 Assert(!pCtx->hwvirt.vmx.fInVmxNonRootMode || pCtx->hwvirt.vmx.fInVmxRootMode); 1969 return pCtx->hwvirt.vmx.fInVmxNonRootMode; 1970 } 1971 Assert(pCtx->hwvirt.enmHwvirt == CPUMHWVIRT_SVM); 1972 return RT_BOOL(pCtx->hwvirt.svm.Vmcb.ctrl.u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMRUN); 1973 #endif 1974 } 1975 1976 /** 1977 * Checks if we are executing inside an SVM or VMX nested hardware-virtualized 1978 * guest. 1979 * 1980 * @retval CPUMHWVIRT_NONE if not in SVM or VMX non-root mode. 1981 * @retval CPUMHWVIRT_VMX if in VMX non-root mode. 1982 * @retval CPUMHWVIRT_SVM if in SVM non-root mode. 1983 * @param pCtx Current CPU context. 1984 */ 1985 DECLINLINE(CPUMHWVIRT) CPUMGetGuestInNestedHwvirtMode(PCCPUMCTX pCtx) 1986 { 1987 if (pCtx->hwvirt.enmHwvirt == CPUMHWVIRT_NONE) 1988 return CPUMHWVIRT_NONE; 1989 if (pCtx->hwvirt.enmHwvirt == CPUMHWVIRT_VMX) 1990 { 1991 Assert(!pCtx->hwvirt.vmx.fInVmxNonRootMode || pCtx->hwvirt.vmx.fInVmxRootMode); 1992 return pCtx->hwvirt.vmx.fInVmxNonRootMode ? CPUMHWVIRT_VMX : CPUMHWVIRT_NONE; 1993 } 1994 Assert(pCtx->hwvirt.enmHwvirt == CPUMHWVIRT_SVM); 1995 return pCtx->hwvirt.svm.Vmcb.ctrl.u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMRUN ? CPUMHWVIRT_SVM : CPUMHWVIRT_NONE; 1962 1996 } 1963 1997
Note:
See TracChangeset
for help on using the changeset viewer.