Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/virtualbox-modules/files/, app-emulation/virtualbox-modules/
Date: Tue, 24 Sep 2019 19:56:21
Message-Id: 1569354962.c6d0023b9e4aaab23038adb446310c74df4ebc45.whissi@gentoo
1 commit: c6d0023b9e4aaab23038adb446310c74df4ebc45
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 24 19:31:13 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 24 19:56:02 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6d0023b
7
8 app-emulation/virtualbox-modules: add linux-5.3+ compatibility
9
10 Closes: https://bugs.gentoo.org/694560
11 Package-Manager: Portage-2.3.76, Repoman-2.3.17
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 ...x-modules-6.0.12-linux-5.3+-compatibility.patch | 76 ++++++++++++++++++++++
15 .../virtualbox-modules-6.0.12.ebuild | 2 +
16 2 files changed, 78 insertions(+)
17
18 diff --git a/app-emulation/virtualbox-modules/files/virtualbox-modules-6.0.12-linux-5.3+-compatibility.patch b/app-emulation/virtualbox-modules/files/virtualbox-modules-6.0.12-linux-5.3+-compatibility.patch
19 new file mode 100644
20 index 00000000000..ff573dd69b6
21 --- /dev/null
22 +++ b/app-emulation/virtualbox-modules/files/virtualbox-modules-6.0.12-linux-5.3+-compatibility.patch
23 @@ -0,0 +1,76 @@
24 +https://bugs.gentoo.org/694560
25 +
26 +https://www.virtualbox.org/ticket/18911#comment:5
27 +
28 +--- a/vboxnetflt//linux/VBoxNetFlt-linux.c
29 ++++ b/vboxnetflt//linux/VBoxNetFlt-linux.c
30 +@@ -2123,7 +2123,9 @@ static int vboxNetFltLinuxEnumeratorCallback(struct notifier_block *self, unsign
31 + #endif
32 + if (in_dev != NULL)
33 + {
34 +- for_ifa(in_dev) {
35 ++ struct in_ifaddr *ifa;
36 ++
37 ++ for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
38 + if (VBOX_IPV4_IS_LOOPBACK(ifa->ifa_address))
39 + return NOTIFY_OK;
40 +
41 +@@ -2137,7 +2139,7 @@ static int vboxNetFltLinuxEnumeratorCallback(struct notifier_block *self, unsign
42 +
43 + pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort,
44 + /* :fAdded */ true, kIntNetAddrType_IPv4, &ifa->ifa_address);
45 +- } endfor_ifa(in_dev);
46 ++ }
47 + }
48 +
49 + /*
50 +--- a/vboxdrv/r0drv/linux/mp-r0drv-linux.c
51 ++++ b/vboxdrv/r0drv/linux/mp-r0drv-linux.c
52 +@@ -283,12 +283,15 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
53 + if (RTCpuSetCount(&OnlineSet) > 1)
54 + {
55 + /* Fire the function on all other CPUs without waiting for completion. */
56 +-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
57 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
58 ++ smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
59 ++# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
60 + int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
61 ++ Assert(!rc); NOREF(rc);
62 + # else
63 + int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* retry */, 0 /* wait */);
64 +-# endif
65 + Assert(!rc); NOREF(rc);
66 ++# endif
67 + }
68 + #endif
69 +
70 +@@ -326,7 +329,6 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
71 + {
72 + #ifdef CONFIG_SMP
73 + IPRT_LINUX_SAVE_EFL_AC();
74 +- int rc;
75 + RTMPARGS Args;
76 +
77 + RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;
78 +@@ -337,14 +339,17 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
79 + Args.cHits = 0;
80 +
81 + RTThreadPreemptDisable(&PreemptState);
82 +-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
83 +- rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
84 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
85 ++ smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
86 ++# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
87 ++ int rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
88 ++ Assert(rc == 0); NOREF(rc);
89 + # else /* older kernels */
90 +- rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
91 ++ int rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
92 ++ Assert(rc == 0); NOREF(rc);
93 + # endif /* older kernels */
94 + RTThreadPreemptRestore(&PreemptState);
95 +
96 +- Assert(rc == 0); NOREF(rc);
97 + IPRT_LINUX_RESTORE_EFL_AC();
98 + #else
99 + RT_NOREF(pfnWorker, pvUser1, pvUser2);
100
101 diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-6.0.12.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-6.0.12.ebuild
102 index 7257cb3b581..90528f50249 100644
103 --- a/app-emulation/virtualbox-modules/virtualbox-modules-6.0.12.ebuild
104 +++ b/app-emulation/virtualbox-modules/virtualbox-modules-6.0.12.ebuild
105 @@ -21,6 +21,8 @@ IUSE="pax_kernel"
106
107 RDEPEND="!=app-emulation/virtualbox-9999"
108
109 +PATCHES=( "${FILESDIR}"/${PN}-6.0.12-linux-5.3+-compatibility.patch )
110 +
111 S="${WORKDIR}"
112
113 BUILD_TARGETS="all"