commit:     9814a8bb058c4a188d7e01086dd29ee9b18b8aa6
Author:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 20 18:25:30 2026 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Fri Feb 20 18:33:25 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9814a8bb

app-emulation/virtualbox-guest-modules: kernel 6.19 support

Bug: https://bugs.gentoo.org/970373
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 ...tualbox-guest-modules-7.2.6-kernel-6.19-1.patch | 117 +++++++++++++++++++++
 ...tualbox-guest-modules-7.2.6-kernel-6.19-3.patch |  40 +++++++
 .../virtualbox-guest-modules-7.2.6-r1.ebuild       |  48 +++++++++
 3 files changed, 205 insertions(+)

diff --git 
a/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.2.6-kernel-6.19-1.patch
 
b/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.2.6-kernel-6.19-1.patch
new file mode 100644
index 000000000000..b3f6b0345c2c
--- /dev/null
+++ 
b/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.2.6-kernel-6.19-1.patch
@@ -0,0 +1,117 @@
+https://github.com/VirtualBox/virtualbox/commit/280303b3f03d7087b9c955088a3cf499414f6ec1
+
+From 280303b3f03d7087b9c955088a3cf499414f6ec1 Mon Sep 17 00:00:00 2001
+From: Vadim Galitsyn <[email protected]>
+Date: Tue, 17 Feb 2026 15:00:09 +0000
+Subject: [PATCH] Linux host: Introduce initial support for kernel 6.19
+ bugref:11038.
+
+svn:sync-xref-src-repo-rev: r172809
+--- a/vboxguest/r0drv/linux/initterm-r0drv-linux.c
++++ b/vboxguest/r0drv/linux/initterm-r0drv-linux.c
+@@ -60,6 +60,11 @@ static DECLARE_TASK_QUEUE(g_rtR0LnxWorkQueue);
+  * This is a special mm structure used to manage the kernel address space. */
+ struct mm_struct *g_pLnxInitMm = NULL;
+ 
++#if RTLNX_VER_MIN(6,19,0)
++/** Pointer to __flush_tlb_all kernel symbol. */
++void (*g_pfnLinuxFlushTlbAll)(void);
++#endif
++
+ 
+ /**
+  * Pushes an item onto the IPRT work queue.
+@@ -136,6 +141,11 @@ DECLHIDDEN(int) rtR0InitNative(void)
+             printk("rtR0InitNative: g_pLnxInitMm=%p\n", g_pLnxInitMm);
+ 
+             RTR0DbgKrnlInfoRelease(hKrnlInfo);
++# if RTLNX_VER_MIN(6,19,0)
++            g_pfnLinuxFlushTlbAll = __symbol_get("__flush_tlb_all");
++            if (!RT_VALID_PTR(g_pfnLinuxFlushTlbAll))
++                printk("rtR0InitNative: can't load __flush_tlb_all\n");
++# endif
+         }
+         else
+             printk("rtR0InitNative: RTR0DbgKrnlInfoOpen failed: %d\n", rc);
+@@ -151,6 +161,12 @@ DECLHIDDEN(void) rtR0TermNative(void)
+ {
+     IPRT_LINUX_SAVE_EFL_AC();
+ 
++# if RTLNX_VER_MIN(6,19,0)
++    if (RT_VALID_PTR(g_pfnLinuxFlushTlbAll))
++        symbol_put_addr(g_pfnLinuxFlushTlbAll);
++    g_pfnLinuxFlushTlbAll = NULL;
++#endif
++
+     rtR0LnxWorkqueueFlush();
+ #if RTLNX_VER_MIN(2,5,41)
+     destroy_workqueue(g_prtR0LnxWorkQueue);
+--- a/vboxguest/r0drv/linux/memobj-r0drv-linux.c
++++ b/vboxguest/r0drv/linux/memobj-r0drv-linux.c
+@@ -181,7 +181,7 @@ static const struct
+ *   Internal Functions                                                        
                                                   *
+ 
*********************************************************************************************************************************/
+ static void rtR0MemObjLinuxFreePages(PRTR0MEMOBJLNX pMemLnx);
+-
++static void rtR0MemObjLinuxFlushTlbAll(void);
+ 
+ 
+ /**
+@@ -2245,6 +2245,15 @@ DECLHIDDEN(int) 
rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ p
+     return rc;
+ }
+ 
++static void rtR0MemObjLinuxFlushTlbAll(void)
++{
++#if RTLNX_VER_MIN(6,19,0)
++    if (RT_LIKELY(RT_VALID_PTR(g_pfnLinuxFlushTlbAll)))
++        g_pfnLinuxFlushTlbAll();
++#else
++    __flush_tlb_all();
++#endif
++}
+ 
+ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t 
offSub, size_t cbSub, uint32_t fProt)
+ {
+@@ -2265,7 +2274,7 @@ DECLHIDDEN(int) 
rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t offSub,
+             set_pte(papPtes[i], mk_pte(pMemLnx->apPages[i], fPg));
+         }
+         preempt_disable();
+-        __flush_tlb_all();
++        rtR0MemObjLinuxFlushTlbAll();
+         preempt_enable();
+         return VINF_SUCCESS;
+     }
+@@ -2311,7 +2320,7 @@ DECLHIDDEN(int) 
rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t offSub,
+             flush_icache_range((uintptr_t)pMemLnx->Core.pv + offSub, cbSub);
+ #  if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) /* 
flush_tlb_kernel_range is not exported, but __flush_tlb_all is. */
+         preempt_disable();
+-        __flush_tlb_all();
++        rtR0MemObjLinuxFlushTlbAll();
+         preempt_enable();
+ #  else
+         flush_tlb_kernel_range((uintptr_t)pMemLnx->Core.pv + offSub, cbSub);
+--- a/vboxsf/r0drv/linux/the-linux-kernel.h
++++ b/vboxsf/r0drv/linux/the-linux-kernel.h
+@@ -512,6 +512,9 @@ RTDECL(struct page *) rtR0MemObjLinuxVirtToPage(void *pv);
+ 
+ 
+ extern struct mm_struct *g_pLnxInitMm;
++#if RTLNX_VER_MIN(6,19,0)
++extern void (*g_pfnLinuxFlushTlbAll)(void);
++#endif
+ 
+ 
+ #endif /* !IPRT_INCLUDED_SRC_r0drv_linux_the_linux_kernel_h */
+--- a/vboxguest/r0drv/linux/the-linux-kernel.h
++++ b/vboxguest/r0drv/linux/the-linux-kernel.h
+@@ -512,6 +512,9 @@ RTDECL(struct page *) rtR0MemObjLinuxVirtToPage(void *pv);
+ 
+ 
+ extern struct mm_struct *g_pLnxInitMm;
++#if RTLNX_VER_MIN(6,19,0)
++extern void (*g_pfnLinuxFlushTlbAll)(void);
++#endif
+ 
+ 
+ #endif /* !IPRT_INCLUDED_SRC_r0drv_linux_the_linux_kernel_h */

diff --git 
a/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.2.6-kernel-6.19-3.patch
 
b/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.2.6-kernel-6.19-3.patch
new file mode 100644
index 000000000000..ddf670fed21e
--- /dev/null
+++ 
b/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.2.6-kernel-6.19-3.patch
@@ -0,0 +1,40 @@
+https://github.com/VirtualBox/virtualbox/commit/33992f0e56b8a9bb565e0beecad91e87362ab390
+
+From 33992f0e56b8a9bb565e0beecad91e87362ab390 Mon Sep 17 00:00:00 2001
+From: Vadim Galitsyn <[email protected]>
+Date: Tue, 17 Feb 2026 15:37:37 +0000
+Subject: [PATCH] Linux host: Introduce initial support for kernel 6.19 (build
+ fix for old kernels),bugref:11038.
+
+svn:sync-xref-src-repo-rev: r172811
+--- a/vboxguest/r0drv/linux/memobj-r0drv-linux.c
++++ b/vboxguest/r0drv/linux/memobj-r0drv-linux.c
+@@ -181,7 +181,6 @@ static const struct
+ *   Internal Functions                                                        
                                                   *
+ 
*********************************************************************************************************************************/
+ static void rtR0MemObjLinuxFreePages(PRTR0MEMOBJLNX pMemLnx);
+-static void rtR0MemObjLinuxFlushTlbAll(void);
+ 
+ 
+ /**
+@@ -2245,15 +2244,17 @@ DECLHIDDEN(int) 
rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ p
+     return rc;
+ }
+ 
++#if defined(IPRT_USE_ALLOC_VM_AREA_FOR_EXEC) || 
defined(IPRT_USE_APPLY_TO_PAGE_RANGE_FOR_EXEC)
+ static void rtR0MemObjLinuxFlushTlbAll(void)
+ {
+-#if RTLNX_VER_MIN(6,19,0)
++# if RTLNX_VER_MIN(6,19,0)
+     if (RT_LIKELY(RT_VALID_PTR(g_pfnLinuxFlushTlbAll)))
+         g_pfnLinuxFlushTlbAll();
+-#else
++# else
+     __flush_tlb_all();
+-#endif
++# endif
+ }
++#endif
+ 
+ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t 
offSub, size_t cbSub, uint32_t fProt)
+ {

diff --git 
a/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.2.6-r1.ebuild
 
b/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.2.6-r1.ebuild
new file mode 100644
index 000000000000..659be84b6acc
--- /dev/null
+++ 
b/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.2.6-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 2022-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# XXX: the tarball here is just the kernel modules split out of the binary
+#      package that comes from VirtualBox-*.run
+# XXX: update: now it is split from virtualbox-*-Debian~bullseye_amd64.deb
+
+EAPI=8
+
+inherit linux-mod-r1
+
+MY_P="vbox-guest-kernel-module-src-${PV^^}"
+DESCRIPTION="Kernel Modules for Virtualbox Guest Additions"
+HOMEPAGE="https://www.virtualbox.org/";
+SRC_URI="https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${MY_P}.tar.xz";
+S="${WORKDIR}"
+
+LICENSE="GPL-3"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-7.2.6-log-use-c99.patch
+       "${FILESDIR}"/${P}-kernel-6.19-{1,3}.patch
+)
+
+CONFIG_CHECK="~DRM_TTM ~DRM_VMWGFX"
+WARNING_DRM_TTM="DRM_TTM is needed for running the vboxvideo driver."
+WARNING_DRM_VMWGFX="DRM_VMWGFX is the recommended driver for VMSVGA."
+
+src_compile() {
+       local modlist=( {vboxguest,vboxsf}=misc )
+       local modargs=( KERN_DIR="${KV_OUT_DIR}" KERN_VER="${KV_FULL}" )
+       linux-mod-r1_src_compile
+}
+
+src_install() {
+       linux-mod-r1_src_install
+
+       insinto /etc/modprobe.d # 485996
+       newins - vboxsf.conf <<-EOF
+               # modprobe.d configuration file for VBOXSF
+
+               # Internal Aliases - Do not edit
+               # ------------------------------
+               alias fs-vboxsf vboxsf
+       EOF
+}

Reply via email to