VirtualBox

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#19312 closed defect (fixed)

Linux: kernel 5.6 - we need changes (fixed in 6.1.6, 6.0.20 and 5.2.40)

Reported by: Frank Batschulat (Oracle) Owned by: Frank Batschulat (Oracle)
Component: other Version: VirtualBox 6.1.2
Keywords: linux 5.6 kernel Cc:
Guest type: Linux Host type: Linux

Description (last modified by Frank Batschulat (Oracle))

So mainline 5.6-rc1 is out and we have already 1 change required:

In file included from /home/ws/vbtrunk/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/combined-os-specific.c:33:0:
/home/ws/vbtrunk/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeMapKernel’:
/home/ws/vbtrunk/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/memobj-r0drv-linux.c:1465:32: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
                              ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
                                ^~~~~~~~~~~~~~~
                                ioremap_cache
/home/ws/vbtrunk/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/memobj-r0drv-linux.c:1466:30: error: pointer/integer type mismatch in conditional expression [-Werror]
                              : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);

                              ^

This is due to:

https://github.com/torvalds/linux/commit/4bdc0d676a643140bdf17dbf7eafedee3d496a3c
https://github.com/torvalds/linux/tree/master/drivers/usb/early

ioremap has provided non-cached semantics by default
since the Linux 2.6 days, so remove the additional
ioremap_nocache interface.

Merging generic-ioremap/for-next (4bdc0d676a64 remove ioremap_nocache and devm_ioremap_nocache)

https://www.spinics.net/lists/netdev/msg623588.html
https://lkml.org/lkml/2020/2/4/275

obvious fix:
=> replace use of ioremap_nocache() with ioremap_cache()

Edit:

ioremap_cache() is uncached by default since a long time.

all 5.X kernels down to version 5.0 all 4.X kernels down to version 4.0 all 3.X kernels down to version 3.0

from version 2.6.25 onwards we know for sure that ioremap_cache() has uncached semantics by default.

https://elixir.bootlin.com/linux/v2.6.25/source/include/asm-x86/io_64.h#L161

 * This one maps high address device memory and turns off caching for that area.
 * it's useful if some control registers are in such an area and write combining
 * or read caching is not desirable:
 */
extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);

/*
 * The default ioremap() behavior is non-cached:
 */
static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
{
	return ioremap_nocache(offset, size);
}

That means we can and should replace ioremap_nocache() usage with ioremap_cache() and make kernel version 2.6.25 the tipping point for this.

Attachments (6)

fixes_for_5.6.patch (2.0 KB ) - added by Larry998 5 years ago.
This patch file will fix that problem.
vbox-setup.log (83.9 KB ) - added by Jags 5 years ago.
vbox-setup.log | Building module fails for kernel 5.6 RC4; VirtualBox-6.1.97-136310-Linux_amd64.run on Ubuntu MATE 20.04 64bit
timet.patch (5.5 KB ) - added by s.zharkoff 5 years ago.
The patch is working for 5.6-rc3+, but will break older versions :(
vbox-setup_kernel_5.6_rc5.log (83.9 KB ) - added by Jags 5 years ago.
vbox-setup_kernel_5.6_rc5.log | Building module fails for kernel 5.6 RC5; VirtualBox-6.1.97-136423-Linux_amd64 on Ubuntu MATE 20.04 64bit
VboxError.png (13.4 KB ) - added by dinosaur0 5 years ago.
Error with v6.0 test build implementing Linux 5.6 modules fixes
vbox-5.2.39_ann.png (36.5 KB ) - added by David C Rankin 5 years ago.
Unusual CPU Load on extended idle

Download all attachments as: .zip

Change History (36)

comment:1 by Frank Batschulat (Oracle), 5 years ago

Guest type: otherLinux
Host type: otherLinux
Owner: set to Frank Batschulat (Oracle)
Status: newassigned

comment:2 by Frank Batschulat (Oracle), 5 years ago

C symbol: ioremap_nocache
  File                 Function                  Line
0 VBoxPci-linux.c      vboxPciOsDevMapRegion      846 RTR0PTR R0PtrMapping = ioremap_nocache(pci_resource_start(pPciDev, iRegion),
1 memobj-r0drv-linux.c rtR0MemObjNativeMapKernel 1465 ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)

Could not find the C symbol: devm_ioremap_nocache

Edit: the diffs for that particular issue are:

$ svn diff
Index: src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
===================================================================
--- src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c	(revision 136356)
+++ src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c	(working copy)
@@ -842,8 +842,11 @@
         rcLnx = pci_request_region(pPciDev, iRegion, "vboxpci");
         if (!rcLnx)
         {
-            /* For now no caching, try to optimize later. */
-            RTR0PTR R0PtrMapping = ioremap_nocache(pci_resource_start(pPciDev, iRegion),
+            /*
+             * ioremap() defaults to no caching since 2.6 kernels.
+             * We try to optimize later.
+             */
+            RTR0PTR R0PtrMapping = ioremap(pci_resource_start(pPciDev, iRegion),
                                                    pci_resource_len(pPciDev, iRegion));
 
             if (R0PtrMapping != NIL_RTR0PTR)
@@ -850,7 +853,7 @@
                 pIns->aRegionR0Mapping[iRegion] = R0PtrMapping;
             else
             {
-                vbpci_printk(KERN_DEBUG, pPciDev, "ioremap_nocache() failed\n");
+                vbpci_printk(KERN_DEBUG, pPciDev, "ioremap_cache() failed\n");
                 pci_release_region(pPciDev, iRegion);
                 rc = VERR_MAP_FAILED;
             }
Index: src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c	(revision 136356)
+++ src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c	(working copy)
@@ -1461,9 +1461,19 @@
              * MMIO / physical memory.
              */
             Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+            /*
+             * ioremap() defaults to no caching since the 2.6 kernels.
+             * ioremap_nocache() has been removed finally in 5.6-rc1.
+             */
             pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
+                             ? ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
+                             : ioremap_cache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
+#else /* KERNEL_VERSION < 2.6.25 */
+            pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
                              ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
                              : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
+#endif /* KERNEL_VERSION < 2.6.25 */
             if (pMemLnx->Core.pv)
             {
                 /** @todo fix protection. */
Last edited 5 years ago by Frank Batschulat (Oracle) (previous) (diff)

by Larry998, 5 years ago

Attachment: fixes_for_5.6.patch added

This patch file will fix that problem.

comment:3 by Frank Batschulat (Oracle), 5 years ago

With 5.6-rc3 we get additional compilation errors:

In file included from /home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/waitqueue-r0drv-linux.h:38:0,
                 from /home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/semevent-r0drv-linux.c:42,
                 from /home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/combined-os-specific.c:38:
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/include/iprt/time.h: In function ‘RTTimeSpecGetTimeval’:
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/include/iprt/time.h:379:13: error: dereferencing pointer to incomplete type ‘struct timeval’
     pTimeval->tv_sec = (time_t)i64;
             ^~
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/include/iprt/time.h:379:25: error: ‘time_t’ undeclared (first use in this function); did you mean ‘ktime_t’?
     pTimeval->tv_sec = (time_t)i64;
                         ^~~~~~
                         ktime_t
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/include/iprt/time.h:379:25: note: each undeclared identifier is reported only once for each function it appears in
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/include/iprt/time.h:379:32: error: expected ‘;’ before ‘i64’
     pTimeval->tv_sec = (time_t)i64;
                                ^~~
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/include/iprt/time.h: In function ‘RTTimeSpecSetTimeval’:
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/include/iprt/time.h:393:67: error: dereferencing pointer to incomplete type ‘const struct timeval’
     return RTTimeSpecAddMicro(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_usec);
                                                                   ^~
In file included from /home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/combined-os-specific.c:46:0:
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/time-r0drv-linux.c: In function ‘rtTimeGetSystemNanoTS’:
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/time-r0drv-linux.c:46:21: error: storage size of ‘Ts’ isn’t known
     struct timespec Ts;
                     ^~
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/time-r0drv-linux.c:47:5: error: implicit declaration of function ‘ktime_get_ts’; did you mean ‘ktime_get_ns’? [-Werror=implicit-function-declaration]
     ktime_get_ts(&Ts);
     ^~~~~~~~~~~~
     ktime_get_ns
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/time-r0drv-linux.c:46:21: error: unused variable ‘Ts’ [-Werror=unused-variable]
     struct timespec Ts;
                     ^~
kBuild: Generating /home/ws/56vb/trunk/out/linux.amd64/debug/obj/webservice/vboxweb.wsdl
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/time-r0drv-linux.c: In function ‘VBoxGuest_RTTimeNow’:
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/time-r0drv-linux.c:184:12: error: implicit declaration of function ‘RTTimeSpecSetTimespec64’; did you mean ‘RTTimeSpecSetTimeval’? [-Werror=implicit-function-declaration]
     return RTTimeSpecSetTimespec64(pTime, &Ts);
            ^~~~~~~~~~~~~~~~~~~~~~~
            RTTimeSpecSetTimeval
/home/ws/56vb/trunk/out/linux.amd64/debug/obj/tstvboxguest-src_mod/r0drv/linux/time-r0drv-linux.c:184:12: error: return makes pointer from integer without a cast [-Werror=int-conversion]
     return RTTimeSpecSetTimespec64(pTime, &Ts);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

comment:4 by Frank Batschulat (Oracle), 5 years ago

We have been finally hit by the Linux-32-bit-Past-Y2038 work/changes that has been going on since at least kernel version 5.5 but is getting close to an end in 5.6.

https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.6-32-bit-Past-Y2038

the individual errors from above:

1) struct timeval:

https://lkml.org/lkml/2020/1/29/355?anz=web
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-endgame

in Linux 5.6-rc3:
https://lwn.net/Articles/813158/
y2038: hide timeval/timespec/itimerval/itimerspec types
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=y2038-endgame&id=82c3bb87758c4128530f3cbb7ae045ef423ee718

2) ktime_get_ts():

This is used in the Linux runtime:

trunk/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c:rtTimeGetSystemNanoTS()

https://www.kernel.org/doc/html/latest/core-api/timekeeping.html
https://www.kernel.org/doc/html/latest/core-api/timekeeping.html#deprecated-time-interfaces

Deprecated time interfaces
Older kernels used some other interfaces that are now being phased
out but may appear in third-party drivers being ported here. In
particular, all interfaces returning a ‘struct timeval’ or ‘struct
timespec’ have been replaced because the tv_sec member overflows in
year 2038 on 32-bit architectures. These are the recommended
replacements:

void ktime_get_ts(struct timespec *)

    Use ktime_get() or ktime_get_ts64() instead.

present till 5.6-rc2:
https://elixir.bootlin.com/linux/v5.6-rc2/source/include/linux/timekeeping32.h

and it's gone with 5.6-rc3:
https://github.com/torvalds/linux/commit/412c53a680a97cb1ae2c0ab60230e193bee86387#diff-29d5ddd06ea73839af565f438a7c186c
https://elixir.bootlin.com/linux/v5.6-rc3/source/include/linux/timekeeping32.h
https://github.com/torvalds/linux/blob/master/include/linux/timekeeping32.h

it already said in the past: include/linux/timekeeping32.h:

#ifndef _LINUX_TIMEKEEPING32_H
#define _LINUX_TIMEKEEPING32_H
/*
 * These interfaces are all based on the old timespec type
 * and should get replaced with the timespec64 based versions
 * over time so we can remove the file here.
 */

=> use ktime_get_ts64()
https://elixir.bootlin.com/linux/v5.6-rc3/source/include/linux/timekeeping.h#L42

3) struct timespec:

https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=y2038-endgame&id=2d5d83981d9ac5c256a30818c9d8cb1443cbb0ce

4) overall 64-bit kernel time interface merge:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=22b17db4ea05

Last edited 5 years ago by Frank Batschulat (Oracle) (previous) (diff)

comment:5 by Frank Batschulat (Oracle), 5 years ago

Description: modified (diff)

comment:6 by s.zharkoff, 5 years ago

Things seems a bit easier here - need to replace one usage of ktime_get_ts and replaca timespec with timespec64 there.

and time.h file is the biggest issue RTTimeSpecSetTimespec64 is getting compiled only if TIMESPEC interface is set , but it is not starting from 5.6-rc3.

RTTimeSpecGetTimeval, RTTimeSpecSetTimeval - this functions are there only for usage with 2.6 kernels,but they are getting comiled in header time.h unconditionally.

The rest of module seems to be compatible with y2038

by Jags, 5 years ago

Attachment: vbox-setup.log added

vbox-setup.log | Building module fails for kernel 5.6 RC4; VirtualBox-6.1.97-136310-Linux_amd64.run on Ubuntu MATE 20.04 64bit

comment:7 by Jags, 5 years ago

Attached vbox-setup.log for errors while building module for kernel 5.6 RC4 in Ubuntu MATE 20.04 64bit; VirtualBox-6.1.97-136310-Linux_amd64.run. Thanks.

Last edited 5 years ago by Jags (previous) (diff)

comment:8 by Frank Batschulat (Oracle), 5 years ago

Description: modified (diff)

in reply to:  6 comment:9 by Frank Batschulat (Oracle), 5 years ago

Replying to s.zharkoff:

and time.h file is the biggest issue
RTTimeSpecSetTimespec64 is getting compiled only if TIMESPEC interface is set , but it is not starting from 5.6-rc3.


yepp, in the runtimes time.h

trunk/include/iprt/time.h

we have this piece under the condition of having TIMESPEC defined:

 398 /* PORTME: Add struct timespec guard macro here. */                                                                                
 399 #if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defin     ed(_TIMESPEC) \
 400  || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))                                                                               
 401 /**                                                                                                                                
 402  * Gets the time as POSIX timespec.                                                                                                
 403  *                                                                                                                                 
 404  * @returns pTime.                                                                                                                 
 405  * @param   pTime       The time spec to interpret.                                                                                
 406  * @param   pTimespec   Where to store the time as POSIX timespec.                                                                 
 407  */                                                                                                                                
 408 DECLINLINE(struct timespec *) RTTimeSpecGetTimespec(PCRTTIMESPEC pTime, struct timespec *pTimespec) 
[...]
 424  * Sets the time as POSIX timespec.                                                                                                
 425  *                                                                                                                                 
 426  * @returns pTime.                                                                                                                 
 427  * @param   pTime       The time spec to modify.                                                                                   
 428  * @param   pTimespec   Pointer to the POSIX timespec struct with the new time.                                                    
 429  */                                                                                                                                
 430 DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec(PRTTIMESPEC pTime, const struct timespec *pTimespec)                                 
 431 {                                                                                                                                  
 432     return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec);                                  
 433 }                                                                                                                                  
 434                                                                                                                                    
 435                                                                                                                                    
 436 # ifdef _LINUX_TIME64_H                                                                                                            
 437 DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)                              
 438 {                                                                                                                                  
 439     return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);                                    
 440 }                                                                                                                                  
 441 # endif                                                                                                                            
 442 #endif /* various ways of detecting struct timespec */                               

But starting with 5.6-rc3 that happens iff KERNEL is NOT defined

https://elixir.bootlin.com/linux/v5.6-rc3/source/include/uapi/linux/time.h

#ifndef __KERNEL__
#ifndef _STRUCT_TIMESPEC
#define _STRUCT_TIMESPEC
struct timespec {
	__kernel_old_time_t	tv_sec;		/* seconds */
	long			tv_nsec;	/* nanoseconds */
};
#endif

refer to:

There are no in-kernel users remaining, but there may still
be users that include linux/time.h instead of sys/time.h
from user space, so leave the types available to user space
while hiding them from kernel space.

https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=y2038-endgame&id=82c3bb87758c4128530f3cbb7ae045ef423ee718

that implies, RTTimeSpecSetTimespec64() would not be available when compiling against a >= 5.6-rc3 kernel version, which will be a problem later for:

trunk/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c:RTTimeNow()

170 RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime)                                                                                   
171 {                                                                                                                                  
172     IPRT_LINUX_SAVE_EFL_AC();                                                                                                      
173 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)                                                                                 
174 /* On Linux 4.20, time.h includes time64.h and we have to use 64-bit times. */                                                     
175 # ifdef _LINUX_TIME64_H                                                                                                            
176     struct timespec64 Ts;                                                                                                          
177     ktime_get_real_ts64(&Ts);                                                                                                      
178 # else                                                                                                                             
179     struct timespec Ts;                                                                                                            
180     ktime_get_real_ts(&Ts);                                                                                                        
181 # endif                                                                                                                            
182     IPRT_LINUX_RESTORE_EFL_AC();                                                                                                   
183 # ifdef _LINUX_TIME64_H                                                                                                            
184     return RTTimeSpecSetTimespec64(pTime, &Ts); 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                   
185 #else                                                                                                                              
186     return RTTimeSpecSetTimespec(pTime, &Ts);                                                                                      
187 #endif                                                                                                                             
188 #else   /* < 2.6.16 */                                                                                                             
189     struct timeval Tv;                                                                                                             
190     do_gettimeofday(&Tv);                                                                                                          
191     IPRT_LINUX_RESTORE_EFL_AC();                                                                                                   
192     return RTTimeSpecSetTimeval(pTime, &Tv);                                                                                       
193 #endif                                                                 

Also 'struct timeval' used in iprt/time.h is in a similar way defined iff KERNEL is NOT defined.

#ifndef __KERNEL__
#ifndef _STRUCT_TIMESPEC
#define _STRUCT_TIMESPEC
struct timespec {
	__kernel_old_time_t	tv_sec;		/* seconds */
	long			tv_nsec;	/* nanoseconds */
};
#endif

struct timeval {
	__kernel_old_time_t	tv_sec;		/* seconds */
	__kernel_suseconds_t	tv_usec;	/* microseconds */
};

struct itimerspec {
	struct timespec it_interval;/* timer period */
	struct timespec it_value;	/* timer expiration */
};

struct itimerval {
	struct timeval it_interval;/* timer interval */
	struct timeval it_value;	/* current value */
};
#endif
Last edited 5 years ago by Frank Batschulat (Oracle) (previous) (diff)

by s.zharkoff, 5 years ago

Attachment: timet.patch added

The patch is working for 5.6-rc3+, but will break older versions :(

comment:10 by s.zharkoff, 5 years ago

I've uploaded the patch I've used for my Gentoo and living happily with it running WinXP32 and Win7 Pro 64 in Virtualbox 6.1.4 and kernel 5.6-rc3 and rc4 and rc5 now. I am not a good C - kernel programmer so this is not a patch to be merged because it is dirty and for sure will break compilation with older versions. But maybe some ideas from it can help better programmer to do things clean and efficient.

by Jags, 5 years ago

vbox-setup_kernel_5.6_rc5.log | Building module fails for kernel 5.6 RC5; VirtualBox-6.1.97-136423-Linux_amd64 on Ubuntu MATE 20.04 64bit

comment:11 by Jags, 5 years ago

I just like to add that building module still fails with VirtualBox-6.1.97-136423-Linux_amd64 and kernel 5.6 RC5 on Ubuntu MATE 20.04 64bit.

Attaching vbox-setup_kernel_5.6_rc5.log. Thanks.

in reply to:  11 comment:12 by Frank Batschulat (Oracle), 5 years ago

Replying to Jags:

I just like to add that building module still fails with VirtualBox-6.1.97-136423-Linux_amd64 and kernel 5.6 RC5 on Ubuntu MATE 20.04 64bit.

Attaching vbox-setup_kernel_5.6_rc5.log. Thanks.

Yes, we know that, That's the reason why the bug is not yet marked as fixed. Thanks.

comment:13 by Frank Batschulat (Oracle), 5 years ago

Status: assignedaccepted

comment:14 by virtualGuy, 5 years ago

All works well Thanks for your work. I use Fedora 32 alpha with VirtualBox-6.1.97-136454-Linux_amd64.run, patched timet.patch and change the ioremap_nocache manually.

Linux luck 5.6.0-0.rc5.git0.2.fc32.x86_64 #1 SMP Tue Mar 10 19:09:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

comment:15 by burdi01, 5 years ago

Any news? We are at kernel 5.6.0-rc7 now and Linus expects to release 5.6 next week.
Regards, Dick :D

comment:16 by pd, 5 years ago

FYI, if you use Fedora 32 beta, rpmfusion's build of VirtualBox is fixed for kernel 5.6

comment:17 by burdi01, 5 years ago

All works well ... I use Fedora 32 alpha with VirtualBox-6.1.97-136454-Linux_amd64.run, patched timet.patch and change the ioremap_nocache manually.

FYI, if you use Fedora 32 beta, rpmfusion's build of VirtualBox is fixed for kernel 5.6

I run Slackware Current64 with a custom-built 5.6-rc7 kernel. The as of now latest testbuild VirtualBox-6.1.5-136459-Linux_amd64.run does not resolve the problems at hand.

As the kernel modules can be built without the full VB sources it stands to reason that they are included in the /opt/VirtualBox/ directory as installed by the .run file. Looking at the timet.patch and some browsing indeed gave /opt/VirtualBox/src/vboxhost/. The timet.patch then applied without problems. Alas for the ioremap patch I could not find the correlation.

I left things as is as I expected / hoped for the upstream at Oracle to provide a newer testbuild. As of today this has not happened -- NB this is *not* a complaint.

On https://rpmfusion.org > Fedora > 32 > branched > x86_64 the VirtualBox-kmodsrc-6.1.4-3.fc32 rpm looked promising. And indeed I found patched replacements there for the /opt/VirtualBox/src/vboxhost/ sources. A reboot made the kernel modules build without a hitch and for as far as I can see running VB is OK.

comment:18 by Frank Batschulat (Oracle), 5 years ago

this has been fixed in trunk with the following revisions:
r83471 and r83473 and r83484

tested against:
https://git.kernel.org/torvalds/t/linux-5.6-rc7.tar.gz[[BR]] https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.tar.xz[[BR]] https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.2.tar.xz[[BR]]

Tested with Fedora Rawhide guest:

PRETTY_NAME="Fedora 32 (Workstation Edition)"
 
$ uname -a
Linux localhost.localdomain 5.5.0-0.rc6.git2.1.fc32.x86_64 #1 SMP Wed Jan 15 20:22:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
 
$ lsmod|grep vbox
vboxsf                 81920  2
vboxvideo              36864  0
drm_kms_helper        237568  2 vmwgfx,vboxvideo
ttm                   131072  2 vmwgfx,vboxvideo
drm                   638976  6 vmwgfx,drm_kms_helper,vboxvideo,ttm
vboxguest             360448  6 vboxsf
 
[   85.325722] 07:51:09.374586 main     VBoxService 6.1.97 r136712 (verbosity: 0) linux.amd64 (Mar 28 2020 07:58:03) release log
               07:51:09.374588 main     Log opened 2020-03-28T07:51:09.373952000Z
[   85.326935] 07:51:09.375817 main     OS Product: Linux
[   85.327286] 07:51:09.376181 main     OS Release: 5.5.0-0.rc6.git2.1.fc32.x86_64
[   85.327641] 07:51:09.376538 main     OS Version: #1 SMP Wed Jan 15 20:22:49 UTC 2020
[   85.328261] 07:51:09.377144 main     Executable: /opt/VBoxGuestAdditions-6.1.97/sbin/VBoxService
               07:51:09.377145 main     Process ID: 1116
               07:51:09.377145 main     Package type: LINUX_64BITS_UBUNTU_18_04
[   85.330521] 07:51:09.379407 main     6.1.97 r136712 started. Verbose level = 0
[   85.332460] 07:51:09.381344 main vbglR3GuestCtrlDetectPeekGetCancelSupport: Supported (#1)
[   85.617023] vboxsf: g_fHostFeatures=0x8000000f g_fSfFeatures=0x1 g_uSfLastFunction=29
[   85.620808] vboxsf: Successfully loaded version 6.1.97
[   85.623058] vboxsf: Successfully loaded version 6.1.97 on 5.5.0-0.rc6.git2.1.fc32.x86_64 SMP mod_unload  (LINUX_VERSION_CODE=0x50500)
[   85.636344] 07:51:09.685215 automount vbsvcAutomounterMountIt: Successfully mounted 'Downloads' on '/media/sf_Downloads'
[   85.666387] 07:51:09.715222 automount vbsvcAutomounterMountIt: Successfully mounted 'Music' on '/media/sf_Music'
 
dmesg|grep vbox
[    2.679804] vboxguest: loading out-of-tree module taints kernel.
[    2.680189] vboxguest: module verification failed: signature and/or required key missing - tainting kernel
[    2.813872] vboxguest: Successfully loaded version 6.1.97
[    2.814097] vboxguest: misc device minor 60, IRQ 20, I/O port d040, MMIO at 00000000f2400000 (size 0x400000)
[    2.814439] vboxguest: Successfully loaded version 6.1.97 (interface 0x00010004)
[   85.617023] vboxsf: g_fHostFeatures=0x8000000f g_fSfFeatures=0x1 g_uSfLastFunction=29
[   85.620808] vboxsf: Successfully loaded version 6.1.97
[   85.623058] vboxsf: Successfully loaded version 6.1.97 on 5.5.0-0.rc6.git2.1.fc32.x86_64 SMP mod_unload  (LINUX_VERSION_CODE=0x50500)

Backport to the 6.1, 6.0 and 5.2 branches in progress.

I'll produce a new set of trunk public test builds on Monday.

Last edited 5 years ago by Frank Batschulat (Oracle) (previous) (diff)

comment:19 by francois_val, 5 years ago

Are you sure of the revision numbers for the latest patches ? When trying to click on the link, there is a message indicating "no changeset in the repository". Can you explain where we can get the patches ?

comment:20 by Klaus Espenlaub, 5 years ago

Edited fbatschu's comment. He needs to get used to the difference between public repo and the internal one. I'm sure he didn't intentionally point to unreachable changes.

comment:21 by burdi01, 5 years ago

As an "outsider" I seem to be able to download all testbuilds. I am just waiting for a new testbuild containing the patches. While waiting I run 136459 with the Fedora 32 Beta rpm kernel module sources -- see my previous post. :D

Last edited 5 years ago by burdi01 (previous) (diff)

comment:22 by Klaus Espenlaub, 5 years ago

Yeah, testbuilds are a good thing - but at the moment don't look at the 5.2 and 6.0 ones (just for Linux). They seem to have serious trouble getting any VM started. 6.1 and trunk look OK.

by dinosaur0, 5 years ago

Attachment: VboxError.png added

Error with v6.0 test build implementing Linux 5.6 modules fixes

in reply to:  22 comment:23 by dinosaur0, 5 years ago

Replying to klaus:

at the moment don't look at the 5.2 and 6.0 ones (just for Linux). They seem to have serious trouble getting any VM started.

Indeed... I just tried the VirtualBox-6.0.19-136792-Linux_amd64.run test build, and got this error box when attempting to start all my VMs:

Error with v6.0 test build implementing Linux 5.6 modules fixes .

Note that I narrowed the issue to the modules themselves: when running VirtualBox v6.0.18 with modules built from the modules sources of v6.0.19-136792, I get the same error (and the running Linux kernel version does not matter either: I tried with v5.5.14 and v5.6.1).

6.1 and trunk look OK.

Sadly, I'm stuck with v6.0, at least until they fix all the bugs and remove all the limitations in the VMSVGA graphics driver, for I cannot run DirectX applications under Windows XP guests neither any OpenGL application (under either Windows XP/7/10 or Linux guests) with it, not to mention its limitations with macOS guests screen size...

comment:24 by Frank Batschulat (Oracle), 5 years ago

We have released public test builds for Trunk, 6.1.X, 6.0.X and 5.2.X that contain the relevant changes for 5.6 support. You can download them from:

https://www.virtualbox.org/wiki/Testbuilds

in reply to:  24 comment:25 by dinosaur0, 5 years ago

Replying to fbatschu:

We have released public test builds for Trunk, 6.1.X, 6.0.X and 5.2.X that contain the relevant changes for 5.6 support.

Thank you !

I can confirm that VirtualBox-6.0.19-136805-Linux_amd64.run works fine with Linux v5.6.2 (and 5.5.14).

by David C Rankin, 5 years ago

Attachment: vbox-5.2.39_ann.png added

Unusual CPU Load on extended idle

comment:26 by David C Rankin, 5 years ago

Build of 5.2.39 testbuild on Archlinux (build=136804) with Linux 5.6.2 kernel went fine (Linux host and guest, with -ext-oracle guest additions). I did notice a strange graphics issue with Win7 (32-bit) clients. Accessing the guest headless over the network. If the guest is just left idling in the rdesktop window (with task-manager, perfomance-tab) up, upon return, there is a consistent 5% CPU use that is "ringing" (noisy, etc.). This was after an approximate 3 hour idle. The normal state prior to this build is 1%. (checking the process tab-all users, it is only system idle and task manager running -- the spike is me opening the snipping tool to capture the screenshot)

Unusual CPU Load on extended idle

After forcing the window redraw by using the snipping tool to create the screenshot -- the idle immediately dropped back to the normal 1%. There is no screen-saver configured, so it is almost like there is something that now generates guest CPU load after an extended idle (the guest is just left running on Desktop 2 of 4 in KDE). The KDE screensaver was triggered several times, but there is no suspend or hibernate configured on the machine running the rdesktop session.

This is more an oddity that I thought I would add based on the earlier comment regarding DirectX and OpenGL. Other than that -- things are building in working like a champ with the 5.6 kernel.

comment:27 by pgnd, 5 years ago

confirming

VirtualBox-6.1.5-136807-Linux_amd64.run
Oracle_VM_VirtualBox_Extension_Pack-6.1.5-136807.vbox-extpack
VBoxGuestAdditions_6.1.5-136807.iso

on

uname -rm
	5.6.3-24.ge840c7b-default x86_64

installs/execs with no error

comment:28 by Frank Batschulat (Oracle), 5 years ago

Resolution: fixed
Status: acceptedclosed
Summary: Linux: kernel 5.6 - we need changesLinux: kernel 5.6 - we need changes (fixed in 6.1.6, 6.0.20 and 5.2.40)

This has been fixed in public releases 6.1.6, 6.0.20 and 5.2.40

comment:29 by bilias, 4 years ago

I still have this problem on Fedora 31. Tested on kernels: 5.6.11-200, 5.6.8-200

Virtualbox is 6.1-6.1.8_137981. Previous version of 6.1.8 also had the same problem

/tmp/vbox.0/linux/VBoxPci-linux.c: In function ‘vboxPciOsDevMapRegion’:
/tmp/vbox.0/linux/VBoxPci-linux.c:846:36: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
  846 |             RTR0PTR R0PtrMapping = ioremap_nocache(pci_resource_start(pPciDev, iRegion),
      |                                    ^~~~~~~~~~~~~~~
      |                                    ioremap_cache
/tmp/vbox.0/linux/VBoxPci-linux.c:846:36: warning: initialization of ‘RTR0PTR’ {aka ‘void *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /tmp/vbox.0/VBoxPci.o
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:267: /tmp/vbox.0/linux/VBoxPci-linux.o] Error 1
make[1]: *** [Makefile:1683: /tmp/vbox.0] Error 2

in reply to:  29 comment:30 by Frank Batschulat (Oracle), 4 years ago

Replying to bilias:

I still have this problem on Fedora 31. Tested on kernels: 5.6.11-200, 5.6.8-200

Virtualbox is 6.1-6.1.8_137981. Previous version of 6.1.8 also had the same problem

/tmp/vbox.0/linux/VBoxPci-linux.c: In function ‘vboxPciOsDevMapRegion’:
/tmp/vbox.0/linux/VBoxPci-linux.c:846:36: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
  846 |             RTR0PTR R0PtrMapping = ioremap_nocache(pci_resource_start(pPciDev, iRegion),
      |                                    ^~~~~~~~~~~~~~~
      |                                    ioremap_cache
/tmp/vbox.0/linux/VBoxPci-linux.c:846:36: warning: initialization of ‘RTR0PTR’ {aka ‘void *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /tmp/vbox.0/VBoxPci.o
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:267: /tmp/vbox.0/linux/VBoxPci-linux.o] Error 1
make[1]: *** [Makefile:1683: /tmp/vbox.0] Error 2


What is the origin of the Virtualbox version/guest additions you are trying to use above? This was fixed in Virtualbox 6.1.6 and I just verified again on Fedora 31, running kernel 5.6.11-200, that our GAs still compile and work there.

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette