summaryrefslogtreecommitdiff
path: root/app-emulation/virtualbox-modules/files/virtualbox-modules-7.1.8-kernel-6.15.patch
blob: 5f1140df9d625d70e4467abeb67524effe4edb0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Add initial support for kernel 6.15.0.
Patch obtained by comparing sources from 7.1.8 and 7.2.0_BETA1 where upstream added support.
https://bugs.gentoo.org/956675

--- a/vboxdrv/Makefile-footer.gmk
+++ b/vboxdrv/Makefile-footer.gmk
@@ -115,6 +115,7 @@ VBOXMOD_EXT := ko
 
 # build defs
 EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG)
+ccflags-y += $(EXTRA_CFLAGS)
 $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS)
 obj-m += $(VBOXMOD_0_TARGET).o
 
--- a/vboxdrv/r0drv/linux/timer-r0drv-linux.c
+++ b/vboxdrv/r0drv/linux/timer-r0drv-linux.c
@@ -422,7 +422,11 @@ static void rtTimerLnxStopSubTimer(PRTTIMERLNXSUBTIMER pSubTimer, bool fHighRes)
     }
     else
 #endif
+# if RTLNX_VER_MIN(6,15,0)
+        timer_delete(&pSubTimer->u.Std.LnxTimer);
+#else
         del_timer(&pSubTimer->u.Std.LnxTimer);
+#endif
 
     rtTimerLnxSetState(&pSubTimer->enmState, RTTIMERLNXSTATE_STOPPED);
 }
@@ -470,7 +474,11 @@ static void rtTimerLnxDestroyIt(PRTTIMER pTimer)
             hrtimer_cancel(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer);
         else
 #endif
+# if RTLNX_VER_MIN(6,15,0)
+            timer_delete_sync(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
+#else
             del_timer_sync(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
+#endif
     }
 
     /*
@@ -1626,8 +1634,13 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_
 #ifdef RTTIMER_LINUX_WITH_HRTIMER
         if (pTimer->fHighRes)
         {
+#if RTLNX_VER_MIN(6,15,0)
+            hrtimer_setup(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer,
+                          rtTimerLinuxHrCallback, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
+#else
             hrtimer_init(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
             pTimer->aSubTimers[iCpu].u.Hr.LnxTimer.function     = rtTimerLinuxHrCallback;
+#endif
         }
         else
 #endif
--- a/vboxnetadp/Makefile-footer.gmk
+++ b/vboxnetadp/Makefile-footer.gmk
@@ -115,6 +115,7 @@ VBOXMOD_EXT := ko
 
 # build defs
 EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG)
+ccflags-y += $(EXTRA_CFLAGS)
 $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS)
 obj-m += $(VBOXMOD_0_TARGET).o
 
--- a/vboxnetflt/Makefile-footer.gmk
+++ b/vboxnetflt/Makefile-footer.gmk
@@ -115,6 +115,7 @@ VBOXMOD_EXT := ko
 
 # build defs
 EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG)
+ccflags-y += $(EXTRA_CFLAGS)
 $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS)
 obj-m += $(VBOXMOD_0_TARGET).o
 
--- a/vboxdrv/linux/SUPDrv-linux.c
+++ b/vboxdrv/linux/SUPDrv-linux.c
@@ -1744,10 +1744,17 @@ SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook)
      */
     Assert(fCtxHook || !RTThreadPreemptIsEnabled(NIL_RTTHREAD));
     kernel_fpu_begin();
-# if 0 /* Always do it for now for better test coverage. */
+#  if RTLNX_VER_MIN(6,15,0) /* fpregs_unlock may do more than just preempt_enable, so only when necessary now. */
     if (fCtxHook)
-# endif
+#  endif
+    {
+#  if RTLNX_VER_MIN(6,15,0)
+        if (!irqs_disabled())
+            fpregs_unlock();
+#  else
         preempt_enable();
+#  endif
+    }
     return false; /** @todo Not sure if we have license to use any extended state, or
                    *        if we're limited to the SSE & x87 FPU. If it's the former,
                    *        we should return @a true and the caller can skip
@@ -1765,10 +1772,17 @@ SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook)
 #if RTLNX_VER_MIN(4,19,0)
     /* HACK ALERT! See SUPR0FpuBegin for an explanation of this. */
     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
-# if 0 /* Always do it for now for better test coverage. */
+#  if RTLNX_VER_MIN(6,15,0) /* fpregs_unlock may do more than just preempt_enable, so only when necessary now. */
     if (fCtxHook)
-# endif
+#  endif
+    {
+#  if RTLNX_VER_MIN(6,15,0)
+        if (!irqs_disabled())
+            fpregs_lock();
+#  else
         preempt_disable();
+#  endif
+    }
     kernel_fpu_end();
 #endif
 }