VirtualBox

Ignore:
Timestamp:
Jul 29, 2020 10:44:46 AM (4 years ago)
Author:
vboxsync
Message:

IPRT/memobj-r0drv-linux.c: Make it easier to push the WX semantics further back (after some testing). bugref:9801

File:
1 edited

Legend:

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

    r85504 r85514  
    5151#ifndef PAGE_READONLY_EXEC
    5252# define PAGE_READONLY_EXEC PAGE_READONLY
     53#endif
     54
     55/** @def IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
     56 * Whether we use alloc_vm_area (3.2+) for executable memory.
     57 * This is a must for 5.8+, but we'll enable it for earlier kernels later. */
     58#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || defined(DOXYGEN_RUNNING)
     59# define IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
    5360#endif
    5461
     
    106113    /** Set if we've vmap'ed the memory into ring-0. */
    107114    bool                fMappedToRing0;
    108 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
     115#ifdef IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
    109116    /** Return from alloc_vm_area() that we now need to use for executable
    110117     *  memory. */
     
    545552# endif
    546553
    547 # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
     554# ifdef IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
    548555        if (fExecutable)
    549556        {
     
    613620{
    614621#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
    615 # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
     622# ifdef IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
    616623    if (pMemLnx->pArea)
    617624    {
     
    18291836DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t offSub, size_t cbSub, uint32_t fProt)
    18301837{
    1831 # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
     1838# ifdef IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
    18321839    /*
    18331840     * Currently only supported when we've got addresses PTEs from the kernel.
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