Advertisement
Guest User

Untitled

a guest
May 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. --- work/vboxdrv/r0drv/linux/memobj-r0drv-linux.c 2017-01-12 10:04:01.000000000 -0500
  2. +++ work/vboxdrv/r0drv/linux/memobj-r0drv-linux.cb 2017-05-28 18:04:25.607775983 -0400
  3. @@ -1,4 +1,4 @@
  4. -/* $Id: memobj-r0drv-linux.c 112804 2017-01-12 15:03:51Z fmehnert $ */
  5. +/* $Id: memobj-r0drv-linux.c 66930 2017-05-17 10:45:48Z vboxsync $ */
  6. /** @file
  7. * IPRT - Ring-0 Memory Objects, Linux.
  8. */
  9. @@ -902,6 +902,9 @@
  10. union
  11. {
  12. pgd_t Global;
  13. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
  14. + p4d_t Four;
  15. +#endif
  16. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
  17. pud_t Upper;
  18. #endif
  19. @@ -917,9 +920,24 @@
  20. u.Global = *pgd_offset(current->active_mm, ulAddr);
  21. if (RT_UNLIKELY(pgd_none(u.Global)))
  22. return NULL;
  23. -
  24. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
  25. +# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
  26. + u.Four = *p4d_offset(&u.Global, ulAddr);
  27. + if (RT_UNLIKELY(p4d_none(u.Four)))
  28. + return NULL;
  29. + if (p4d_large(u.Four))
  30. + {
  31. + pPage = p4d_page(u.Four);
  32. + AssertReturn(pPage, NULL);
  33. + pfn = page_to_pfn(pPage); /* doing the safe way... */
  34. + AssertCompile(P4D_SHIFT - PAGE_SHIFT < 31);
  35. + pfn += (ulAddr >> PAGE_SHIFT) & ((UINT32_C(1) << (P4D_SHIFT - PAGE_SHIFT)) - 1);
  36. + return pfn_to_page(pfn);
  37. + }
  38. + u.Upper = *pud_offset(&u.Four, ulAddr);
  39. +# else /* < 4.12 */
  40. u.Upper = *pud_offset(&u.Global, ulAddr);
  41. +# endif /* < 4.12 */
  42. if (RT_UNLIKELY(pud_none(u.Upper)))
  43. return NULL;
  44. # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
  45. @@ -932,7 +950,6 @@
  46. return pfn_to_page(pfn);
  47. }
  48. # endif
  49. -
  50. u.Middle = *pmd_offset(&u.Upper, ulAddr);
  51. #else /* < 2.6.11 */
  52. u.Middle = *pmd_offset(&u.Global, ulAddr);
  53.  
  54. --- work/vboxdrv/r0drv/linux/the-linux-kernel.h 2017-05-28 18:02:10.644768590 -0400
  55. +++ work/vboxdrv/r0drv/linux/the-linux-kernel.hb 2017-05-28 18:04:41.367776846 -0400
  56. @@ -1,4 +1,4 @@
  57. -/* $Id: the-linux-kernel.h 113828 2017-03-08 10:10:39Z fmehnert $ */
  58. +/* $Id: the-linux-kernel.h 66927 2017-05-17 09:42:23Z vboxsync $ */
  59. /** @file
  60. * IPRT - Include all necessary headers for the Linux kernel.
  61. */
  62. @@ -49,7 +49,7 @@
  63. # include <generated/autoconf.h>
  64. #else
  65. # ifndef AUTOCONF_INCLUDED
  66. -# include <generated/autoconf.h>
  67. +# include <linux/autoconf.h>
  68. # endif
  69. #endif
  70.  
  71. @@ -159,6 +159,11 @@
  72. # include <asm/tlbflush.h>
  73. #endif
  74.  
  75. +/* for set_pages_x() */
  76. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
  77. +# include <asm/set_memory.h>
  78. +#endif
  79. +
  80. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
  81. # include <asm/smap.h>
  82. #else
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement