VirtualBox

Ignore:
Timestamp:
Nov 21, 2017 2:48:12 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119212
Message:

testboxscript/TestBoxHelper.cpp: Use kern.hv_support to detect nested paging on darwin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp

    r69111 r69794  
    562562        }
    563563    }
     564# elif defined(RT_OS_DARWIN)
     565    else if (enmHwVirt == HWVIRTTYPE_VTX)
     566    {
     567        /*
     568         * The kern.hv_support parameter indicates support for the hypervisor API in the
     569         * kernel, which in turn is documented require nested paging and unrestricted
     570         * guest mode.  So, if it's there and set we've got nested paging.  Howeber, if
     571         * it's there and clear we have not definite answer as it might be due to lack
     572         * of unrestricted guest mode support.
     573         */
     574        int32_t fHvSupport = 0;
     575        size_t  cbOld = sizeof(fHvSupport);
     576        if (sysctlbyname("kern.hv_support", &fHvSupport, &cbOld, NULL, 0) == 0)
     577        {
     578            if (fHvSupport != 0)
     579                fSupported = true;
     580        }
     581    }
    564582# endif
    565583#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette