aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-11-28 15:18:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-11-28 15:55:41 +0000
commit20e6f4697c5cd3d108c4133728b59b33e61560cd (patch)
tree537a05a7d866910a5357fadc738b692c41b68cad /testing
parentc45d4948477c790cc6af052bc6db0957310c5148 (diff)
downloadaports-20e6f4697c5cd3d108c4133728b59b33e61560cd.tar.bz2
aports-20e6f4697c5cd3d108c4133728b59b33e61560cd.tar.xz
testing/virtualbox-guest-modules-lts: new aport
port virtualbox guest modules to 5.4 kernel
Diffstat (limited to 'testing')
-rw-r--r--testing/virtualbox-guest-modules-lts/APKBUILD96
-rw-r--r--testing/virtualbox-guest-modules-lts/linux-5.4-compat.patch289
2 files changed, 385 insertions, 0 deletions
diff --git a/testing/virtualbox-guest-modules-lts/APKBUILD b/testing/virtualbox-guest-modules-lts/APKBUILD
new file mode 100644
index 0000000000..1f6577e30b
--- /dev/null
+++ b/testing/virtualbox-guest-modules-lts/APKBUILD
@@ -0,0 +1,96 @@
+# Maintainer: Ben Allen <bensallen@me.com>
+# Contributor: Ben Allen <bensallen@me.com>
+
+# when changing _ver we *must* bump _rel
+_name=virtualbox-guest-modules
+_ver=6.0.14
+_rel=0
+
+_flavor=${FLAVOR:-lts}
+_kpkg=linux-$_flavor
+_kver=5.4.0
+_krel=3
+
+_kpkgver="$_kver-r$_krel"
+_kabi=$_kver-$_krel-$_flavor
+_kabi_virt=$_kver-$_krel-virt
+
+pkgname=$_name-$_flavor
+pkgver=$_kver
+pkgrel=$(($_krel + $_rel))
+
+pkgdesc="VirtualBox Additions guest kernel modules for $_flavor"
+arch='x86_64' # seems to fail on x86: https://github.com/alpinelinux/aports/pull/8215#issuecomment-496630776
+url='https://virtualbox.org/'
+license="GPL-2.0 custom"
+makedepends="linux-$_flavor-dev=$_kpkgver linux-virt-dev=$_kpkgver sed coreutils"
+subpackages="$_name-virt:virt"
+source="https://download.virtualbox.org/virtualbox/$_ver/VirtualBox-$_ver.tar.bz2
+ linux-5.4-compat.patch
+ "
+install_if="linux-$_flavor=$_kpkgver virtualbox-guest-additions"
+builddir="$srcdir"/VirtualBox-$_ver
+
+prepare() {
+ local i
+
+ cd "$builddir"
+ default_prepare
+ # verify the kernel version
+ local _kapkbuild=../../testing/linux-$_flavor-/APKBUILD
+ if [ -f $_kapkbuild ]; then
+ ( . $_kapkbuild
+ pkgname=$_name-$_flavor
+ [ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver"
+ [ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel"
+ return 0
+ )
+ fi
+
+ for i in $_kabi $_kabi_virt; do
+ KERN_VER=$_kabi "$builddir"/src/VBox/Additions/linux/export_modules.sh \
+ --folder "$srcdir/$i"
+ done
+}
+
+build() {
+ local i
+ for i in $_kabi $_kabi_virt; do
+ cd "$srcdir/$i"
+ # Build Kernel Modules
+ msg "Build for $i"
+ make KERN_DIR=/lib/modules/${i}/build all
+ done
+}
+
+check() {
+ local i
+ for i in $_kabi $_kabi_virt; do
+ cd "$srcdir/$i"
+ make KERN_DIR=/lib/modules/${i}/build check
+ done
+}
+
+package() {
+ local i module=
+ for i in $_kabi $_kabi_virt; do
+ cd "$srcdir/$i"
+ for module in *.ko; do
+ install -v -D -m644 ${module} \
+ "$pkgdir/lib/modules/$i/misc/${module}"
+ done
+ done
+}
+
+virt() {
+ pkgdesc="VirtualBox Additions kernel modules for virt"
+ install_if="linux-virt=$_kpkgver virtualbox-guest-additions"
+ mkdir -p "$subpkgdir"/lib/modules/
+ # vboxvideo.ko won't load with virt kernel as it doesn't have DRM
+ rm "$pkgdir"/lib/modules/$_kabi_virt/misc/vboxvideo.ko
+ mv "$pkgdir"/lib/modules/$_kabi_virt \
+ "$subpkgdir"/lib/modules/
+}
+
+sha512sums="e1a64c6633987e178b368dc17e738c6fbef4ab262c574188819f1186bf33f38d8c5accd6a566279a12ccd3544bab4ee5a1f8dce7c8c56d7373489c5ff7f8556d VirtualBox-6.0.14.tar.bz2
+74459c095113c9fc7c3861d0e56a636dde55d02d8f514267f762fb2be71d382806803aa33953af8f2c7d3a172a34d311caa9ba3d58e39af304b8d11fadfff9b0 linux-5.4-compat.patch"
diff --git a/testing/virtualbox-guest-modules-lts/linux-5.4-compat.patch b/testing/virtualbox-guest-modules-lts/linux-5.4-compat.patch
new file mode 100644
index 0000000000..a61e587715
--- /dev/null
+++ b/testing/virtualbox-guest-modules-lts/linux-5.4-compat.patch
@@ -0,0 +1,289 @@
+https://www.virtualbox.org/changeset/81586/vbox
+https://www.virtualbox.org/changeset/81587/vbox
+https://www.virtualbox.org/changeset/81649/vbox
+
+diff -u -r VirtualBox-6.0.14/include/iprt/cdefs.h VirtualBox-6.0.14-5.4/include/iprt/cdefs.h
+--- VirtualBox-6.0.14/include/iprt/cdefs.h 2019-10-10 18:25:42.000000000 +0000
++++ VirtualBox-6.0.14-5.4/include/iprt/cdefs.h 2019-11-26 10:08:56.314644140 +0000
+@@ -1166,7 +1166,7 @@
+ * Tell the compiler that we're falling through to the next case in a switch.
+ * @sa RT_FALL_THRU */
+ #if RT_GNUC_PREREQ(7, 0)
+-# define RT_FALL_THROUGH() __attribute__((fallthrough))
++# define RT_FALL_THROUGH() __attribute__((__fallthrough__))
+ #else
+ # define RT_FALL_THROUGH() (void)0
+ #endif
+diff -u -r VirtualBox-6.0.14/src/VBox/Additions/linux/drm/vbox_drv.c VirtualBox-6.0.14-5.4/src/VBox/Additions/linux/drm/vbox_drv.c
+--- VirtualBox-6.0.14/src/VBox/Additions/linux/drm/vbox_drv.c 2019-10-10 18:28:09.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/Additions/linux/drm/vbox_drv.c 2019-11-26 10:08:56.324644270 +0000
+@@ -270,12 +270,16 @@
+ }
+
+ static struct drm_driver driver = {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+ .driver_features =
+ DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ |
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81)
++# if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81)
+ DRIVER_IRQ_SHARED |
+-#endif
++# endif /* < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81) */
+ DRIVER_PRIME,
++#else /* >= KERNEL_VERSION(5, 4, 0) */
++ .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ,
++#endif /* < KERNEL_VERSION(5, 4, 0) */
+ .dev_priv_size = 0,
+
+ .load = vbox_driver_load,
+diff -u -r VirtualBox-6.0.14/src/VBox/Additions/linux/drm/vbox_main.c VirtualBox-6.0.14-5.4/src/VBox/Additions/linux/drm/vbox_main.c
+--- VirtualBox-6.0.14/src/VBox/Additions/linux/drm/vbox_main.c 2019-10-10 18:28:09.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/Additions/linux/drm/vbox_main.c 2019-11-26 10:08:56.324644270 +0000
+@@ -616,11 +616,13 @@
+
+ static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo)
+ {
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_70)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
++ return drm_vma_node_offset_addr(&bo->bo.base.vma_node);
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_70)
+ return bo->bo.addr_space_offset;
+ #else
+ return drm_vma_node_offset_addr(&bo->bo.vma_node);
+-#endif
++#endif /* >= KERNEL_VERSION(5, 4, 0) */
+ }
+
+ int
+diff -u -r VirtualBox-6.0.14/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c VirtualBox-6.0.14-5.4/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+--- VirtualBox-6.0.14/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c 2019-10-10 18:35:33.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c 2019-11-26 10:08:56.321310893 +0000
+@@ -924,8 +924,13 @@
+ for (i = 0; i < skb_shinfo(pBuf)->nr_frags; i++)
+ {
+ skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i];
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
++ pSG->aSegs[iSeg].cb = pFrag->bv_len;
++ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
++# else /* < KERNEL_VERSION(5, 4, 0) */
+ pSG->aSegs[iSeg].cb = pFrag->size;
+ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;
++# endif /* >= KERNEL_VERSION(5, 4, 0) */
+ Log6((" %p", pSG->aSegs[iSeg].pv));
+ pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS;
+ Assert(iSeg <= pSG->cSegsAlloc);
+@@ -940,8 +945,13 @@
+ for (i = 0; i < skb_shinfo(pFragBuf)->nr_frags; i++)
+ {
+ skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i];
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
++ pSG->aSegs[iSeg].cb = pFrag->bv_len;
++ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
++# else /* < KERNEL_VERSION(5, 4, 0) */
+ pSG->aSegs[iSeg].cb = pFrag->size;
+ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;
++# endif /* >= KERNEL_VERSION(5, 4, 0) */
+ Log6((" %p", pSG->aSegs[iSeg].pv));
+ pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS;
+ Assert(iSeg <= pSG->cSegsAlloc);
+diff -u -r VirtualBox-6.0.14/src/VBox/Runtime/common/fs/ntfsvfs.cpp VirtualBox-6.0.14-5.4/src/VBox/Runtime/common/fs/ntfsvfs.cpp
+--- VirtualBox-6.0.14/src/VBox/Runtime/common/fs/ntfsvfs.cpp 2019-10-10 18:36:03.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/Runtime/common/fs/ntfsvfs.cpp 2019-11-26 10:08:56.317977517 +0000
+@@ -1052,7 +1052,7 @@
+ case 4: cClustersInRun |= (uint32_t)pbPairs[offPairs + 3] << 24; RT_FALL_THRU();
+ case 3: cClustersInRun |= (uint32_t)pbPairs[offPairs + 2] << 16; RT_FALL_THRU();
+ case 2: cClustersInRun |= (uint16_t)pbPairs[offPairs + 1] << 8; RT_FALL_THRU();
+- case 1: cClustersInRun |= (uint16_t)pbPairs[offPairs + 0] << 0; RT_FALL_THRU();
++ case 1: cClustersInRun |= (uint16_t)pbPairs[offPairs + 0] << 0;
+ }
+ offPairs += cbRunField;
+ AssertBreakStmt(cClustersInRun <= cMaxClustersInRun,
+diff -u -r VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
+--- VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c 2019-10-10 18:36:16.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c 2019-11-26 10:24:51.692930759 +0000
+@@ -443,9 +443,6 @@
+ }
+
+ SetPageReserved(&paPages[iPage]);
+-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */
+- MY_SET_PAGES_EXEC(&paPages[iPage], 1);
+-#endif
+ }
+ *pPhys = page_to_phys(paPages);
+ pvRet = phys_to_virt(page_to_phys(paPages));
+@@ -491,9 +488,6 @@
+ for (iPage = 0; iPage < cPages; iPage++)
+ {
+ ClearPageReserved(&paPages[iPage]);
+-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */
+- MY_SET_PAGES_NOEXEC(&paPages[iPage], 1);
+-#endif
+ }
+ __free_pages(paPages, cOrder);
+ IPRT_LINUX_RESTORE_EFL_AC();
+diff -u -r VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+--- VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c 2019-10-10 18:36:16.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c 2019-11-26 10:09:28.805069152 +0000
+@@ -86,6 +86,8 @@
+ /** Set if the allocation is contiguous.
+ * This means it has to be given back as one chunk. */
+ bool fContiguous;
++ /** Set if executable allocation. */
++ bool fExecutable;
+ /** Set if we've vmap'ed the memory into ring-0. */
+ bool fMappedToRing0;
+ /** The pages in the apPages array. */
+@@ -289,10 +291,11 @@
+ * Only valid if fContiguous == true, ignored otherwise.
+ * @param fFlagsLnx The page allocation flags (GPFs).
+ * @param fContiguous Whether the allocation must be contiguous.
++ * @param fExecutable Whether the memory must be executable.
+ * @param rcNoMem What to return when we're out of pages.
+ */
+ static int rtR0MemObjLinuxAllocPages(PRTR0MEMOBJLNX *ppMemLnx, RTR0MEMOBJTYPE enmType, size_t cb,
+- size_t uAlignment, gfp_t fFlagsLnx, bool fContiguous, int rcNoMem)
++ size_t uAlignment, gfp_t fFlagsLnx, bool fContiguous, bool fExecutable, int rcNoMem)
+ {
+ size_t iPage;
+ size_t const cPages = cb >> PAGE_SHIFT;
+@@ -371,7 +374,8 @@
+ for (iPage = 0; iPage < cPages; iPage++)
+ {
+ pMemLnx->apPages[iPage] = &paPages[iPage];
+- MY_SET_PAGES_EXEC(pMemLnx->apPages[iPage], 1);
++ if (fExecutable)
++ MY_SET_PAGES_EXEC(pMemLnx->apPages[iPage], 1);
+ if (PageHighMem(pMemLnx->apPages[iPage]))
+ BUG();
+ }
+@@ -379,6 +383,7 @@
+ fContiguous = true;
+ #endif /* < 2.4.22 */
+ pMemLnx->fContiguous = fContiguous;
++ pMemLnx->fExecutable = fExecutable;
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
+ /*
+@@ -409,7 +414,7 @@
+ * This should never happen!
+ */
+ printk("rtR0MemObjLinuxAllocPages(cb=0x%lx, uAlignment=0x%lx): alloc_pages(..., %d) returned physical memory at 0x%lx!\n",
+- (unsigned long)cb, (unsigned long)uAlignment, rtR0MemObjLinuxOrder(cPages), (unsigned long)page_to_phys(pMemLnx->apPages[0]));
++ (unsigned long)cb, (unsigned long)uAlignment, rtR0MemObjLinuxOrder(cPages), (unsigned long)page_to_phys(pMemLnx->apPages[0]));
+ rtR0MemObjLinuxFreePages(pMemLnx);
+ return rcNoMem;
+ }
+@@ -438,14 +443,12 @@
+ while (iPage-- > 0)
+ {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
+- /*
+- * See SetPageReserved() in rtR0MemObjLinuxAllocPages()
+- */
++ /* See SetPageReserved() in rtR0MemObjLinuxAllocPages() */
+ ClearPageReserved(pMemLnx->apPages[iPage]);
+ #endif
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+-#else
+- MY_SET_PAGES_NOEXEC(pMemLnx->apPages[iPage], 1);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 22)
++ if (pMemLnx->fExecutable)
++ MY_SET_PAGES_NOEXEC(pMemLnx->apPages[iPage], 1);
+ #endif
+ }
+
+@@ -662,10 +665,10 @@
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_PAGE, cb, PAGE_SIZE, GFP_HIGHUSER,
+- false /* non-contiguous */, VERR_NO_MEMORY);
++ false /* non-contiguous */, fExecutable, VERR_NO_MEMORY);
+ #else
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_PAGE, cb, PAGE_SIZE, GFP_USER,
+- false /* non-contiguous */, VERR_NO_MEMORY);
++ false /* non-contiguous */, fExecutable, VERR_NO_MEMORY);
+ #endif
+ if (RT_SUCCESS(rc))
+ {
+@@ -696,19 +699,19 @@
+ #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32)
+ /* ZONE_DMA32: 0-4GB */
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA32,
+- false /* non-contiguous */, VERR_NO_LOW_MEMORY);
++ false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY);
+ if (RT_FAILURE(rc))
+ #endif
+ #ifdef RT_ARCH_AMD64
+ /* ZONE_DMA: 0-16MB */
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA,
+- false /* non-contiguous */, VERR_NO_LOW_MEMORY);
++ false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY);
+ #else
+ # ifdef CONFIG_X86_PAE
+ # endif
+ /* ZONE_NORMAL: 0-896MB */
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_USER,
+- false /* non-contiguous */, VERR_NO_LOW_MEMORY);
++ false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY);
+ #endif
+ if (RT_SUCCESS(rc))
+ {
+@@ -738,17 +741,17 @@
+ #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32)
+ /* ZONE_DMA32: 0-4GB */
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_DMA32,
+- true /* contiguous */, VERR_NO_CONT_MEMORY);
++ true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY);
+ if (RT_FAILURE(rc))
+ #endif
+ #ifdef RT_ARCH_AMD64
+ /* ZONE_DMA: 0-16MB */
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_DMA,
+- true /* contiguous */, VERR_NO_CONT_MEMORY);
++ true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY);
+ #else
+ /* ZONE_NORMAL (32-bit hosts): 0-896MB */
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_USER,
+- true /* contiguous */, VERR_NO_CONT_MEMORY);
++ true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY);
+ #endif
+ if (RT_SUCCESS(rc))
+ {
+@@ -795,7 +798,7 @@
+
+ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, enmType, cb, uAlignment, fGfp,
+ enmType == RTR0MEMOBJTYPE_PHYS /* contiguous / non-contiguous */,
+- VERR_NO_PHYS_MEMORY);
++ false /*fExecutable*/, VERR_NO_PHYS_MEMORY);
+ if (RT_FAILURE(rc))
+ return rc;
+
+diff -u -r VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
+--- VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h 2019-10-10 18:36:16.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h 2019-11-26 10:09:39.218538652 +0000
+@@ -337,8 +337,10 @@
+ #endif
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+-# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages)
+-# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages)
++# if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) /* The interface was removed, but we only need it for < 2.4.22, so who cares. */
++# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages)
++# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages)
++# endif
+ #else
+ # define MY_SET_PAGES_EXEC(pPages, cPages) \
+ do { \
+diff -u -r VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c
+--- VirtualBox-6.0.14/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c 2019-10-10 18:36:16.000000000 +0000
++++ VirtualBox-6.0.14-5.4/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c 2019-11-26 10:08:56.321310893 +0000
+@@ -36,6 +36,9 @@
+ #include <iprt/errcore.h>
+ #include "internal/thread.h"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++ #include <uapi/linux/sched/types.h>
++#endif /* >= KERNEL_VERSION(4, 11, 0) */
+
+ RTDECL(RTTHREAD) RTThreadSelf(void)
+ {