forked from pool/virtualbox
fix buld against 6.16 #8
36
kernel-6.16-READ-WRITE.patch
Normal file
36
kernel-6.16-READ-WRITE.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From: Jiri Slaby <jslaby@suse.cz>
|
||||
Subject: hm_vmx: Don't expand READ+WRITE
|
||||
|
||||
They are defined as:
|
||||
#define READ 0
|
||||
#define WRITE 1
|
||||
|
||||
since 6.16:
|
||||
commit 4ef5211ee68113070bd42142f06347866675055e
|
||||
Author: Ingo Molnar <mingo@kernel.org>
|
||||
Date: Mon Mar 24 12:50:24 2025 +0200
|
||||
|
||||
kernel.h: move READ/WRITE definitions to <linux/types.h>
|
||||
|
||||
|
||||
That causes build failures indeed:
|
||||
./include/VBox/vmm/hm_vmx.h:548:29: error: 'VMX_BF_EPT_PT_0_MASK' undeclared here (not in a function); did you mean 'VMX_BF_EPT_PT_READ_MASK'?
|
||||
|
||||
|
||||
That 0_MASK should really be READ_MASK.
|
||||
|
||||
---
|
||||
include/VBox/vmm/hm_vmx.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/include/VBox/vmm/hm_vmx.h
|
||||
+++ b/include/VBox/vmm/hm_vmx.h
|
||||
@@ -542,6 +542,8 @@
|
||||
/** Suppress \#VE. */
|
||||
#define VMX_BF_EPT_PT_SUPPRESS_VE_SHIFT 63
|
||||
#define VMX_BF_EPT_PT_SUPPRESS_VE_MASK UINT64_C(0x8000000000000000)
|
||||
+#undef READ
|
||||
+#undef WRITE
|
||||
RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPT_PT_, UINT64_C(0), UINT64_MAX,
|
||||
(READ, WRITE, EXECUTE, MEMTYPE, IGNORE_PAT, IGN_7, ACCESSED, DIRTY, EXECUTE_USER, IGN_59_11,
|
||||
SUPER_SHW_STACK, IGN_62_61, SUPPRESS_VE));
|
28
kernel-6.16-from_timer.patch
Normal file
28
kernel-6.16-from_timer.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From: Jiri Slaby <jslaby@suse.cz>
|
||||
Subject: timer-r0drv-linux: use timer_container_of
|
||||
|
||||
from_timer() was renamed to timer_container_of() in 6.16's:
|
||||
commit 41cb08555c4164996d67c78b3bf1c658075b75f1
|
||||
Author: Ingo Molnar <mingo@kernel.org>
|
||||
Date: Fri May 9 07:51:14 2025 +0200
|
||||
|
||||
treewide, timers: Rename from_timer() to timer_container_of()
|
||||
|
||||
---
|
||||
src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
|
||||
+++ b/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
|
||||
@@ -748,7 +748,11 @@ static enum hrtimer_restart rtTimerLinux
|
||||
*/
|
||||
static void rtTimerLinuxStdCallback(struct timer_list *pLnxTimer)
|
||||
{
|
||||
+#if RTLNX_VER_MIN(6,16,0)
|
||||
+ PRTTIMERLNXSUBTIMER pSubTimer = timer_container_of(pSubTimer, pLnxTimer, u.Std.LnxTimer);
|
||||
+#else
|
||||
PRTTIMERLNXSUBTIMER pSubTimer = from_timer(pSubTimer, pLnxTimer, u.Std.LnxTimer);
|
||||
+#endif
|
||||
#else
|
||||
/**
|
||||
* Timer callback function for standard timers.
|
101
kernel-6.16-page-index.patch
Normal file
101
kernel-6.16-page-index.patch
Normal file
@@ -0,0 +1,101 @@
|
||||
From: Jiri Slaby <jslaby@suse.cz>
|
||||
Subject: sharedfolders/regops: use __folio_index
|
||||
|
||||
page::index was renamed to page::__folio_index in 6.16's:
|
||||
commit acc53a0b4c156877773da6e9eea4113dc7e770ae
|
||||
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
|
||||
Date: Wed May 14 19:15:07 2025 +0100
|
||||
|
||||
mm: rename page->index to page->__folio_index
|
||||
|
||||
---
|
||||
src/VBox/Additions/linux/sharedfolders/regops.c | 40 +++++++++++++++++++++---
|
||||
1 file changed, 36 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/src/VBox/Additions/linux/sharedfolders/regops.c
|
||||
+++ b/src/VBox/Additions/linux/sharedfolders/regops.c
|
||||
@@ -1789,7 +1789,11 @@ static void vbsf_reg_write_sync_page_cac
|
||||
struct page *pDstPage = find_lock_page(mapping, idxPage);
|
||||
if (pDstPage) {
|
||||
if ( pDstPage->mapping == mapping /* ignore if re-purposed (paranoia) */
|
||||
+#if RTLNX_VER_MIN(6,16,0)
|
||||
+ && pDstPage->__folio_index == idxPage
|
||||
+#else
|
||||
&& pDstPage->index == idxPage
|
||||
+#endif
|
||||
&& !PageDirty(pDstPage) /* ignore if dirty */
|
||||
&& !PageWriteback(pDstPage) /* ignore if being written back */ ) {
|
||||
/*
|
||||
@@ -1820,7 +1824,13 @@ static void vbsf_reg_write_sync_page_cac
|
||||
# endif
|
||||
} else
|
||||
SFLOGFLOW(("vbsf_reg_write_sync_page_cache: Skipping page %p: mapping=%p (vs %p) writeback=%d offset=%#lx (vs%#lx)\n",
|
||||
- pDstPage, pDstPage->mapping, mapping, PageWriteback(pDstPage), pDstPage->index, idxPage));
|
||||
+ pDstPage, pDstPage->mapping, mapping, PageWriteback(pDstPage),
|
||||
+#if RTLNX_VER_MIN(6,16,0)
|
||||
+ pDstPage->__folio_index,
|
||||
+#else
|
||||
+ pDstPage->index,
|
||||
+#endif
|
||||
+ idxPage));
|
||||
unlock_page(pDstPage);
|
||||
vbsf_put_page(pDstPage);
|
||||
}
|
||||
@@ -3632,7 +3642,13 @@ static int vbsf_readpage(struct file *fi
|
||||
struct inode *inode = VBSF_GET_F_DENTRY(file)->d_inode;
|
||||
int err;
|
||||
|
||||
- SFLOGFLOW(("vbsf_readpage: inode=%p file=%p page=%p off=%#llx\n", inode, file, page, (uint64_t)page->index << PAGE_SHIFT));
|
||||
+ SFLOGFLOW(("vbsf_readpage: inode=%p file=%p page=%p off=%#llx\n", inode, file, page,
|
||||
+#if RTLNX_VER_MIN(6,16,0)
|
||||
+ (uint64_t)page->__folio_index << PAGE_SHIFT
|
||||
+#else
|
||||
+ (uint64_t)page->index << PAGE_SHIFT
|
||||
+#endif
|
||||
+ ));
|
||||
Assert(PageLocked(page));
|
||||
|
||||
if (PageUptodate(page)) {
|
||||
@@ -3653,7 +3669,11 @@ static int vbsf_readpage(struct file *fi
|
||||
vrc = VbglR0SfHostReqReadPgLst(pSuperInfo->map.root,
|
||||
pReq,
|
||||
sf_r->Handle.hHost,
|
||||
+#if RTLNX_VER_MIN(6,16,0)
|
||||
+ (uint64_t)page->__folio_index << PAGE_SHIFT,
|
||||
+#else
|
||||
(uint64_t)page->index << PAGE_SHIFT,
|
||||
+#endif
|
||||
PAGE_SIZE,
|
||||
1 /*cPages*/);
|
||||
|
||||
@@ -3709,16 +3729,28 @@ static int vbsf_writepage(struct page *p
|
||||
int err;
|
||||
|
||||
SFLOGFLOW(("vbsf_writepage: inode=%p page=%p off=%#llx pHandle=%p (%#llx)\n",
|
||||
- inode, page, (uint64_t)page->index << PAGE_SHIFT, pHandle, pHandle ? pHandle->hHost : 0));
|
||||
-
|
||||
+ inode, page,
|
||||
+#if RTLNX_VER_MIN(6,16,0)
|
||||
+ (uint64_t)page->__folio_index << PAGE_SHIFT,
|
||||
+#else
|
||||
+ (uint64_t)page->index << PAGE_SHIFT,
|
||||
+#endif
|
||||
+ pHandle, pHandle ? pHandle->hHost : 0));
|
||||
if (pHandle) {
|
||||
struct vbsf_super_info *pSuperInfo = VBSF_GET_SUPER_INFO(inode->i_sb);
|
||||
VBOXSFWRITEPGLSTREQ *pReq = (VBOXSFWRITEPGLSTREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
|
||||
if (pReq) {
|
||||
uint64_t const cbFile = i_size_read(inode);
|
||||
+
|
||||
+#if RTLNX_VER_MIN(6,16,0)
|
||||
+ uint64_t const offInFile = (uint64_t)page->__folio_index << PAGE_SHIFT;
|
||||
+ uint32_t const cbToWrite = page->__folio_index != (cbFile >> PAGE_SHIFT) ? PAGE_SIZE
|
||||
+ : (uint32_t)cbFile & (uint32_t)PAGE_OFFSET_MASK;
|
||||
+#else
|
||||
uint64_t const offInFile = (uint64_t)page->index << PAGE_SHIFT;
|
||||
uint32_t const cbToWrite = page->index != (cbFile >> PAGE_SHIFT) ? PAGE_SIZE
|
||||
: (uint32_t)cbFile & (uint32_t)PAGE_OFFSET_MASK;
|
||||
+#endif
|
||||
int vrc;
|
||||
|
||||
pReq->PgLst.offFirstPage = 0;
|
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 11 07:18:15 UTC 2025 - Jiri Slaby <jslaby@suse.cz>
|
||||
|
||||
- fix build against 6.16, add:
|
||||
* kernel-6.16-READ-WRITE.patch
|
||||
* kernel-6.16-from_timer.patch
|
||||
* kernel-6.16-page-index.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 4 21:09:42 UTC 2025 - Jan Engelhardt <jengelh@inai.de>
|
||||
|
||||
|
@@ -126,6 +126,9 @@ Patch9: vbox-usb-warning.diff
|
||||
Patch10: fix_for_leap15.5.patch
|
||||
Patch11: cxx17.patch
|
||||
Patch12: host-source.patch
|
||||
Patch13: kernel-6.16-READ-WRITE.patch
|
||||
Patch14: kernel-6.16-from_timer.patch
|
||||
Patch15: kernel-6.16-page-index.patch
|
||||
Patch20: gentoo-C23.patch
|
||||
#
|
||||
# Common BuildRequires for both virtualbox and virtualbox-kmp
|
||||
|
Reference in New Issue
Block a user