diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2020-08-19 11:19:06 +0800 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2021-07-19 16:17:21 -0700 |
commit | 8d62c9d4c949341515df2b808b17d6744fde2a7e (patch) | |
tree | c40ad38091334f7991360213f103c34481534615 /meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch | |
parent | 2fe2ea3f159ee183a41b9aa83dd489fbc2cee41c (diff) | |
download | meta-openembedded-8d62c9d4c949341515df2b808b17d6744fde2a7e.tar.gz |
vboxguestdrivers: fix failed to compile with kernel 5.8.0
Backport patches from upstream [1] to fix the issue
It also requires to apply a patch on 5.8 kernel [2]
[1] https://www.virtualbox.org/ticket/19644
[2] https://www.virtualbox.org/raw-attachment/ticket/19644/local_patches
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 9c10ed4baa95648b7735757121e3af8b0aeb8e06)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch')
-rw-r--r-- | meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch new file mode 100644 index 0000000000..a3cfc3b370 --- /dev/null +++ b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0002-fixes_for_module_memory.patch @@ -0,0 +1,65 @@ +From bb580f7b601e5395a2f8fcb2485387035273320f Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Tue, 18 Aug 2020 17:49:34 +0800 +Subject: [PATCH 2/3] fixes_for_module_memory + +Upstream-Status: Backport [https://www.virtualbox.org/ticket/19644] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + .../Runtime/r0drv/linux/alloc-r0drv-linux.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +index bbb8acc6..45cd34c7 100644 +--- a/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c ++++ b/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +@@ -153,6 +153,8 @@ RT_EXPORT_SYMBOL(RTR0MemExecDonate); + + + #ifdef RTMEMALLOC_EXEC_VM_AREA ++ ++ + /** + * Allocate executable kernel memory in the module range. + * +@@ -168,7 +170,12 @@ static PRTMEMHDR rtR0MemAllocExecVmArea(size_t cb) + struct vm_struct *pVmArea; + size_t iPage; + ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) ++ pVmArea = __get_vm_area_caller(cbAlloc, VM_ALLOC, MODULES_VADDR, MODULES_END, ++ __builtin_return_address(0)); ++#else + pVmArea = __get_vm_area(cbAlloc, VM_ALLOC, MODULES_VADDR, MODULES_END); ++#endif + if (!pVmArea) + return NULL; + pVmArea->nr_pages = 0; /* paranoia? */ +@@ -201,14 +208,21 @@ static PRTMEMHDR rtR0MemAllocExecVmArea(size_t cb) + # endif + pVmArea->nr_pages = cPages; + pVmArea->pages = papPages; +- if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC, ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) ++ unsigned long start = (unsigned long)pVmArea->addr; ++ unsigned long size = get_vm_area_size(pVmArea); ++ ++ if (!map_kernel_range(start, size, PAGE_KERNEL_EXEC, papPages)) ++#else ++ if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC, + # if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) + &papPagesIterator + # else + papPages + # endif + )) +- { ++#endif ++ { + PRTMEMLNXHDREX pHdrEx = (PRTMEMLNXHDREX)pVmArea->addr; + pHdrEx->pVmArea = pVmArea; + pHdrEx->pvDummy = NULL; +-- +2.18.2 + |