Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Discussions about using Linux guests in VirtualBox.
Post Reply
nixuser
Posts: 32
Joined: 12. Dec 2018, 04:56

Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by nixuser »

I am unable to build the guest additions 6.0.10 against Fedora Rawhide latest kernel 5.3.0-0.rc0.git4.1.fc31.x86_64.

The beginning of the log seems to imply /generated/autoconf.h or include/config/auto.conf are missing but in fact they are there.

Near the end there are some compilations issues.
Attachments
vboxadd-setup.log
Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64
(44.9 KiB) Downloaded 55 times
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by socratis »

nixuser wrote:kernel 5.3.0-0.rc0.git4.1.fc31.x86_64
That's a really brand new kernel, isn't it? I haven't seen any patches coming in for the 5.3.0 series, only the 5.2.0 ones. You might have to see if the following function definition has changed in the newer kernels:
/tmp/vbox.0/r0drv/linux/mp-r0drv-linux.c:287:18: error: void value not ignored as it ought to be
  287 |         int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
      |                  ^~~~~~~~~~~~~~~~~
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
nixuser
Posts: 32
Joined: 12. Dec 2018, 04:56

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by nixuser »

Yes it is ultra new, and a release candidate, not even a released one, which is why I am posing here rather than filing a bug report, since it isn't a "bug" when it's a kernel nobody has seen before.

It does look like another change in the API like we had with 5.2.0 so in time the developers will have to make changes to cater for it. It will be a while before it finds its way into the Fedora release stream, a few weeks at least.
Koisell
Posts: 2
Joined: 23. Jul 2019, 19:37

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by Koisell »

I have the same issue with Kernel 5.3.0-0.rc1.git0.1.fc31.x86_64

Do you guys have a workaround ?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by socratis »

Koisell wrote:Do you guys have a workaround ?
Wait for update VirtualBox versions. If you want to use the latest version for your host/guests, you should also consider doing the same for VirtualBox. You should try the latest test builds and keep on trying until this is resolved. You can't be expecting changes in the kernel API to be taken under account before the changes were actually implemented.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
lwfinger
Posts: 6
Joined: 30. Jun 2015, 04:03

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by lwfinger »

The fixes are as follows:

Code: Select all

Index: VirtualBox-6.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
===================================================================
--- VirtualBox-6.0.10.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ VirtualBox-6.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -2123,7 +2123,10 @@ static int vboxNetFltLinuxEnumeratorCall
 #endif
     if (in_dev != NULL)
     {
-        for_ifa(in_dev) {
+       /* macros for_ifa() and endfor_ifs() disappear for kernel 5.3
+        * Code them directly */
+        struct in_ifaddr *ifa;
+       for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
             if (VBOX_IPV4_IS_LOOPBACK(ifa->ifa_address))
                 return NOTIFY_OK;
 
@@ -2137,7 +2140,7 @@ static int vboxNetFltLinuxEnumeratorCall
 
             pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort,
                 /* :fAdded */ true, kIntNetAddrType_IPv4, &ifa->ifa_address);
-        } endfor_ifa(in_dev);
+        }
     }
 
     /*
Index: VirtualBox-6.0.10/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
===================================================================
--- VirtualBox-6.0.10.orig/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
+++ VirtualBox-6.0.10/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
@@ -283,12 +283,16 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnW
     if (RTCpuSetCount(&OnlineSet) > 1)
     {
         /* Fire the function on all other CPUs without waiting for completion. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
+       smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
         int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
-# else
+#else
         int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* retry */, 0 /* wait */);
-# endif
+#endif
+# if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
         Assert(!rc); NOREF(rc);
+#endif
     }
 #endif
 
@@ -326,7 +330,9 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER p
 {
 #ifdef CONFIG_SMP
     IPRT_LINUX_SAVE_EFL_AC();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
     int rc;
+#endif
     RTMPARGS Args;
 
     RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;
@@ -337,14 +343,18 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER p
     Args.cHits = 0;
 
     RTThreadPreemptDisable(&PreemptState);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
+    smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
-# else /* older kernels */
+#else /* older kernels */
     rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
-# endif /* older kernels */
+#endif /* older kernels */
     RTThreadPreemptRestore(&PreemptState);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
     Assert(rc == 0); NOREF(rc);
+#endif
     IPRT_LINUX_RESTORE_EFL_AC();
 #else
     RT_NOREF(pfnWorker, pvUser1, pvUser2);
Koisell
Posts: 2
Joined: 23. Jul 2019, 19:37

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by Koisell »

Thanks lwfinder.
You can't be expecting changes in the kernel API to be taken under account before the changes were actually implemented.
socratis I'm aware the risks I take using an edgy kernel :wink: Sorry if you misunderstand it with a criticism I should have been more clear.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by socratis »

Koisell wrote:Sorry if you misunderstand it with a criticism I should have been more clear
Oh no, no, no, not at all! I was simply stating the facts, it's a canned copy/paste answer! :D

Specifically for 5.3.0, until a post in the mailing list this morning, there was not a peep about 5.3.0. I take it that the next VirtualBox release will include the fix... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
zioalex
Posts: 1
Joined: 1. Oct 2019, 13:12

Re: Guest Additions 6.0.10 build fail against Rawhide 5.3.0-0.rc0.git4.1.fc31.x86_64

Post by zioalex »

Thanks lwfinger!
I adapted the patch for my environment as compiled successfully.
Do you know if this is tracked in any bug?

Would be nice to be aware when this will be available upstream.

In attachment the adapted patch. I run it like:

Code: Select all

cd /usr/share/virtualbox/src/vboxhost
patch -p0 < ubuntu_virtualbox_patch.diff
Cheers
Attachments
ubuntu_virtualbox_patch.diff
Virtualbox module patch with kernel 5.3
(2.88 KiB) Downloaded 231 times
Post Reply