VirtualBox

Ignore:
Timestamp:
Aug 1, 2017 11:03:31 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117315
Message:

Runtime/r0drv/linux: openSUSE Leap 42.3 tweak for a Linux 4.4 kernel with Linux 4.10 get_user_pages() interface

File:
1 edited

Legend:

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

    r66930 r68215  
    10261026}
    10271027
     1028/* openSUSE Leap 42.3 detection :-/ */
     1029#if    LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) \
     1030    && LINUX_VERSION_CODE <  KERNEL_VERSION(4, 10, 0) \
     1031    && defined(FAULT_FLAG_REMOTE)
     1032# define GET_USER_PAGES_API     KERNEL_VERSION(4, 10, 0)
     1033#else
     1034# define GET_USER_PAGES_API     LINUX_VERSION_CODE
     1035#endif
    10281036
    10291037DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process)
     
    10631071         * Get user pages.
    10641072         */
    1065 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
     1073#if GET_USER_PAGES_API >= KERNEL_VERSION(4, 6, 0)
    10661074        if (R0Process == RTR0ProcHandleSelf())
    10671075            rc = get_user_pages(R3Ptr,                  /* Where from. */
    10681076                                cPages,                 /* How many pages. */
    1069 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
     1077# if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0)
    10701078                                fWrite ? FOLL_WRITE |   /* Write to memory. */
    10711079                                         FOLL_FORCE     /* force write access. */
     
    10871095                                R3Ptr,                  /* Where from. */
    10881096                                cPages,                 /* How many pages. */
    1089 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
     1097# if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0)
    10901098                                fWrite ? FOLL_WRITE |   /* Write to memory. */
    10911099                                         FOLL_FORCE     /* force write access. */
     
    10971105                                &pMemLnx->apPages[0],   /* Page array. */
    10981106                                papVMAs                 /* vmas */
    1099 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
     1107# if GET_USER_PAGES_API >= KERNEL_VERSION(4, 10, 0)
    11001108                                , NULL                  /* locked */
    11011109# endif
    11021110                                );
    1103 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
     1111#else /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */
    11041112            rc = get_user_pages(pTask,                  /* Task for fault accounting. */
    11051113                                pTask->mm,              /* Whose pages. */
    11061114                                R3Ptr,                  /* Where from. */
    11071115                                cPages,                 /* How many pages. */
    1108 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
     1116# if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0)
    11091117                                fWrite ? FOLL_WRITE |   /* Write to memory. */
    11101118                                         FOLL_FORCE     /* force write access. */
     
    11161124                                &pMemLnx->apPages[0],   /* Page array. */
    11171125                                papVMAs);               /* vmas */
    1118 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
     1126#endif /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */
    11191127        if (rc == cPages)
    11201128        {
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