[opensuse-kernel] Question about special kernel modifications
Hi, In kernel 5.8, the routine used by VirtualBox to map an area of virtual memory "(__get_vm_area()" has been replaced. By itself, thet is not serious, but the replacement is not exported, thus VB will cannot be built. Ultimately, I think the only solution for Oracle will be to rewrite their module vboxdrv for inclusion in the kernel, the way that VMWare has a built-in module. As that would likely take several cycles, I am looking for an alternative solution to the build problems for the Kernel_HEAD_standard branch of Tumbleweed that will exist as soon as 5.8.0-rc1 is released in a week. The easiest solution would be to modify the openSUSE kernel to export that entry point. Would that be acceptable, or do you have a better solution? For testing purposes, I have made that change to my kernel. Thanks, Larry -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 08. 06. 20, 21:06, Larry Finger wrote:
Hi,
In kernel 5.8, the routine used by VirtualBox to map an area of virtual memory "(__get_vm_area()" has been replaced. By itself, thet is not serious, but the replacement is not exported, thus VB will cannot be built.
Try this: Index: VirtualBox-6.1.8/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c =================================================================== --- VirtualBox-6.1.8.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +++ VirtualBox-6.1.8/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c @@ -38,7 +38,7 @@ #if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) /** * Starting with 2.6.23 we can use __get_vm_area and map_vm_area to allocate * memory in the moduel range. This is preferrable to the exec heap below.
Ultimately, I think the only solution for Oracle will be to rewrite their module vboxdrv for inclusion in the kernel
+1. thanks, -- js suse labs -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 6/9/20 12:58 AM, Jiri Slaby wrote:
On 08. 06. 20, 21:06, Larry Finger wrote:
Hi,
In kernel 5.8, the routine used by VirtualBox to map an area of virtual memory "(__get_vm_area()" has been replaced. By itself, thet is not serious, but the replacement is not exported, thus VB will cannot be built.
Try this: Index: VirtualBox-6.1.8/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c =================================================================== --- VirtualBox-6.1.8.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +++ VirtualBox-6.1.8/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c @@ -38,7 +38,7 @@
#if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) /** * Starting with 2.6.23 we can use __get_vm_area and map_vm_area to allocate * memory in the moduel range. This is preferrable to the exec heap below.
Jiri, Thanks for the suggestion. With this change, the module builds, but it does not start correctly. Apparently, 5.8 is not like 2.6.22, or there has been some bit rot. I guess programming would not be as interesting if it were simple. :) Larry -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 09. 06. 20, 21:14, Larry Finger wrote:
On 6/9/20 12:58 AM, Jiri Slaby wrote:
On 08. 06. 20, 21:06, Larry Finger wrote:
Hi,
In kernel 5.8, the routine used by VirtualBox to map an area of virtual memory "(__get_vm_area()" has been replaced. By itself, thet is not serious, but the replacement is not exported, thus VB will cannot be built.
Try this: Index: VirtualBox-6.1.8/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c =================================================================== --- VirtualBox-6.1.8.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +++ VirtualBox-6.1.8/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c @@ -38,7 +38,7 @@
#if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) /** * Starting with 2.6.23 we can use __get_vm_area and map_vm_area to allocate * memory in the moduel range. This is preferrable to the exec heap below.
Jiri,
Thanks for the suggestion. With this change, the module builds, but it does not start correctly. Apparently, 5.8 is not like 2.6.22, or there has been some bit rot.
I guess programming would not be as interesting if it were simple. :)
Ok, so we should likely export module_alloc, then. Not __get_vm_area, which is only an internal interface :/. thanks, -- js suse labs -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 6/9/20 2:36 PM, Jiri Slaby wrote:
Ok, so we should likely export module_alloc, then. Not __get_vm_area, which is only an internal interface :/.
My solution that works so far has the following exports from the kernel: EXPORT_SYMBOL(map_kernel_range); EXPORT_SYMBOL(__get_vm_area_caller); I will look at module_alloc and let you know. Thanks for the hint. Larry -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 09. 06. 20, 22:05, Larry Finger wrote:
I will look at module_alloc and let you know.
And when you got to it, please open a bug afterwards, so that we can track and handle it (somehow). And cc me. thanks, -- js suse labs -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 6/11/20 1:25 AM, Jiri Slaby wrote:
On 09. 06. 20, 22:05, Larry Finger wrote:
I will look at module_alloc and let you know.
And when you got to it, please open a bug afterwards, so that we can track and handle it (somehow). And cc me.
My efforts to use module_alloc() did not work. At the moment, I am using the revised versions that work; however, the kernel needs to export map_kernel_range() and __get_vm_area_caller() for the modules to load. The VB fixes have been submitted. The code will build, but the modules will not load due to missing globals. This is submitted as boo #1172897, "VirtualBox kernel modules will not run with kernel 5.8". As requested, you are cc'd. The patch that works on my 5.8 kernel is attached to the bug report. Larry -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (2)
-
Jiri Slaby
-
Larry Finger