VirtualBox

Ignore:
Timestamp:
Jul 4, 2023 6:37:35 AM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158085
Message:

Runtime/RTR0MemObj*: Add PhysHighest parameter to RTR0MemObjAllocCont to indicate the maximum allowed physical address for an allocation, bugref:10457

File:
1 edited

Legend:

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

    r98103 r100355  
    218218
    219219
    220 DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, const char *pszTag)
     220DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest,
     221                                          bool fExecutable, const char *pszTag)
    221222{
    222223    NOREF(fExecutable);
     224    AssertMsgReturn(PhysHighest >= _16M - 1, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED);
    223225
    224226    /* create the object. */
     
    229231        /* do the allocation. */
    230232        ULONG ulPhys = ~0UL;
    231         int rc = KernVMAlloc(cb, VMDHA_FIXED | VMDHA_CONTIG, &pMemOs2->Core.pv, (PPVOID)&ulPhys, NULL);
     233        int rc = KernVMAlloc(cb, VMDHA_FIXED | VMDHA_CONTIG | (PhysHighest < _4G - 1 ? VMDHA_16M : 0),
     234                             &pMemOs2->Core.pv, (PPVOID)&ulPhys, NULL);
    232235        if (!rc)
    233236        {
     
    248251                                          const char *pszTag)
    249252{
    250     AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED);
     253    AssertMsgReturn(PhysHighest >= _16M - 1, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED);
    251254
    252255    /** @todo alignment  */
     
    261264        /* do the allocation. */
    262265        ULONG ulPhys = ~0UL;
    263         int rc = KernVMAlloc(cb, VMDHA_FIXED | VMDHA_CONTIG | (PhysHighest < _4G ? VMDHA_16M : 0),
     266        int rc = KernVMAlloc(cb, VMDHA_FIXED | VMDHA_CONTIG | (PhysHighest < _4G - 1 ? VMDHA_16M : 0),
    264267                             &pMemOs2->Core.pv, (PPVOID)&ulPhys, NULL);
    265268        if (!rc)
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