[Fixed] Can't build kernel modules on SLES12 SP4

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Innoflair
Posts: 3
Joined: 22. Aug 2019, 17:28

[Fixed] Can't build kernel modules on SLES12 SP4

Post by Innoflair »

Hi all,

after an upgrade from SuSE Linux Enterprise Server 12 SP3 to SP4 we can't build the kernel modules any longer.

Previously we run VirtualBox-5.2-5.2.8_121009_openSUSE132-1.x86_64 w/o issues. After an upgrade of the OS to SP4 the new kernel is now reported as

Code: Select all

Linux XXXXXXX 4.12.14-95.24-default #1 SMP Thu Jul 11 13:05:06 UTC 2019 (7b265b8) x86_64 x86_64 x86_64 GNU/Linux
Now the build of the kernel modules fails (see details below). I tried upgrading VirtualBox to the latest releases (VirtualBox-5.2-5.2.32_132073_openSUSE132-1.x86_64.rpm or VirtualBox-6.0-6.0.10_132072_openSUSE132-1.x86_64.rpm) w/o success; they still fail compiling the kernel modules. Using packages for openSUSE 15 fails as they depend on Qt 5.9 but SLES12SP4 ships only with Qt 5.6.

Is anybody running VirtualBox on SLES12 SP4 ? Any help is appreciated.

Thanks,
Christian

Code: Select all

...
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockUser’:
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1117:33: warning: passing argument 1 of ‘get_user_pages’ makes integer from pointer without a cast [enabled by default]
                                 papVMAs);               /* vmas */
                                 ^
In file included from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:98:0,
                 from /tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:31:
/usr/src/linux-4.4.82-6.3/include/linux/mm.h:1264:6: note: expected ‘long unsigned int’ but argument is of type ‘struct task_struct *’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1117:33: warning: passing argument 2 of ‘get_user_pages’ makes integer from pointer without a cast [enabled by default]
                                 papVMAs);               /* vmas */
                                 ^
In file included from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:98:0,
                 from /tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:31:
/usr/src/linux-4.4.82-6.3/include/linux/mm.h:1264:6: note: expected ‘long unsigned int’ but argument is of type ‘struct mm_struct *’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1117:33: warning: passing argument 4 of ‘get_user_pages’ makes pointer from integer without a cast [enabled by default]
                                 papVMAs);               /* vmas */
                                 ^
In file included from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:98:0,
                 from /tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:31:
/usr/src/linux-4.4.82-6.3/include/linux/mm.h:1264:6: note: expected ‘struct page **’ but argument is of type ‘int’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1117:33: warning: passing argument 5 of ‘get_user_pages’ makes pointer from integer without a cast [enabled by default]
                                 papVMAs);               /* vmas */
                                 ^
In file included from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:98:0,
                 from /tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:31:
/usr/src/linux-4.4.82-6.3/include/linux/mm.h:1264:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘int’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1117:33: error: too many arguments to function ‘get_user_pages’
                                 papVMAs);               /* vmas */
                                 ^
In file included from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:98:0,
                 from /tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:31:
/usr/src/linux-4.4.82-6.3/include/linux/mm.h:1264:6: note: declared here
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^
...
In file included from /tmp/vbox.0/r0drv/linux/semeventmulti-r0drv-linux.c:42:0:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:52:5: error: unknown type name ‘wait_queue_t’
     wait_queue_t    WaitQE;
     ^
In file included from /usr/src/linux-4.12.14-95.24/include/linux/mmzone.h:9:0,
                 from /usr/src/linux-4.12.14-95.24/include/linux/gfp.h:5,
                 from /usr/src/linux-4.12.14-95.24/include/linux/slab.h:14,
                 from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:82,
                 from /tmp/vbox.0/r0drv/linux/semeventmulti-r0drv-linux.c:32:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitInit’:
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1002:9: error: request for member ‘private’ in something not a structure or union
   (wait)->private = current;     \
         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1003:9: error: request for member ‘func’ in something not a structure or union
   (wait)->func = autoremove_wake_function;   \
         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1004:25: error: request for member ‘entry’ in something not a structure or union
   INIT_LIST_HEAD(&(wait)->entry);     \
                         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1005:9: error: request for member ‘flags’ in something not a structure or union
   (wait)->flags = 0;      \
         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
In file included from /tmp/vbox.0/r0drv/linux/semevent-r0drv-linux.c:42:0:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:52:5: error: unknown type name ‘wait_queue_t’
     wait_queue_t    WaitQE;
     ^
In file included from /usr/src/linux-4.12.14-95.24/include/linux/mmzone.h:9:0,
                 from /usr/src/linux-4.12.14-95.24/include/linux/gfp.h:5,
                 from /usr/src/linux-4.12.14-95.24/include/linux/slab.h:14,
                 from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:82,
                 from /tmp/vbox.0/r0drv/linux/semevent-r0drv-linux.c:32:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitInit’:
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1002:9: error: request for member ‘private’ in something not a structure or union
   (wait)->private = current;     \
         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1003:9: error: request for member ‘func’ in something not a structure or union
   (wait)->func = autoremove_wake_function;   \
         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1004:25: error: request for member ‘entry’ in something not a structure or union
   INIT_LIST_HEAD(&(wait)->entry);     \
                         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:1005:9: error: request for member ‘flags’ in something not a structure or union
   (wait)->flags = 0;      \
         ^
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:183:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
In file included from /tmp/vbox.0/r0drv/linux/semevent-r0drv-linux.c:42:0:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitPrepare’:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:207:5: warning: passing argument 2 of ‘prepare_to_wait’ from incompatible pointer type [enabled by default]
     prepare_to_wait(pWait->pWaitQueue, &pWait->WaitQE, pWait->iWaitState);
     ^
In file included from /usr/src/linux-4.12.14-95.24/include/linux/mmzone.h:9:0,
                 from /usr/src/linux-4.12.14-95.24/include/linux/gfp.h:5,
                 from /usr/src/linux-4.12.14-95.24/include/linux/slab.h:14,
                 from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:82,
                 from /tmp/vbox.0/r0drv/linux/semevent-r0drv-linux.c:32:
/usr/src/linux-4.12.14-95.24/include/linux/wait.h:983:6: note: expected ‘struct wait_queue_entry *’ but argument is of type ‘int *’
 void prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state);
      ^
In file included from /tmp/vbox.0/r0drv/linux/semevent-r0drv-linux.c:42:0:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitDelete’:
...

Last edited by Innoflair on 13. Sep 2019, 11:02, edited 1 time in total.
socratis
Site Moderator
Posts: 27329
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: Can't build kernel modules on SLES12 SP4

Post by socratis »

Innoflair wrote:I tried upgrading VirtualBox to the latest releases (VirtualBox-5.2-5.2.32_132073_openSUSE132-1.x86_64.rpm or VirtualBox-6.0-6.0.10_132072_openSUSE132-1.x86_64.rpm) w/o success
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.
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.
Innoflair
Posts: 3
Joined: 22. Aug 2019, 17:28

Re: Can't build kernel modules on SLES12 SP4

Post by Innoflair »

Switching to 5.2.33 / test branch solved one part of the problem.

Additionally, I had to change the definition of WaitQE in waitqueue-r0drv-linux.h from wait_queue_t to wait_queue_entry_t as there was a name change in the linux kernel sources.

Thanks,
Christian
klaus
Oracle Corporation
Posts: 1133
Joined: 10. May 2007, 14:57

Re: Can't build kernel modules on SLES12 SP4

Post by klaus »

The SUSE folks really invest a lot of effort into creating a kernel version mess. We've fixed this already (for openSUSE 15, where this "4.12 with quite a lot of 4.13 for no obvious reason" kernel made its debut), but now we need to find a way to detect the same in the SLES12 SP4 context. SUSE claims it's the same kernel, but that can't be true, otherwise our check would be doing the right thing already.
klaus
Oracle Corporation
Posts: 1133
Joined: 10. May 2007, 14:57

Re: Can't build kernel modules on SLES12 SP4

Post by klaus »

This should be fixed with the latest test builds - both of 5.2 and 6.0. It was a quick blind fix, so it'd be much appreciated if you could confirm.
Innoflair
Posts: 3
Joined: 22. Aug 2019, 17:28

Re: Can't build kernel modules on SLES12 SP4

Post by Innoflair »

klaus wrote:This should be fixed with the latest test builds - both of 5.2 and 6.0. It was a quick blind fix, so it'd be much appreciated if you could confirm.
Hi Klaus,

I was away for a couple of days. Thanks for the fix, using VirtualBox-5.2.33-133021-Linux_amd64.run the kernel modules compile fine now. I could only test it on a standby machine without actually launching the VM, but I hope there aren't any regressions.

Christian
Post Reply