VirtualBox

Changeset 106261 in vbox


Ignore:
Timestamp:
Oct 9, 2024 6:55:55 PM (7 weeks ago)
Author:
vboxsync
Message:

iprt: Linux: Adjust rtR0MemObjLinuxVMap implementation for Arm64, bugref:10783.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c

    r106061 r106261  
    651651         * Use vmap - 2.4.22 and later.
    652652         */
    653 #if RTLNX_VER_MIN(2,4,22) && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86))
     653#if RTLNX_VER_MIN(2,4,22) && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(RT_ARCH_ARM64))
    654654        pgprot_t fPg;
     655# if defined(RT_ARCH_ARM64)
     656        /* ARM64 architecture has no _PAGE_NX, _PAGE_PRESENT and _PAGE_RW flags.
     657         * Closest alternatives would be PTE_PXN, PTE_UXN, PROT_DEFAULT and PTE_WRITE. */
     658        pgprot_val(fPg) = _PAGE_KERNEL; /* (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL). */
     659# else /* !RT_ARCH_ARM64 */
    655660        pgprot_val(fPg) = _PAGE_PRESENT | _PAGE_RW;
    656 # ifdef _PAGE_NX
     661#  ifdef _PAGE_NX
    657662        if (!fExecutable)
    658663            pgprot_val(fPg) |= _PAGE_NX;
    659 # endif
     664#  endif
     665# endif /* RT_ARCH_ARM64 */
    660666
    661667# ifdef IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
     
    675681                    Assert(pMemLnx->pArea->size >= pMemLnx->Core.cb);   /* Note! includes guard page. */
    676682                    Assert(pMemLnx->pArea->addr);
    677 #  ifdef _PAGE_NX
     683#  if !defined(RT_ARCH_ARM64) && defined(_PAGE_NX)
    678684                    pgprot_val(fPg) |= _PAGE_NX; /* Uses RTR0MemObjProtect to clear NX when memory ready, W^X fashion. */
    679685#  endif
     
    696702# endif
    697703        {
    698 #  if defined(IPRT_USE_APPLY_TO_PAGE_RANGE_FOR_EXEC)
     704#  if !defined(RT_ARCH_ARM64) && defined(IPRT_USE_APPLY_TO_PAGE_RANGE_FOR_EXEC)
    699705            if (fExecutable)
    700706                pgprot_val(fPg) |= _PAGE_NX; /* Uses RTR0MemObjProtect to clear NX when memory ready, W^X fashion. */
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