VirtualBox

Ignore:
Timestamp:
Oct 31, 2023 12:39:45 PM (16 months ago)
Author:
vboxsync
Message:

Main/Host: Set the hwvirt++ flags on arm64 accordingly so the validationkit can select the proper VM configs for testing, bugref:10542

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r101176 r101684  
    7373#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    7474
    75 #if defined(RT_OS_DARWIN) && ARCH_BITS == 32
     75#if defined(RT_OS_DARWIN)
    7676# include <sys/types.h>
    7777# include <sys/sysctl.h>
     
    420420        }
    421421    }
     422#elif defined(RT_ARCH_ARM64)
     423    m->fLongModeSupported = true; /* Misnomer but means 64-bit guest support, we are running on 64-bit so it must be available. */
     424
     425# if defined(RT_OS_DARWIN)
     426    /*
     427     * The kern.hv_support parameter indicates support for the hypervisor API in the
     428     * kernel, which is the only way for virtualization on macOS on Apple Silicon.
     429     */
     430    int32_t fHvSupport = 0;
     431    size_t  cbOld = sizeof(fHvSupport);
     432    if (sysctlbyname("kern.hv_support", &fHvSupport, &cbOld, NULL, 0) == 0)
     433    {
     434        if (fHvSupport != 0)
     435        {
     436            m->fVTSupported                = true;
     437            m->fUnrestrictedGuestSupported = true;
     438            m->fNestedPagingSupported      = true;
     439        }
     440    }
     441# endif
    422442#endif /* defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) */
    423443
     
    12301250void Host::i_updateProcessorFeatures()
    12311251{
     1252#ifndef RT_ARCH_ARM64
    12321253    /* Perhaps the driver is available now... */
    12331254    int vrc = SUPR3InitEx(SUPR3INIT_F_LIMITED, NULL);
     
    12631284        m->fRecheckVTSupported = false; /* No need to try again, we cached everything. */
    12641285    }
     1286#endif
    12651287}
    12661288
Note: See TracChangeset for help on using the changeset viewer.

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