Skip to contentSkip to conversation

vboxguestdrivers: Fix build with kernel 5.8

PATCH New Khem Raj 1 participant 1 message Aug 24, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 vboxguestdrivers: Fix build with kernel 5.8

Remove patches which are already covered in this new patch

Fixes
step1b: ERROR: modpost: "__get_vm_area_caller" [/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/qemux86_64-poky-linux/vboxguestdrivers/6.1.12-r0/vboxguestdrivers-6.1.12/vboxguest/vboxguest.ko] undefined!
step1b: ERROR: modpost: "map_kernel_range" [/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/qemux86_64-poky-linux/vboxguestdrivers/6.1.12-r0/vboxguestdrivers-6.1.12/vboxguest/vboxguest.ko] undefined!

---
 .../0001-fixes_for_mm_struct.patch            |  176 -
 .../0002-fixes_for_module_memory.patch        |   65 -
 ...03-fixes_for_changes_in_cpu_tlbstate.patch |   39 -
 .../vboxguestdrivers/021-linux-5-8.patch      | 5046 +++++++++++++++++
 .../vboxguestdrivers/kernel-5.8-4.patch       |   19 -
 .../vboxguestdrivers_6.1.12.bb                |    5 +-
 6 files changed, 5047 insertions(+), 303 deletions(-)
 delete mode 100644 meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0001-fixes_for_mm_struct.patch
 delete mode 100644 meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch
 delete mode 100644 meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0003-fixes_for_changes_in_cpu_tlbstate.patch
 create mode 100644 meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/021-linux-5-8.patch
 delete mode 100644 meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/kernel-5.8-4.patch
meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0001-fixes_for_mm_struct.patch deleted +0 -176
deleted file mode 100644
index 1ad5ce51bf..0000000000
@@ -1,176 +0,0 @@
-From 98070c936931879d2b8e22939724b5a0689721d0 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <[email protected]>
-Date: Tue, 18 Aug 2020 17:48:29 +0800
-Subject: [PATCH 1/3] fixes_for_mm_struct
-
-Upstream-Status: Backport [https://www.virtualbox.org/ticket/19644]
-
-Signed-off-by: Hongxu Jia <[email protected]>
----
- .../Runtime/r0drv/linux/memobj-r0drv-linux.c  | 74 +++++++++++++++++--
- 1 file changed, 67 insertions(+), 7 deletions(-)
-
-diff --git a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
-index 37389bcc..cdc7e8e6 100644
---- a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
-+++ b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
-@@ -222,9 +222,17 @@ static void *rtR0MemObjLinuxDoMmap(RTR3PTR R3PtrFixed, size_t cb, size_t uAlignm
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
-         ulAddr = vm_mmap(NULL, R3PtrFixed, cb, fLnxProt, MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, 0);
- #else
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-         down_write(&pTask->mm->mmap_sem);
-+#else
-+        down_write(&pTask->mm->mmap_lock);
-+#endif
-         ulAddr = do_mmap(NULL, R3PtrFixed, cb, fLnxProt, MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, 0);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-         up_write(&pTask->mm->mmap_sem);
-+#else
-+        up_write(&pTask->mm->mmap_lock);
-+#endif
- #endif
-     }
-     else
-@@ -232,9 +240,17 @@ static void *rtR0MemObjLinuxDoMmap(RTR3PTR R3PtrFixed, size_t cb, size_t uAlignm
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
-         ulAddr = vm_mmap(NULL, 0, cb, fLnxProt, MAP_SHARED | MAP_ANONYMOUS, 0);
- #else
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-         down_write(&pTask->mm->mmap_sem);
-+#else
-+        down_write(&pTask->mm->mmap_lock);
-+#endif
-         ulAddr = do_mmap(NULL, 0, cb, fLnxProt, MAP_SHARED | MAP_ANONYMOUS, 0);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-         up_write(&pTask->mm->mmap_sem);
-+#else
-+        up_write(&pTask->mm->mmap_lock);
-+#endif
- #endif
-         if (    !(ulAddr & ~PAGE_MASK)
-             &&  (ulAddr & (uAlignment - 1)))
-@@ -269,13 +285,29 @@ static void rtR0MemObjLinuxDoMunmap(void *pv, size_t cb, struct task_struct *pTa
-     Assert(pTask == current); RT_NOREF_PV(pTask);
-     vm_munmap((unsigned long)pv, cb);
- #elif defined(USE_RHEL4_MUNMAP)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-     down_write(&pTask->mm->mmap_sem);
-+#else
-+    down_write(&pTask->mm->mmap_lock);
-+#endif
-     do_munmap(pTask->mm, (unsigned long)pv, cb, 0); /* should it be 1 or 0? */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-     up_write(&pTask->mm->mmap_sem);
- #else
-+    up_write(&pTask->mm->mmap_lock);
-+#endif
-+#else
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-     down_write(&pTask->mm->mmap_sem);
-+#else
-+    down_write(&pTask->mm->mmap_lock);
-+#endif
-     do_munmap(pTask->mm, (unsigned long)pv, cb);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-     up_write(&pTask->mm->mmap_sem);
-+#else
-+    up_write(&pTask->mm->mmap_lock);
-+#endif
- #endif
- }
- 
-@@ -593,7 +625,11 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
-                 size_t              iPage;
-                 Assert(pTask);
-                 if (pTask && pTask->mm)
--                    down_read(&pTask->mm->mmap_sem);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-+		    down_read(&pTask->mm->mmap_sem);
-+#else
-+		    down_read(&pTask->mm->mmap_lock);
-+#endif
- 
-                 iPage = pMemLnx->cPages;
-                 while (iPage-- > 0)
-@@ -608,7 +644,11 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
-                 }
- 
-                 if (pTask && pTask->mm)
--                    up_read(&pTask->mm->mmap_sem);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-+		    up_read(&pTask->mm->mmap_sem);
-+#else
-+		    up_read(&pTask->mm->mmap_lock);
-+#endif
-             }
-             /* else: kernel memory - nothing to do here. */
-             break;
-@@ -1076,7 +1116,11 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3P
-     papVMAs = (struct vm_area_struct **)RTMemAlloc(sizeof(*papVMAs) * cPages);
-     if (papVMAs)
-     {
--        down_read(&pTask->mm->mmap_sem);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-+	down_read(&pTask->mm->mmap_sem);
-+#else
-+	down_read(&pTask->mm->mmap_lock);
-+#endif
- 
-         /*
-          * Get user pages.
-@@ -1162,7 +1206,11 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3P
-                 papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
-             }
- 
--            up_read(&pTask->mm->mmap_sem);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-+	    up_read(&pTask->mm->mmap_sem);
-+#else
-+	    up_read(&pTask->mm->mmap_lock);
-+#endif
- 
-             RTMemFree(papVMAs);
- 
-@@ -1189,7 +1237,11 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3P
- #endif
-         }
- 
--        up_read(&pTask->mm->mmap_sem);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-+	up_read(&pTask->mm->mmap_sem);
-+#else
-+	up_read(&pTask->mm->mmap_lock);
-+#endif
- 
-         RTMemFree(papVMAs);
-         rc = VERR_LOCK_FAILED;
-@@ -1604,7 +1656,11 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ p
-             const size_t    cPages    = (offSub + cbSub) >> PAGE_SHIFT;
-             size_t          iPage;
- 
--            down_write(&pTask->mm->mmap_sem);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-+	    down_write(&pTask->mm->mmap_sem);
-+#else
-+	    down_write(&pTask->mm->mmap_lock);
-+#endif
- 
-             rc = VINF_SUCCESS;
-             if (pMemLnxToMap->cPages)
-@@ -1721,7 +1777,11 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ p
-             }
- #endif /* CONFIG_NUMA_BALANCING */
- 
--            up_write(&pTask->mm->mmap_sem);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-+	    up_write(&pTask->mm->mmap_sem);
-+#else
-+	    up_write(&pTask->mm->mmap_lock);
-+#endif
- 
-             if (RT_SUCCESS(rc))
-             {
--- 
-2.18.2
-
meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch deleted +0 -65

65 lines not on this page · raw message

meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0003-fixes_for_changes_in_cpu_tlbstate.patch deleted +0 -39
deleted file mode 100644
index 6a3e63f63d..0000000000
@@ -1,39 +0,0 @@
-From 6089974a81b1b44e1d2dfa5af1fdc110dfee40c1 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <[email protected]>
-Date: Tue, 18 Aug 2020 17:51:24 +0800
-Subject: [PATCH 3/3] fixes_for_changes_in_cpu_tlbstate
-
-Upstream-Status: Backport [https://www.virtualbox.org/ticket/19644]
-
-Signed-off-by: Hongxu Jia <[email protected]>
----
- src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
-index c7d0d99a..2e7aa6e1 100644
---- a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
-+++ b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
-@@ -757,12 +757,19 @@ EXPORT_SYMBOL(SUPDrvLinuxIDC);
- RTCCUINTREG VBOXCALL supdrvOSChangeCR4(RTCCUINTREG fOrMask, RTCCUINTREG fAndMask)
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-     RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4);
-+#else
-+    RTCCUINTREG uOld = __read_cr4();
-+#endif
-     RTCCUINTREG uNew = (uOld & fAndMask) | fOrMask;
-     if (uNew != uOld)
-     {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
-         this_cpu_write(cpu_tlbstate.cr4, uNew);
-         __write_cr4(uNew);
-+#endif
-+        ASMSetCR4(uNew);
-     }
- #else
-     RTCCUINTREG uOld = ASMGetCR4();
--- 
-2.18.2
-
meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/021-linux-5-8.patch new file +5046 -0

2,720 lines not on this page · raw message

meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/kernel-5.8-4.patch deleted +0 -19
deleted file mode 100644
index cb4148fc79..0000000000

Lines of this file are not shown. View the raw message.

meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_6.1.12.bb +1 -4
index e57df58d6c..6c036d403c 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.28.0

Part of the diff is not shown here. View the raw message.