@@ -1,141 +0,0 @@
1−diff --git a/vboxguest/include/iprt/cdefs.h b/vboxguest/include/iprt/cdefs.h
2−index 8aa1736..d5c5a4c 100644
3−--- a/vboxguest/include/iprt/cdefs.h
4−+++ b/vboxguest/include/iprt/cdefs.h
5−@@ -1166,7 +1166,7 @@
6− * Tell the compiler that we're falling through to the next case in a switch.
7− * @sa RT_FALL_THRU */
8− #if RT_GNUC_PREREQ(7, 0)
9−-# define RT_FALL_THROUGH() __attribute__((fallthrough))
10−+# define RT_FALL_THROUGH() __attribute__((__fallthrough__))
11− #else
12− # define RT_FALL_THROUGH() (void)0
13− #endif
14−diff --git a/vboxguest/r0drv/linux/alloc-r0drv-linux.c b/vboxguest/r0drv/linux/alloc-r0drv-linux.c
15−index 42e4ef5..acb0ac7 100644
16−--- a/vboxguest/r0drv/linux/alloc-r0drv-linux.c
17−+++ b/vboxguest/r0drv/linux/alloc-r0drv-linux.c
18−@@ -443,9 +443,6 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb)
19− }
20−
21− SetPageReserved(&paPages[iPage]);
22−-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */
23−- MY_SET_PAGES_EXEC(&paPages[iPage], 1);
24−-#endif
25− }
26− *pPhys = page_to_phys(paPages);
27− pvRet = phys_to_virt(page_to_phys(paPages));
28−@@ -491,9 +488,6 @@ RTR0DECL(void) RTMemContFree(void *pv, size_t cb)
29− for (iPage = 0; iPage < cPages; iPage++)
30− {
31− ClearPageReserved(&paPages[iPage]);
32−-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */
33−- MY_SET_PAGES_NOEXEC(&paPages[iPage], 1);
34−-#endif
35− }
36− __free_pages(paPages, cOrder);
37− IPRT_LINUX_RESTORE_EFL_AC();
38−diff --git a/vboxguest/r0drv/linux/the-linux-kernel.h b/vboxguest/r0drv/linux/the-linux-kernel.h
39−index 8fda072..7904327 100644
40−--- a/vboxguest/r0drv/linux/the-linux-kernel.h
41−+++ b/vboxguest/r0drv/linux/the-linux-kernel.h
42−@@ -337,8 +337,10 @@ DECLINLINE(unsigned long) msecs_to_jiffies(unsigned int cMillies)
43− #endif
44−
45− #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
46−-# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages)
47−-# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages)
48−+# 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. */
49−+# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages)
50−+# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages)
51−+# endif
52− #else
53− # define MY_SET_PAGES_EXEC(pPages, cPages) \
54− do { \
55−diff --git a/vboxguest/r0drv/linux/thread2-r0drv-linux.c b/vboxguest/r0drv/linux/thread2-r0drv-linux.c
56−index 7c82b38..04479b5 100644
57−--- a/vboxguest/r0drv/linux/thread2-r0drv-linux.c
58−+++ b/vboxguest/r0drv/linux/thread2-r0drv-linux.c
59−@@ -36,6 +36,9 @@
60− #include <iprt/errcore.h>
61− #include "internal/thread.h"
62−
63−+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
64−+ #include <uapi/linux/sched/types.h>
65−+#endif /* >= KERNEL_VERSION(4, 11, 0) */
66−
67− RTDECL(RTTHREAD) RTThreadSelf(void)
68− {
69−diff --git a/vboxsf/include/iprt/cdefs.h b/vboxsf/include/iprt/cdefs.h
70−index 8aa1736..d5c5a4c 100644
71−--- a/vboxsf/include/iprt/cdefs.h
72−+++ b/vboxsf/include/iprt/cdefs.h
73−@@ -1166,7 +1166,7 @@
74− * Tell the compiler that we're falling through to the next case in a switch.
75− * @sa RT_FALL_THRU */
76− #if RT_GNUC_PREREQ(7, 0)
77−-# define RT_FALL_THROUGH() __attribute__((fallthrough))
78−+# define RT_FALL_THROUGH() __attribute__((__fallthrough__))
79− #else
80− # define RT_FALL_THROUGH() (void)0
81− #endif
82−diff --git a/vboxsf/r0drv/linux/the-linux-kernel.h b/vboxsf/r0drv/linux/the-linux-kernel.h
83−index 8fda072..7904327 100644
84−--- a/vboxsf/r0drv/linux/the-linux-kernel.h
85−+++ b/vboxsf/r0drv/linux/the-linux-kernel.h
86−@@ -337,8 +337,10 @@ DECLINLINE(unsigned long) msecs_to_jiffies(unsigned int cMillies)
87− #endif
88−
89− #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
90−-# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages)
91−-# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages)
92−+# 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. */
93−+# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages)
94−+# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages)
95−+# endif
96− #else
97− # define MY_SET_PAGES_EXEC(pPages, cPages) \
98− do { \
99−diff --git a/vboxvideo/vbox_drv.c b/vboxvideo/vbox_drv.c
100−index 8e4f337..9454301 100644
101−--- a/vboxvideo/vbox_drv.c
102−+++ b/vboxvideo/vbox_drv.c
103−@@ -265,12 +265,16 @@ static void vbox_master_drop(struct drm_device *dev, struct drm_file *file_priv)
104− }
105−
106− static struct drm_driver driver = {
107−+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
108− .driver_features =
109− DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ |
110−-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81)
111−+# if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81)
112− DRIVER_IRQ_SHARED |
113−-#endif
114−+# endif /* < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81) */
115− DRIVER_PRIME,
116−+#else /* >= KERNEL_VERSION(5, 4, 0) */
117−+ .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ,
118−+#endif /* < KERNEL_VERSION(5, 4, 0) */
119− .dev_priv_size = 0,
120−
121− .load = vbox_driver_load,
122−diff --git a/vboxvideo/vbox_main.c b/vboxvideo/vbox_main.c
123−index 11b9745..cc7831d 100644
124−--- a/vboxvideo/vbox_main.c
125−+++ b/vboxvideo/vbox_main.c
126−@@ -612,11 +612,13 @@ void vbox_gem_free_object(struct drm_gem_object *obj)
127−
128− static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo)
129− {
130−-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_70)
131−+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
132−+ return drm_vma_node_offset_addr(&bo->bo.base.vma_node);
133−+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_70)
134− return bo->bo.addr_space_offset;
135− #else
136− return drm_vma_node_offset_addr(&bo->bo.vma_node);
137−-#endif
138−+#endif /* >= KERNEL_VERSION(5, 4, 0) */
139− }
140−
141− int