--- VirtualBox-7.0.18/src/VBox/HostDrivers/Support/SUPDrv.cpp.orig +++ VirtualBox-7.0.18/src/VBox/HostDrivers/Support/SUPDrv.cpp @@ -4249,7 +4249,7 @@ */ SUPR0DECL(int) SUPR0EnableVTx(bool fEnable) { -#ifdef RT_OS_DARWIN +#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) return supdrvOSEnableVTx(fEnable); #else RT_NOREF1(fEnable); @@ -4268,7 +4268,7 @@ */ SUPR0DECL(bool) SUPR0SuspendVTxOnCpu(void) { -#ifdef RT_OS_DARWIN +#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) return supdrvOSSuspendVTxOnCpu(); #else return false; @@ -4286,7 +4286,7 @@ */ SUPR0DECL(void) SUPR0ResumeVTxOnCpu(bool fSuspended) { -#ifdef RT_OS_DARWIN +#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) supdrvOSResumeVTxOnCpu(fSuspended); #else RT_NOREF1(fSuspended); --- VirtualBox-7.0.18/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c.orig +++ VirtualBox-7.0.18/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c @@ -57,6 +57,7 @@ #include #include #undef u /* /usr/include/sys/user.h:249:1 is where this is defined to (curproc->p_user). very cool. */ +#include #include "../SUPDrvInternal.h" #include @@ -986,6 +987,53 @@ return false; } +static const char *vbox_hma_ident = DEVICE_DESC; +static hma_reg_t *vbox_hma_reg; + +int VBOXCALL supdrvOSEnableVTx(bool fEnable) +{ + hma_reg_t *reg; + + + if (fEnable) { + cmn_err(CE_NOTE, "!Registering hypervisor\n"); + if (vbox_hma_reg) + return VINF_SUCCESS; + +#if OOCEVER >= 151029 + if ((reg = hma_register_exclusive(vbox_hma_ident)) == NULL) +#else + if ((reg = hma_register(vbox_hma_ident)) == NULL) +#endif + return VERR_NOT_SUPPORTED; + + cmn_err(CE_NOTE, "!Successfully registered '%s'\n", + vbox_hma_ident); + + vbox_hma_reg = reg; + return VINF_SUCCESS; + } + + if (vbox_hma_reg) { + cmn_err(CE_NOTE, "!Unregistering hypervisor\n"); + hma_unregister(vbox_hma_reg); + vbox_hma_reg = NULL; + } + + return VINF_SUCCESS; +} + +bool VBOXCALL supdrvOSSuspendVTxOnCpu(void) +{ + return false; +} + +void VBOXCALL supdrvOSResumeVTxOnCpu(bool fSuspended) +{ + RT_NOREF1(fSuspended); + Assert(!fSuspended); +} + #if defined(VBOX_WITH_NATIVE_SOLARIS_LOADING) \ && !defined(VBOX_WITHOUT_NATIVE_R0_LOADER)