virtualbox/fixes_for_kernel_6.3.patch
Larry Finger d3dbcc4265 Accepting request 1069741 from home:lwfinger:branches:Virtualization
- Added file "fixea_for_kernel_6.3.patch" to handle API change.
- File "fixes_for_gcc13.patch" updated for additional changes in GCC 13 boo#1207468

OBS-URL: https://build.opensuse.org/request/show/1069741
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=682
2023-03-06 21:06:16 +00:00

41 lines
1.5 KiB
Diff

Patch to fix VirtualBox builds on kernel 6.3.0 and newer
Beginning with 6.3, a user is no loncer to write directly info the
vm_flags member of struct vm_area_struct. It is now necessary to use
the vm_flags_set() wrapper. Two locations in memobj-r0drv-linux.c are
affected.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Index: VirtualBox-7.0.6/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- VirtualBox-7.0.6.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ VirtualBox-7.0.6/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -1401,8 +1401,12 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
while (rc-- > 0)
{
flush_dcache_page(pMemLnx->apPages[rc]);
- papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
- }
+# if RTLNX_VER_MIN(6, 3, 0)
+ vm_flags_set(papVMAs[rc], VM_DONTCOPY | VM_LOCKED);
+#else
+ papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
+#endif
+ }
LNX_MM_UP_READ(pTask->mm);
@@ -1873,7 +1877,11 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(
/* Thes flags help making 100% sure some bad stuff wont happen (swap, core, ++).
* See remap_pfn_range() in mm/memory.c */
#if RTLNX_VER_MIN(3,7,0)
+# if RTLNX_VER_MIN(6, 3, 0)
+ vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP);
+#else
vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+#endif
#else
vma->vm_flags |= VM_RESERVED;
#endif