1 On 7/23/19 5:33 PM, S?rgio Basto wrote:
4 > https://forums.virtualbox.org/viewtopic.php?f=3&t=93944
6 > have someone the solution ?
8 Yes, I do. The MIT-licensed patch is posted below. After I finish here, I will
9 also post this material on the VBox forum.
11 The API changes are as follows:
13 1. The for_ifa() and endfor_ifa() macros are removed. They are so simple that it
14 is better to turn then into in-line code.
16 2. Routine smp_call_function() is changed from type int to void.
20 Index: VirtualBox-6.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
21 ===================================================================
22 --- VirtualBox-6.0.10.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
23 +++ VirtualBox-6.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
24 @@ -2123,7 +2123,10 @@ static int vboxNetFltLinuxEnumeratorCall
29 + /* macros for_ifa() and endfor_ifa() disappear for kernel 5.3
30 + * Code them directly */
31 + struct in_ifaddr *ifa;
32 + for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
33 if (VBOX_IPV4_IS_LOOPBACK(ifa->ifa_address))
36 @@ -2137,7 +2140,7 @@ static int vboxNetFltLinuxEnumeratorCall
38 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort,
39 /* :fAdded */ true, kIntNetAddrType_IPv4, &ifa->ifa_address);
40 - } endfor_ifa(in_dev);
45 Index: VirtualBox-6.0.10/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
46 ===================================================================
47 --- VirtualBox-6.0.10.orig/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
48 +++ VirtualBox-6.0.10/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
49 @@ -283,12 +283,16 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnW
50 if (RTCpuSetCount(&OnlineSet) > 1)
52 /* Fire the function on all other CPUs without waiting for completion. */
53 -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
54 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
55 + smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
56 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
57 int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
60 int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* retry */, 0 /* wait */);
63 +# if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
64 Assert(!rc); NOREF(rc);
69 @@ -326,7 +330,9 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER p
72 IPRT_LINUX_SAVE_EFL_AC();
73 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
78 RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;
79 @@ -337,14 +343,18 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER p
82 RTThreadPreemptDisable(&PreemptState);
83 -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
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 rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
88 -# else /* older kernels */
89 +#else /* older kernels */
90 rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
91 -# endif /* older kernels */
92 +#endif /* older kernels */
93 RTThreadPreemptRestore(&PreemptState);
95 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
96 Assert(rc == 0); NOREF(rc);
98 IPRT_LINUX_RESTORE_EFL_AC();
100 RT_NOREF(pfnWorker, pvUser1, pvUser2);