VirtualBox

Ticket #19391 (closed defect: fixed)

Opened 5 months ago

Last modified 3 months ago

RedHat: 5.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs (fixed in VirtualBox 6.1.8, 6.0.22 and 5.2.42)

Reported by: fbatschu Owned by: fbatschu
Component: guest additions Version: VirtualBox 6.1.4
Keywords: CentOS 8 4.18.0-177.el8 oracle linux OL8.2 redhat Cc:
Guest type: Linux Host type: all

Description

Guest additions kernel module compilation error on CentOS 8 Stream guest

This worked for 6.1.2 and the 4.18.0-168 kernel version but fails partially with the new 4.18.0-177.el8.x86_64 kernel version.

[root@localhost VBox_GAs_6.1.4]# uname -a
Linux localhost.localdomain 4.18.0-177.el8.x86_64 #1 SMP Wed Feb 12 19:59:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost VBox_GAs_6.1.4]# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.4 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.2 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 
4.18.0-177.el8.x86_64.

VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what 
went wrong
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restarted

[root@localhost VBox_GAs_6.1.4]# cat /var/log/vboxadd-setup.log
Building the main Guest Additions 6.1.4 module for kernel 4.18.0-177.el8.x86_64.
Building the shared folder support module.
Building the graphics driver module.
Error building the module.  Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/4.18.0-177.el8.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j2 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (	\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/tmp/vbox.0
(cat /dev/null;   echo kernel//tmp/vbox.0/vboxvideo.ko;) > /tmp/vbox.0/modules.order
  gcc -Wp,-MD,/tmp/vbox.0/.hgsmi_base.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated   -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -I./include -I/tmp/vbox.0/ -I./include/drm -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_ARCH_AMD64  -DMODULE  -DKBUILD_BASENAME='"hgsmi_base"' -DKBUILD_MODNAME='"vboxvideo"' -c -o /tmp/vbox.0/.tmp_hgsmi_base.o /tmp/vbox.0/hgsmi_base.c
  gcc -Wp,-MD,/tmp/vbox.0/.modesetting.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated   -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -I./include -I/tmp/vbox.0/ -I./include/drm -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_ARCH_AMD64  -DMODULE  -DKBUILD_BASENAME='"modesetting"' -DKBUILD_MODNAME='"vboxvideo"' -c -o /tmp/vbox.0/.tmp_modesetting.o /tmp/vbox.0/modesetting.c
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_hgsmi_base.o";
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_modesetting.o";
  gcc -Wp,-MD,/tmp/vbox.0/.vbox_drv.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated   -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -I./include -I/tmp/vbox.0/ -I./include/drm -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_ARCH_AMD64  -DMODULE  -DKBUILD_BASENAME='"vbox_drv"' -DKBUILD_MODNAME='"vboxvideo"' -c -o /tmp/vbox.0/.tmp_vbox_drv.o /tmp/vbox.0/vbox_drv.c
  gcc -Wp,-MD,/tmp/vbox.0/.vbox_fb.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated   -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -I./include -I/tmp/vbox.0/ -I./include/drm -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_ARCH_AMD64  -DMODULE  -DKBUILD_BASENAME='"vbox_fb"' -DKBUILD_MODNAME='"vboxvideo"' -c -o /tmp/vbox.0/.tmp_vbox_fb.o /tmp/vbox.0/vbox_fb.c
/tmp/vbox.0/vbox_fb.c: In function ‘vboxfb_create’:
/tmp/vbox.0/vbox_fb.c:337:2: error: implicit declaration of function ‘drm_fb_helper_fill_fix’; did you mean ‘drm_fb_helper_fill_info’? [-Werror=implicit-function-declaration]
  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
  ^~~~~~~~~~~~~~~~~~~~~~
  drm_fb_helper_fill_info
/tmp/vbox.0/vbox_fb.c:342:2: error: implicit declaration of function ‘drm_fb_helper_fill_var’; did you mean ‘drm_fb_helper_fill_info’? [-Werror=implicit-function-declaration]
  drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,
  ^~~~~~~~~~~~~~~~~~~~~~
  drm_fb_helper_fill_info
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_vbox_drv.o";
  gcc -Wp,-MD,/tmp/vbox.0/.vbox_irq.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated   -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -I./include -I/tmp/vbox.0/ -I./include/drm -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_ARCH_AMD64  -DMODULE  -DKBUILD_BASENAME='"vbox_irq"' -DKBUILD_MODNAME='"vboxvideo"' -c -o /tmp/vbox.0/.tmp_vbox_irq.o /tmp/vbox.0/vbox_irq.c
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:313: /tmp/vbox.0/vbox_fb.o] Error 1
make[2]: *** Waiting for unfinished jobs....
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_vbox_irq.o";
make[1]: *** [Makefile:1542: _module_/tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:114: vboxvideo] Error 2

It is not quite clear what will be malfunction due to this, at least the usual video functionality works and shared folder support works as well.

[   74.273009] 11:23:19.443544 main     VBoxService 6.1.4 r136177 (verbosity: 0) linux.amd64 (Feb 18 2020 18:13:55) release log
               11:23:19.443552 main     Log opened 2020-03-10T11:23:19.443530000Z
[   74.273133] 11:23:19.443760 main     OS Product: Linux
[   74.273209] 11:23:19.443839 main     OS Release: 4.18.0-177.el8.x86_64
[   74.273275] 11:23:19.443914 main     OS Version: #1 SMP Wed Feb 12 19:59:38 UTC 2020
[   74.273361] 11:23:19.443977 main     Executable: /opt/VBoxGuestAdditions-6.1.4/sbin/VBoxService
               11:23:19.443980 main     Process ID: 2002
               11:23:19.443982 main     Package type: LINUX_64BITS_GENERIC
[   74.279219] 11:23:19.449792 main     6.1.4 r136177 started. Verbose level = 0
[   74.293051] 11:23:19.463607 main     vbglR3GuestCtrlDetectPeekGetCancelSupport: Supported (#1)
[   74.319181] vboxsf: g_fHostFeatures=0x8000000f g_fSfFeatures=0x1 g_uSfLastFunction=29
[   74.319507] vboxsf: Successfully loaded version 6.1.4
[   74.319542] vboxsf: Successfully loaded version 6.1.4 on 4.18.0-177.el8.x86_64 SMP mod_unload modversions  (LINUX_VERSION_CODE=0x41200)
[   74.320948] 11:23:19.491585 automount vbsvcAutomounterMountIt: Successfully mounted 'Downloads' on '/media/sf_Downloads'
[   74.330910] 11:23:19.501553 automount vbsvcAutomounterMountIt: Successfully mounted 'Music' on '/media/sf_Music'
[  533.299894] fuse: init (API version 7.31)
[  538.687614] VBoxClient[2916]: segfault at 968 ip 00007f78694a35d1 sp 00007ffc0bdfefc0 error 4 in libX11.so.6.3.0[7f7869467000+13d000]
[  538.687618] Code: 56 49 89 d6 41 55 49 89 cd 41 54 4d 89 c4 55 48 89 f5 53 48 89 fb 48 83 ec 38 64 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 <48> 8b 87 68 09 00 00 48 85 c0 74 02 ff 10 ba 08 00 00 00 be 62 00
[  544.319999] VBoxClient[3088]: segfault at 968 ip 00007f78694a35d1 sp 00007ffc0bdfefc0 error 4 in libX11.so.6.3.0[7f7869467000+13d000]
[  544.320017] Code: 56 49 89 d6 41 55 49 89 cd 41 54 4d 89 c4 55 48 89 f5 53 48 89 fb 48 83 ec 38 64 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 <48> 8b 87 68 09 00 00 48 85 c0 74 02 ff 10 ba 08 00 00 00 be 62 00

[fbatschu@localhost ~]$ lsmod|grep vbox
vboxsf                 86016  2
vboxguest             380928  7 vboxsf

The segfaulting VBoxClient is actually Ticket #19357 VBoxClient crashes on Luuntu 14.04 after updating from 6.1.2 to 6.1.4

Change History

comment:1 Changed 5 months ago by fbatschu

  • Owner set to fbatschu
  • Status changed from new to assigned

comment:2 Changed 5 months ago by fbatschu

  • Keywords CentOS 8 4.18.0-177.el8 added

comment:3 Changed 5 months ago by fbatschu

From: "Mark Thebridge" <> To: "vbox-dev@…" <vbox-dev@…> Subject: [vbox-dev] Guest additions kernel module compilation error on CentOS 8 Stream guest Date: Tue, 10 Mar 2020 10:05:27 +0100

Hi,

The latest version of the Guest Additions (both 6.1.4 and master) fail to compile the kernel modules on a CentOS 8.1 guest using kernel 4.18.0-177.el8.x86_64 - the latest kernel available through the "Streams" release (which allows CentOS users to get early versions of packages that will be in the next minor release).

I've provided an initial patch that partly fixes this below (authored by me, released under the MIT license). With this patch the video module compiles and works - *but* I'm not sure exactly what the #include guards ought to be. We can't actually test for RHEL_81 being defined, because then guest additions will stop compiling for anyone on the main RHEL/CentOS 8.1 release. Unfortunately there's no real way I can see to tell if we are using at least 4.18.0-177.el8 (which needs these changes) or an earlier 8.1 kernel. The kernel release number is available as the RHEL_RELEASE #define in the kernel tree, but that's a string, not an integer, and the C pre-processor can't do string comparisons. I think we'd need some Makefile enhancements to pass in extra #defines, but not sure exactly where in the Makefiles those should live...

Even if this isn't fixed for CentOS 8 Streams guests, this patch will almost certainly be needed for RHEL/CentOS 8.2 when that comes out

Thanks, Mark

diff -uNr -w a/vbox_fb.c b/vbox_fb.c
--- a/vbox_fb.c 2020-02-18 15:31:10.000000000 +0000
+++ b/vbox_fb.c 2020-03-03 16:33:07.197239177 +0000
@@ -335,14 +331,14 @@
      info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
      info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);

-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) || defined(RHEL_81)
      drm_fb_helper_fill_info(info, &fbdev->helper, sizes);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || defined(RHEL_75)
      drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
#else
      drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && !defined(RHEL_81)
      drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,
                        sizes->fb_height);
#endif
diff -uNr -w a/vbox_ttm.c b/vbox_ttm.c
--- a/vbox_ttm.c 2020-02-14 11:35:05.000000000 +0000
+++ b/vbox_ttm.c 2020-03-03 16:33:07.199239341 +0000
@@ -312,7 +308,7 @@
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
                                   dev->vma_offset_manager,
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && !defined(RHEL_81)
                       DRM_FILE_PAGE_OFFSET,
#endif
                       true);
Last edited 5 months ago by fbatschu (previous) (diff)

comment:4 Changed 5 months ago by fbatschu

  • Status changed from assigned to accepted

comment:5 Changed 5 months ago by fbatschu

fwiw, the regular CenOS8 distro is currently still at: 4.18.0-147.5.1.el8_1.x86_64 and thus not affected so far.

comment:6 Changed 3 months ago by fbatschu

this does now also affect Oracle Linux 8.2 guests running the latest regular RHCK kernel version: 4.18.0-193.el8.x86_64

Last edited 3 months ago by fbatschu (previous) (diff)

comment:7 Changed 3 months ago by fbatschu

  • Keywords oracle linux OEL added

comment:8 Changed 3 months ago by fbatschu

  • Keywords OL8.2 redhat added; OEL removed
  • Summary changed from Guest additions kernel module compilation error on CentOS 8 Stream guest to RedHat 5.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs

comment:9 Changed 3 months ago by fbatschu

Affected so far:

  • CentOS 8 stream starting with kernel version: 4.18.0-177.el8.x86_64 k
  • Oracle Linux 8.2 starting with kernel version: 4.18.0-193.el8.x86_64
  • RHEL 8.2 starting with kernel version: ?

Bascially probably anything that identifies itself as being an offspring from RHEL 8.2 and following stuff after 8.2 (eg. 8.3)

cat /usr/include/linux/version.h
#define LINUX_VERSION_CODE 266752
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#define RHEL_MAJOR 8
#define RHEL_MINOR 2
#define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b))
#define RHEL_RELEASE_CODE 2050
#define RHEL_RELEASE "187"
#define KERNEL_HEADERS_CHECKSUM "59ee2375de06c07c3ddd1235199be5685530a2ce"

$  cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)

$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.2 (Ootpa)
Last edited 3 months ago by fbatschu (previous) (diff)

comment:10 Changed 3 months ago by fbatschu

What basically happened is that RH apparently decided to backport the DRM changes from the 5.2-rc1 kernel tree as described in detail in the last comments in #18677 to the 4.18.0 kernel train of RHEL 8.2 used by RHEL and its offsprings like CentOS or Oracle Linux. The kernel interface changes included in this backport break Virtualbox GA compilation.

comment:11 Changed 3 months ago by fbatschu

the correct fix for this problem in trunk is:

$ svn diff
Index: src/VBox/Additions/linux/drm/vbox_drv.h
===================================================================
--- src/VBox/Additions/linux/drm/vbox_drv.h	(revision 137813)
+++ src/VBox/Additions/linux/drm/vbox_drv.h	(working copy)
@@ -51,6 +51,9 @@
 #include <linux/pci.h>
 
 #if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
+# if RHEL_MAJOR == 8 && RHEL_MINOR >= 2
+#  define RHEL_82
+# endif
 # if RHEL_MAJOR == 8 && RHEL_MINOR >= 1
 #  define RHEL_81
 # endif
Index: src/VBox/Additions/linux/drm/vbox_fb.c
===================================================================
--- src/VBox/Additions/linux/drm/vbox_fb.c	(revision 137813)
+++ src/VBox/Additions/linux/drm/vbox_fb.c	(working copy)
@@ -335,14 +335,18 @@
 	info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
 	info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) || defined(RHEL_82)
+        /*
+         * The corresponding 5.2-rc1 Linux DRM kernel changes have been
+         * also backported to older RedHat based 4.18.0 Linux kernels.
+         */
 	drm_fb_helper_fill_info(info, &fbdev->helper, sizes);
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || defined(RHEL_75)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || defined(RHEL_72)) && !defined(RHEL_82)
 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
 #else
 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && !defined(RHEL_82)
 	drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,
 			       sizes->fb_height);
 #endif
Index: src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- src/VBox/Additions/linux/drm/vbox_ttm.c	(revision 137813)
+++ src/VBox/Additions/linux/drm/vbox_ttm.c	(working copy)
@@ -312,7 +312,7 @@
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
                                  dev->vma_offset_manager,
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && !defined(RHEL_82)
 				 DRM_FILE_PAGE_OFFSET,
 #endif
 				 true);
Index: src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
===================================================================
--- src/VBox/Runtime/r0drv/linux/the-linux-kernel.h	(revision 137813)
+++ src/VBox/Runtime/r0drv/linux/the-linux-kernel.h	(working copy)
@@ -475,6 +475,9 @@
 # if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 1)
 #  define RHEL_81
 # endif
+# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 2)
+#  define RHEL_82
+# endif
 #endif
 
 #endif /* !IPRT_INCLUDED_SRC_r0drv_linux_the_linux_kernel_h */

comment:12 Changed 3 months ago by fbatschu

the fix has been integrated into trunk revision r137873 . Any testbuild [1] with a revision >= r137873 will contain the fix.

for the 6.1 backport, the revision is r137876

for the 6.0 backport, the revision is r137878

for the 5.2 backport, the revision is r137881

[1] https://www.virtualbox.org/wiki/Testbuilds

Last edited 3 months ago by fbatschu (previous) (diff)

comment:14 Changed 3 months ago by klaus

  • Summary changed from RedHat 5.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs to RedHat 8.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs

comment:15 Changed 3 months ago by fbatschu

  • Summary changed from RedHat 8.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs to RedHat: 5.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs

comment:16 Changed 3 months ago by fbatschu

  • Status changed from accepted to closed
  • Resolution set to fixed
  • Summary changed from RedHat: 5.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs to RedHat: 5.2-rc1 kernel DRM backports to 4.18.0 kernels break Virtualbox GAs (fixed in VirtualBox 6.1.8, 6.0.22 and 5.2.42)

This is fixed in the offical versions

VirtualBox 6.1.8, 6.0.22 and 5.2.42

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use