VirtualBox

Changeset 66927 in vbox


Ignore:
Timestamp:
May 17, 2017 9:42:23 AM (8 years ago)
Author:
vboxsync
Message:

Runtime/r0drv: Linux 4.12 5-level page table adaptions

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

Legend:

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

    r65183 r66927  
    903903    {
    904904        pgd_t       Global;
     905#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
     906        p4d_t       Four;
     907#endif
    905908#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
    906909        pud_t       Upper;
     
    918921    if (RT_UNLIKELY(pgd_none(u.Global)))
    919922        return NULL;
    920 
    921 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
     923#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
     924    u.Four  = *p4d_offset(&u.Global, ulAddr);
     925    if (RT_UNLIKELY(p4d_none(u.Four)))
     926        return NULL;
     927    if (p4d_large(u.Four))
     928    {
     929        pPage = p4d_page(u.Four);
     930        AssertReturn(pPage, NULL);
     931        pfn   = page_to_pfn(pPage);      /* doing the safe way... */
     932        AssertCompile(P4D_SHIFT - PAGE_SHIFT < 31);
     933        pfn  += (ulAddr >> PAGE_SHIFT) & ((UINT32_C(1) << (P4D_SHIFT - PAGE_SHIFT)) - 1);
     934        return pfn_to_page(pfn);
     935    }
     936    u.Upper = *pud_offset(&u.Four, ulAddr);
     937#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
    922938    u.Upper = *pud_offset(&u.Global, ulAddr);
     939#endif
    923940    if (RT_UNLIKELY(pud_none(u.Upper)))
    924941        return NULL;
    925 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
     942#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
    926943    if (pud_large(u.Upper))
    927944    {
     
    932949        return pfn_to_page(pfn);
    933950    }
    934 # endif
    935 
     951#endif
     952#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
    936953    u.Middle = *pmd_offset(&u.Upper, ulAddr);
    937954#else  /* < 2.6.11 */
  • trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h

    r65990 r66927  
    160160#endif
    161161
     162/* for set_pages_x() */
     163#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
     164# include <asm/set_memory.h>
     165#endif
     166
    162167#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
    163168# include <asm/smap.h>
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