forked from pool/virtualbox
507edc9de0
- Fix build error on Factory;Staging due to libxml 2.12.6. Added file libxml21206.patch. Added file kernel-6.9.patch to fix builds on kernel 6.9. OBS-URL: https://build.opensuse.org/request/show/1169265 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=734
111 lines
4.5 KiB
Diff
111 lines
4.5 KiB
Diff
Index: VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
|
|
===================================================================
|
|
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
|
|
+++ VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
|
|
@@ -1292,9 +1292,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
|
|
IPRT_LINUX_SAVE_EFL_AC();
|
|
const int cPages = cb >> PAGE_SHIFT;
|
|
struct task_struct *pTask = rtR0ProcessToLinuxTask(R0Process);
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
|
|
- struct vm_area_struct **papVMAs;
|
|
-# endif
|
|
PRTR0MEMOBJLNX pMemLnx;
|
|
int rc = VERR_NO_MEMORY;
|
|
int const fWrite = fAccess & RTMEM_PROT_WRITE ? 1 : 0;
|
|
@@ -1318,11 +1315,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
|
|
return VERR_NO_MEMORY;
|
|
}
|
|
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
|
|
- papVMAs = (struct vm_area_struct **)RTMemAlloc(sizeof(*papVMAs) * cPages);
|
|
- if (papVMAs)
|
|
- {
|
|
-# endif
|
|
LNX_MM_DOWN_READ(pTask->mm);
|
|
|
|
/*
|
|
@@ -1342,9 +1334,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
|
|
fWrite, /* force write access. */
|
|
# endif
|
|
&pMemLnx->apPages[0] /* Page array. */
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0) && !RTLNX_SUSE_MAJ_PREREQ(15, 6)
|
|
- , papVMAs /* vmas */
|
|
-# endif
|
|
);
|
|
/*
|
|
* Actually this should not happen at the moment as call this function
|
|
@@ -1367,12 +1356,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
|
|
fWrite, /* force write access. */
|
|
# endif
|
|
&pMemLnx->apPages[0] /* Page array. */
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
|
|
- , papVMAs /* vmas */
|
|
-# endif
|
|
-# if GET_USER_PAGES_API >= KERNEL_VERSION(4, 10, 0)
|
|
- , NULL /* locked */
|
|
-# endif
|
|
+ , NULL, NULL
|
|
);
|
|
#else /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */
|
|
rc = get_user_pages(pTask, /* Task for fault accounting. */
|
|
@@ -1389,9 +1373,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
|
|
fWrite, /* force write access. */
|
|
# endif
|
|
&pMemLnx->apPages[0] /* Page array. */
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0) && && !defined(OPENSUSE_156)
|
|
- , papVMAs /* vmas */
|
|
-# endif
|
|
);
|
|
#endif /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */
|
|
if (rc == cPages)
|
|
@@ -1415,21 +1396,10 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
|
|
while (rc-- > 0)
|
|
{
|
|
flush_dcache_page(pMemLnx->apPages[rc]);
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
|
|
-# 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
|
|
-# endif
|
|
}
|
|
|
|
LNX_MM_UP_READ(pTask->mm);
|
|
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
|
|
- RTMemFree(papVMAs);
|
|
-# endif
|
|
-
|
|
pMemLnx->Core.u.Lock.R0Process = R0Process;
|
|
pMemLnx->cPages = cPages;
|
|
Assert(!pMemLnx->fMappedToRing0);
|
|
@@ -1457,11 +1427,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
|
|
|
|
rc = VERR_LOCK_FAILED;
|
|
|
|
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
|
|
- RTMemFree(papVMAs);
|
|
- }
|
|
-# endif
|
|
-
|
|
rtR0MemObjDelete(&pMemLnx->Core);
|
|
IPRT_LINUX_RESTORE_EFL_AC();
|
|
return rc;
|
|
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/regops.c
|
|
===================================================================
|
|
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/sharedfolders/regops.c
|
|
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/regops.c
|
|
@@ -270,11 +270,7 @@ static ssize_t vbsf_iov_iter_get_pages(s
|
|
size_t cPagesLocked;
|
|
|
|
down_read(&pTask->mm->mmap_sem);
|
|
-#if defined(OPENSUSE_156)
|
|
cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages);
|
|
-#else
|
|
- cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, iter->v_write, 1 /*force*/, papPages, NULL);
|
|
-#endif
|
|
up_read(&pTask->mm->mmap_sem);
|
|
if (cPagesLocked == cPages) {
|
|
size_t cbRet = (cPages << PAGE_SHIFT) - offPg0;
|