VirtualBox

Ignore:
Timestamp:
Jan 27, 2020 10:26:05 PM (5 years ago)
Author:
vboxsync
Message:

IPRt/memobj-r0drv-darwin.cpp: Turns out kIOMapPrefault wasn't allowed on kernel mappings till 10.13.x. bugref:9627

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp

    r82877 r82886  
    958958    {
    959959        /* The kIOMapPrefault option was added in 10.10.0; causes PTEs to be populated with
    960            INTEL_PTE_WIRED to be set, just like we desire (see further down). */
    961 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
    962         IOMemoryMap *pMemMap = pMemToMapDarwin->pMemDesc->createMappingInTask(kernel_task,
    963                                                                               0,
    964                                                                               kIOMapAnywhere | kIOMapDefaultCache | kIOMapPrefault,
    965                                                                               offSub,
    966                                                                               cbSub);
    967 #elif MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
     960           INTEL_PTE_WIRED to be set, just like we desire (see further down).  However, till
     961           10.13.0 it was not available for use on kernel mappings. Oh, fudge. */
     962#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
    968963        static uint32_t volatile s_fOptions = UINT32_MAX;
    969964        uint32_t fOptions = s_fOptions;
    970965        if (RT_UNLIKELY(fOptions == UINT32_MAX))
    971             s_fOptions = fOptions = version_major >= 14 ? 0x10000000 /*kIOMapPrefault*/ : 0; /* Since 10.10.0. */
     966            s_fOptions = fOptions = version_major >= 17 ? 0x10000000 /*kIOMapPrefault*/ : 0; /* Since 10.13.0 (High Sierra). */
     967
    972968        IOMemoryMap *pMemMap = pMemToMapDarwin->pMemDesc->createMappingInTask(kernel_task,
    973969                                                                              0,
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