commit 8b9f4f1147b718c197d841476effc366859f25e6
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sun Jun 5 06:09:20 2022 +0100
use opensuse patch for kernel 5.18
VirtualBox.spec | 11 +-
ffreestanding.patch | 20 --
...linux-5.18.patch => fixes_for_kernel_5.18.patch | 325 +++++++++++----------
3 files changed, 176 insertions(+), 180 deletions(-)
---
diff --git a/VirtualBox.spec b/VirtualBox.spec
index 61dcac8..a938e0c 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -39,7 +39,7 @@
Name: VirtualBox
Version: 6.1.34
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: A general-purpose full virtualizer for PC hardware
License: GPLv2 or (GPLv2 and CDDL)
@@ -91,13 +91,12 @@ Patch70: vbox-python-selection.patch
Patch71: fixes_for_Qt5.11to15.patch
Patch72: virtualbox-snpritnf-buffer-overflow.patch
Patch73: vb-6.1.16-modal-dialog-parent.patch
+Patch74: fixes_for_kernel_5.18.patch
Patch80: VirtualBox-6.1.4-gcc10.patch
-Patch81: ffreestanding.patch
Patch88: VirtualBox-lzf.patch
Patch90: 0001-libs-xpcom-Added-support-for-running-with-Python-3.1.patch
Patch91: 0002-no_ifndef.patch
-Patch92: vbox-linux-5.18.patch
BuildRequires: gcc-c++
BuildRequires: kBuild >= 0.1.9998.r3093
@@ -344,12 +343,11 @@ rm -r src/libs/zlib-1.2.*/
%patch71 -p1 -b .qt
%patch72 -p1 -b .snpritnf-buffer-overflow
%patch73 -p1 -b .modal-dialog-parent
+%patch74 -p1 -b .linux-5.18
%patch80 -p1 -b .gcc10
-%patch81 -p1 -b .ffreestanding
%patch88 -p1 -b .lzf
%patch90 -p2 -b .python3.10
%patch91 -p1 -b .python3.10
-%patch92 -p0 -b .linux-5.18
%build
@@ -906,6 +904,9 @@ getent passwd vboxadd >/dev/null || \
%{_datadir}/%{name}-kmod-%{version}
%changelog
+* Sat Jun 04 2022 Sérgio Basto <sergio(a)serjux.com> - 6.1.34-4
+- use opensuse patch for kernel 5.18
+
* Tue May 31 2022 Sérgio Basto <sergio(a)serjux.com> - 6.1.34-3
- Initial fix Windows 10 VM crashes with Linux 5.18 kernel
diff --git a/vbox-linux-5.18.patch b/fixes_for_kernel_5.18.patch
similarity index 51%
rename from vbox-linux-5.18.patch
rename to fixes_for_kernel_5.18.patch
index 8e77274..24fe479 100644
--- a/vbox-linux-5.18.patch
+++ b/fixes_for_kernel_5.18.patch
@@ -1,67 +1,30 @@
-Index: include/VBox/sup.h
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
===================================================================
---- include/VBox/sup.h (revision 151556)
-+++ include/VBox/sup.h (working copy)
-@@ -2142,6 +2142,26 @@
- */
- SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void);
-
-+/**
-+ * Notification from R0 VMM prior to loading the guest-FPU register state.
-+ *
-+ * @returns Whether the host-FPU register state has been saved by the host kernel.
-+ * @param fCtxHook Whether thread-context hooks are enabled.
-+ *
-+ * @remarks Called with preemption disabled.
-+ */
-+SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook);
-+
-+/**
-+ * Notification from R0 VMM prior to saving the guest-FPU register state (and
-+ * potentially restoring the host-FPU register state) in ring-0.
-+ *
-+ * @param fCtxHook Whether thread-context hooks are enabled.
-+ *
-+ * @remarks Called with preemption disabled.
-+ */
-+SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook);
-+
- /** @copydoc RTLogGetDefaultInstanceEx
- * @remarks To allow overriding RTLogGetDefaultInstanceEx locally. */
- SUPR0DECL(struct RTLOGGER *) SUPR0GetDefaultLogInstanceEx(uint32_t fFlagsAndGroup);
-Index: src/VBox/Additions/linux/sharedfolders/regops.c
-===================================================================
---- src/VBox/Additions/linux/sharedfolders/regops.c (revision 151556)
-+++ src/VBox/Additions/linux/sharedfolders/regops.c (working copy)
-@@ -3823,7 +3823,9 @@
- .readpage = vbsf_readpage,
- .writepage = vbsf_writepage,
- /** @todo Need .writepages if we want msync performance... */
--#if RTLNX_VER_MIN(2,5,12)
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+@@ -2311,7 +2311,13 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS
+ vboxNetFltDumpPacket(pSG, true, "host", (fDst &
INTNETTRUNKDIR_WIRE) ? 0 : 1);
+ Log6(("vboxNetFltPortOsXmit: pBuf->cb dump:\n%.*Rhxd\n",
sizeof(pBuf->cb), pBuf->cb));
+ Log6(("vboxNetFltPortOsXmit: netif_rx_ni(%p)\n", pBuf));
+#if RTLNX_VER_MIN(5,18,0)
-+ .dirty_folio = filemap_dirty_folio,
-+#elif RTLNX_VER_MIN(2,5,12)
- .set_page_dirty = __set_page_dirty_buffers,
- #endif
- #if RTLNX_VER_MIN(5,14,0)
-Index: src/VBox/Additions
-===================================================================
---- src/VBox/Additions (revision 151556)
-+++ src/VBox/Additions (working copy)
-
-Property changes on: src/VBox/Additions
-___________________________________________________________________
-Modified: svn:mergeinfo
-## -0,0 +0,1 ##
- Merged /trunk/src/VBox/Additions:r150844
-Index: src/VBox/HostDrivers/Support/SUPDrv.cpp
++ local_bh_disable();
++ err = netif_rx(pBuf);
++ local_bh_enable();
++#else
+ err = netif_rx_ni(pBuf);
++#endif
+ if (err)
+ rc = RTErrConvertFromErrno(err);
+ }
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/SUPDrv.cpp
===================================================================
---- src/VBox/HostDrivers/Support/SUPDrv.cpp (revision 151556)
-+++ src/VBox/HostDrivers/Support/SUPDrv.cpp (working copy)
-@@ -98,6 +98,18 @@
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/SUPDrv.cpp
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/SUPDrv.cpp
+@@ -98,7 +98,18 @@
# endif
#endif
+-
+#if defined(RT_OS_LINUX) && !defined(__NO_FORTIFY) &&
defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE)
+/* In Linux 5.18-rc1, memcpy became a wrapper which does fortify checks
+ * before triggering __underlying_memcpy() call. We do not pass these checks here,
@@ -74,32 +37,133 @@ Index: src/VBox/HostDrivers/Support/SUPDrv.cpp
+#else
+# define SUPDRV_MEMCPY memcpy
+#endif
-
/*
* Logging assignments:
-@@ -266,6 +278,8 @@
- SUPEXP_STK_BACK( 2, SUPR0ContFree),
+ * Log - useful stuff, like failures.
+@@ -267,6 +278,8 @@ static SUPFUNC g_aFunctions[] =
SUPEXP_STK_BACK( 2, SUPR0ChangeCR4),
SUPEXP_STK_BACK( 1, SUPR0EnableVTx),
+ SUPEXP_STK_BACK( 0, SUPR0SuspendVTxOnCpu),
+ SUPEXP_STK_OKAY( 1, SUPR0FpuBegin),
+ SUPEXP_STK_OKAY( 1, SUPR0FpuEnd),
- SUPEXP_STK_BACK( 0, SUPR0SuspendVTxOnCpu),
SUPEXP_STK_BACK( 1, SUPR0ResumeVTxOnCpu),
SUPEXP_STK_OKAY( 1, SUPR0GetCurrentGdtRw),
-@@ -1742,7 +1756,7 @@
+ SUPEXP_STK_OKAY( 0, SUPR0GetKernelFeatures),
+@@ -1742,7 +1755,7 @@ static int supdrvIOCtlInnerUnrestricted(
/* execute */
pReq->u.Out.cFunctions = RT_ELEMENTS(g_aFunctions);
- memcpy(&pReq->u.Out.aFunctions[0], g_aFunctions,
sizeof(g_aFunctions));
-+ SUPDRV_MEMCPY(&pReq->u.Out.aFunctions[0], g_aFunctions,
sizeof(g_aFunctions));
++ SUPDRV_MEMCPY(&pReq->u.Out.aFunctions[0], g_aFunctions,
sizeof(g_aFunctions));
pReq->Hdr.rc = VINF_SUCCESS;
return 0;
}
-Index: src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/SUPLib.cpp
+===================================================================
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/SUPLib.cpp
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/SUPLib.cpp
+@@ -505,7 +505,7 @@ static int supInitFake(PSUPDRVSESSION *p
+ if (g_pSupFunctions)
+ {
+ g_pSupFunctions->u.Out.cFunctions = RT_ELEMENTS(s_aFakeFunctions);
+- memcpy(&g_pSupFunctions->u.Out.aFunctions[0], &s_aFakeFunctions[0],
sizeof(s_aFakeFunctions));
++ memcpy(&g_pSupFunctions->u.Out.aFunctions, &s_aFakeFunctions[0],
sizeof(s_aFakeFunctions));
+ g_pSession = (PSUPDRVSESSION)(void *)g_pSupFunctions;
+ if (ppSession)
+ *ppSession = g_pSession;
+Index: VirtualBox-6.1.34/src/VBox/Additions/linux/sharedfolders/regops.c
+===================================================================
+--- VirtualBox-6.1.34.orig/src/VBox/Additions/linux/sharedfolders/regops.c
++++ VirtualBox-6.1.34/src/VBox/Additions/linux/sharedfolders/regops.c
+@@ -3823,7 +3823,9 @@ struct address_space_operations vbsf_reg
+ .readpage = vbsf_readpage,
+ .writepage = vbsf_writepage,
+ /** @todo Need .writepages if we want msync performance... */
+-#if RTLNX_VER_MIN(2,5,12)
++#if RTLNX_VER_MIN(5,18,0)
++ .dirty_folio = block_dirty_folio,
++#elif RTLNX_VER_MIN(2,5,12)
+ .set_page_dirty = __set_page_dirty_buffers,
+ #endif
+ #if RTLNX_VER_MIN(5,14,0)
+Index: VirtualBox-6.1.34/Config.kmk
+===================================================================
+--- VirtualBox-6.1.34.orig/Config.kmk
++++ VirtualBox-6.1.34/Config.kmk
+@@ -4502,11 +4502,14 @@ ifeq ($(VBOX_LDR_FMT),elf)
+ TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL)
+ TEMPLATE_VBoxR0_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe)
$(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) \
+ $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP)
-fno-strict-aliasing -fno-exceptions \
+- $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99
$(VBOX_GCC_IPRT_FMT_CHECK)
++ $(VBOX_GCC_fno-stack-protector) -fno-common -ffreestanding
$(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
+ TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe)
$(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) \
+ $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP)
-fno-strict-aliasing -fno-exceptions \
+ $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden)
$(VBOX_GCC_fvisibility-hidden) \
+ -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
++ if $(VBOX_GCC_VERSION_CC) >= 40500 # 4.1.2 complains, 4.5.2 is okay, didn't
check which version inbetween made it okay with g++.
++ TEMPLATE_VBoxR0_CXXFLAGS += -ffreestanding
++ endif
+ TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2
-mno-3dnow -fasynchronous-unwind-tables -ffreestanding
+ TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2
-mno-3dnow -fasynchronous-unwind-tables
+ TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -ffreestanding
+Index: VirtualBox-6.1.34/include/VBox/sup.h
+===================================================================
+--- VirtualBox-6.1.34.orig/include/VBox/sup.h
++++ VirtualBox-6.1.34/include/VBox/sup.h
+@@ -2142,7 +2142,25 @@ RT_IPRT_FORMAT_ATTR(1, 2) SUPR0Printf(co
+ */
+ SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void);
+
+-/** @copydoc RTLogGetDefaultInstanceEx
++/**
++ * Notification from R0 VMM prior to loading the guest-FPU register state.
++ *
++ * @returns Whether the host-FPU register state has been saved by the host kernel.
++ * @param fCtxHook Whether thread-context hooks are enabled.
++ *
++ * @remarks Called with preemption disabled.
++ */
++SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook);
++
++/**
++ * Notification from R0 VMM prior to saving the guest-FPU register state (and
++ * potentially restoring the host-FPU register state) in ring-0.
++ *
++ * @param fCtxHook Whether thread-context hooks are enabled.
++ *
++ * @remarks Called with preemption disabled.
++ */
++SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook); /** @copydoc RTLogGetDefaultInstanceEx
+ * @remarks To allow overriding RTLogGetDefaultInstanceEx locally. */
+ SUPR0DECL(struct RTLOGGER *) SUPR0GetDefaultLogInstanceEx(uint32_t fFlagsAndGroup);
+ /** @copydoc RTLogRelGetDefaultInstanceEx
+Index: VirtualBox-6.1.34/src/VBox/VMM/VMMR0/CPUMR0.cpp
+===================================================================
+--- VirtualBox-6.1.34.orig/src/VBox/VMM/VMMR0/CPUMR0.cpp
++++ VirtualBox-6.1.34/src/VBox/VMM/VMMR0/CPUMR0.cpp
+@@ -440,6 +440,8 @@ VMMR0_INT_DECL(int) CPUMR0LoadGuestFPU(P
+ Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST));
+ Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE));
+
++ /* Notify the support driver prior to loading the guest-FPU register state. */
++ SUPR0FpuBegin(false /* unused */);
+ if (!pVM->cpum.s.HostFeatures.fLeakyFxSR)
+ {
+ Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE));
+@@ -485,6 +487,8 @@ VMMR0_INT_DECL(bool) CPUMR0FpuStateMaybe
+ if (pVCpu->cpum.s.fUseFlags & (CPUM_USED_FPU_GUEST | CPUM_USED_FPU_HOST))
+ {
+ fSavedGuest = RT_BOOL(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST);
++ /* Notify the support driver prior to loading the host-FPU register state. */
++ SUPR0FpuEnd(false /* unused */);
+ if (!(pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE))
+ cpumR0SaveGuestRestoreHostFPUState(&pVCpu->cpum.s);
+ else
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
===================================================================
---- src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp (revision 151556)
-+++ src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp (working copy)
-@@ -2002,6 +2002,18 @@
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
+@@ -2002,6 +2002,17 @@ SUPR0DECL(uint32_t) SUPR0GetKernelFeatur
}
@@ -114,19 +178,17 @@ Index: src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
+{
+ RT_NOREF(fCtxHook);
+}
-+
/*
*
* org_virtualbox_SupDrv
-Index: src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
===================================================================
---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c (revision 151556)
-+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c (working copy)
-@@ -640,3 +640,16 @@
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
+@@ -640,3 +640,15 @@ SUPR0DECL(uint32_t) SUPR0GetKernelFeatur
return 0;
}
-+
+SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
@@ -139,72 +201,55 @@ Index: src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
+ RT_NOREF(fCtxHook);
+}
+
-Index: src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
===================================================================
---- src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c (revision 151556)
-+++ src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c (working copy)
-@@ -1454,6 +1454,31 @@
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
+@@ -541,3 +541,15 @@ SUPR0DECL(uint32_t) SUPR0GetKernelFeatur
+ return 0;
}
-
+SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
-+#if RTLNX_VER_MIN(5,18,0)
-+ kernel_fpu_begin();
-+ /* if (fCtxHook) */
-+ preempt_enable(); /* HACK ALERT! undo the implicit preempt_disable() in
kernel_fpu_begin(). */
-+ return true;
-+#else
+ return false;
-+#endif
+}
+
+
+SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
-+#if RTLNX_VER_MIN(5,18,0)
-+ /* if (fCtxHook) */
-+ preempt_disable(); /* HACK ALERT! undo the implicit preempt_enable() in
SUPR0FpuBegin(). */
-+ kernel_fpu_end();
-+#endif
+}
+
-+
- int VBOXCALL supdrvOSGetCurrentGdtRw(RTHCUINTPTR *pGdtRw)
- {
- #if RTLNX_VER_MIN(4,12,0)
-Index: src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
===================================================================
---- src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp (revision 151556)
-+++ src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp (working copy)
-@@ -541,3 +541,16 @@
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
+@@ -2703,6 +2703,16 @@ SUPR0DECL(uint32_t) SUPR0GetKernelFeatur
return 0;
}
-+
+SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
+ return false;
+}
+
-+
+SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
+}
-+
-Index: src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
+
+ SUPR0DECL(int) SUPR0IoCtlSetupForHandle(PSUPDRVSESSION pSession, intptr_t hHandle,
uint32_t fFlags, PSUPR0IOCTLCTX *ppCtx)
+ {
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
===================================================================
---- src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c (revision 151556)
-+++ src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c (working copy)
-@@ -1309,3 +1309,16 @@
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
+@@ -1309,3 +1309,15 @@ SUPR0DECL(uint32_t) SUPR0GetKernelFeatur
return 0;
}
-+
+SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
@@ -217,69 +262,39 @@ Index: src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
+ RT_NOREF(fCtxHook);
+}
+
-Index: src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
+Index: VirtualBox-6.1.34/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
===================================================================
---- src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp (revision 151556)
-+++ src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp (working copy)
-@@ -2704,6 +2704,19 @@
+--- VirtualBox-6.1.34.orig/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
++++ VirtualBox-6.1.34/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
+@@ -1454,6 +1454,31 @@ SUPR0DECL(uint32_t) SUPR0GetKernelFeatur
}
+SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
++#if RTLNX_VER_MIN(5,18,0)
++ kernel_fpu_begin();
++ /* if (fCtxHook) */
++ preempt_enable(); /* HACK ALERT! undo the implicit preempt_disable() in
kernel_fpu_begin(). */
++ return true;
++#else
+ return false;
++#endif
+}
+
+
+SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook)
+{
+ RT_NOREF(fCtxHook);
-+}
-+
-+
- SUPR0DECL(int) SUPR0IoCtlSetupForHandle(PSUPDRVSESSION pSession, intptr_t hHandle,
uint32_t fFlags, PSUPR0IOCTLCTX *ppCtx)
- {
- /*
-Index: src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
-===================================================================
---- src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c (revision 151556)
-+++ src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c (working copy)
-@@ -2311,7 +2311,13 @@
- vboxNetFltDumpPacket(pSG, true, "host", (fDst &
INTNETTRUNKDIR_WIRE) ? 0 : 1);
- Log6(("vboxNetFltPortOsXmit: pBuf->cb dump:\n%.*Rhxd\n",
sizeof(pBuf->cb), pBuf->cb));
- Log6(("vboxNetFltPortOsXmit: netif_rx_ni(%p)\n", pBuf));
+#if RTLNX_VER_MIN(5,18,0)
-+ local_bh_disable();
-+ err = netif_rx(pBuf);
-+ local_bh_enable();
-+#else
- err = netif_rx_ni(pBuf);
++ /* if (fCtxHook) */
++ preempt_disable(); /* HACK ALERT! undo the implicit preempt_enable() in
SUPR0FpuBegin(). */
++ kernel_fpu_end();
+#endif
- if (err)
- rc = RTErrConvertFromErrno(err);
- }
-Index: src/VBox/VMM/VMMR0/CPUMR0.cpp
-===================================================================
---- src/VBox/VMM/VMMR0/CPUMR0.cpp (revision 151556)
-+++ src/VBox/VMM/VMMR0/CPUMR0.cpp (working copy)
-@@ -440,6 +440,9 @@
- Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST));
- Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE));
-
-+ /* Notify the support driver prior to loading the guest-FPU register state. */
-+ SUPR0FpuBegin(false /* unused */);
++}
+
- if (!pVM->cpum.s.HostFeatures.fLeakyFxSR)
- {
- Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE));
-@@ -484,6 +487,9 @@
- Assert(ASMGetCR4() & X86_CR4_OSFXSR);
- if (pVCpu->cpum.s.fUseFlags & (CPUM_USED_FPU_GUEST | CPUM_USED_FPU_HOST))
- {
-+ /* Notify the support driver prior to loading the host-FPU register state. */
-+ SUPR0FpuEnd(false /* unused */);
+
- fSavedGuest = RT_BOOL(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST);
- if (!(pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE))
- cpumR0SaveGuestRestoreHostFPUState(&pVCpu->cpum.s);
+ int VBOXCALL supdrvOSGetCurrentGdtRw(RTHCUINTPTR *pGdtRw)
+ {
+ #if RTLNX_VER_MIN(4,12,0)