VirtualBox

Changeset 82898 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Jan 29, 2020 12:56:30 AM (5 years ago)
Author:
vboxsync
Message:

IPRT/memobj-r0drv-darwin.cpp: Don't set the kIOMemoryPhysicallyContiguous flag when MaxPhysAddr != UINT64MAX, the mask works, though only if alignment is <= 1 (checked sources, must've misread them the other day/night). This should fix the trouble we're having on the testboxes at present. Also added the kIOMemoryHostPhysicallyContiguous flag just in case the xnu code changes. bugref:9627

Location:
trunk/src/VBox/Runtime/r0drv/darwin
Files:
2 edited

Legend:

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

    r82886 r82898  
    486486    IOOptionBits fOptions = kIOMemoryKernelUserShared | kIODirectionInOut;
    487487    if (fContiguous)
     488    {
    488489        fOptions |= kIOMemoryPhysicallyContiguous;
     490        if (   version_major > 12
     491            || (version_major == 12 && version_minor >= 2) /* 10.8.2 = Mountain Kitten */ )
     492            fOptions |= kIOMemoryHostPhysicallyContiguous; /* (Just to make ourselves clear, in case the xnu code changes.)  */
     493    }
    489494    if (version_major >= 12 /* 12 = 10.8.x = Mountain Kitten */)
    490495        fOptions |= kIOMemoryMapperNone;
     
    498503    if (version_major >= 11 /* 11 = 10.7.x = Lion, could probably allow 10.5.0+ here if we really wanted to. */)
    499504    {
    500         if (fContiguous || MaxPhysAddr < UINT64_MAX)
    501         {
    502             fOptions |= kIOMemoryPhysicallyContiguous;
    503             // cannot find any evidence of this: uAlignmentActual = 1; /* PhysMask isn't respected if higher. */
     505        /* Starting with 10.6.x the physical mask is ignored if alignment is higher
     506           than 1.  The assumption seems to be that inTaskWithPhysicalMask() should
     507           be used and the alignment inferred from the PhysMask argument. */
     508        if (MaxPhysAddr != UINT64_MAX)
     509        {
     510            Assert(RT_ALIGN_64(PhysMask, uAlignment) == PhysMask);
     511            uAlignmentActual = 1;
    504512        }
    505513
  • trunk/src/VBox/Runtime/r0drv/darwin/the-darwin-kernel.h

    r76585 r82898  
    108108/* This flag was added in 10.6, it seems.  Should be harmless in earlier
    109109   releases... */
    110 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
     110#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1060
    111111# define kIOMemoryMapperNone UINT32_C(0x800)
     112#endif
     113
     114/* This flag was added in 10.8.2, it seems. */
     115#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1082
     116# define kIOMemoryHostPhysicallyContiguous UINT32_C(0x00000080)
    112117#endif
    113118
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