VirtualBox

Opened 5 years ago

Closed 4 years ago

#19521 closed defect (fixed)

Can't build kernel modules on SLES12 SP5 => fixed in SVN

Reported by: TomashT Owned by: Frank Batschulat (Oracle)
Component: other Version: VirtualBox 6.1.6
Keywords: SLES12SP5 Cc:
Guest type: Linux Host type: all

Description

Install / build guest addition in SLES12 SP5 guest will fail (see below):

...
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:56:5: error: unknown type name ‘wait_queue_t’
     wait_queue_t    WaitQE;
     ^
In file included from /usr/src/linux-4.12.14-122.17/include/linux/mmzone.h:9:0,
                 from /usr/src/linux-4.12.14-122.17/include/linux/gfp.h:5,
                 from /usr/src/linux-4.12.14-122.17/include/linux/slab.h:14,
                 from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:85,
                 from /tmp/vbox.0/combined-os-specific.c:28:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitInit’:
/usr/src/linux-4.12.14-122.17/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:187:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-122.17/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:187:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-122.17/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:187:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^
/usr/src/linux-4.12.14-122.17/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:187: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,
                 from /tmp/vbox.0/combined-os-specific.c:38:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitPrepare’:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:211: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-122.17/include/linux/mmzone.h:9:0,
                 from /usr/src/linux-4.12.14-122.17/include/linux/gfp.h:5,
                 from /usr/src/linux-4.12.14-122.17/include/linux/slab.h:14,
                 from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:85,
                 from /tmp/vbox.0/combined-os-specific.c:28:
/usr/src/linux-4.12.14-122.17/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,
                 from /tmp/vbox.0/combined-os-specific.c:38:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitDelete’:
/tmp/vbox.0/r0drv/linux/waitqueue-r0drv-linux.h:275:5: warning: passing argument 2 of ‘finish_wait’ from incompatible pointer type [enabled by default]
     finish_wait(pWait->pWaitQueue, &pWait->WaitQE);
     ^
In file included from /usr/src/linux-4.12.14-122.17/include/linux/mmzone.h:9:0,
                 from /usr/src/linux-4.12.14-122.17/include/linux/gfp.h:5,
                 from /usr/src/linux-4.12.14-122.17/include/linux/slab.h:14,
                 from /tmp/vbox.0/r0drv/linux/the-linux-kernel.h:85,
                 from /tmp/vbox.0/combined-os-specific.c:28:
/usr/src/linux-4.12.14-122.17/include/linux/wait.h:986:6: note: expected ‘struct wait_queue_entry *’ but argument is of type ‘int *’
 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
      ^
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_VBoxGuest-linux.o";
/usr/src/linux-4.12.14-122.17/scripts/Makefile.build:323: recipe for target '/tmp/vbox.0/combined-os-specific.o' failed
make[4]: *** [/tmp/vbox.0/combined-os-specific.o] Error 1
make[4]: *** Waiting for unfinished jobs....
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_VBoxGuest.o";
   if [ /tmp/vbox.0/VBoxGuest.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/VBoxGuest.o"; fi;
   if [ /tmp/vbox.0/VBoxGuest-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/VBoxGuest-linux.o"; fi;
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_combined-agnostic.o";
   if [ /tmp/vbox.0/combined-agnostic.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/combined-agnostic.o"; fi;
/usr/src/linux-4.12.14-122.17/Makefile:1564: recipe for target '_module_/tmp/vbox.0' failed
make[3]: *** [_module_/tmp/vbox.0] Error 2
Makefile:152: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:24: recipe for target '__sub-make' failed
make[1]: *** [__sub-make] Error 2
/tmp/vbox.0/Makefile-footer.gmk:114: recipe for target 'vboxguest' failed
make: *** [vboxguest] Error 2
VBoxClient: info: Try 'VBoxClient --help' for more information
modprobe vboxguest failed

It seems that this issue is the same like it was in SLES12 SP4. For new SLES releases "wait_queue_t" must be replaced for "wait_queue_entry_t".

As a workaround I replaced "KERNEL_VERSION(4, 13, 0)" for "KERNEL_VERSION(4, 12, 0)" in waitqueue-r0drv-linux.h:

/**
 * Kernel mode Linux wait state structure.
 */
typedef struct RTR0SEMLNXWAIT
{
    /** The wait queue entry. */
#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 12, 0) \
  || defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 12 && CONFIG_SUSE_PATCHLEVEL == 4 \
  || defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15
    wait_queue_entry_t WaitQE;
#else
    wait_queue_t    WaitQE;
#endif

After restart of machine guest addition works properly. Please be so kind and add support for SLES12 SP5.

Attachments (1)

sles125diffs.txt (7.4 KB ) - added by Frank Batschulat (Oracle) 4 years ago.

Download all attachments as: .zip

Change History (7)

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

Component: guest additionsother
Owner: set to Frank Batschulat (Oracle)
Status: newaccepted

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

it is interesting to note, that although OpenSuse 15.1 runs the same kernel 4.12.14 it is not affected by the problem, only SLES12SP5 is:

failing SLES12SP5 : 4.12.14-122.17-default
good OpenSuse 15.1: 4.12.14-lp151.28.48

by Frank Batschulat (Oracle), 4 years ago

Attachment: sles125diffs.txt added

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

attached diffs fix all the problems that are encountered on a SLES 12.5 guest.

Just to make sure, I also tested it against the previous version SLES 12.4 ( 4.12.14-94.41-default ) and it does work there as well.

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

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

the fix has been commited to trunk, revision: r139773 the fix has been backported to 6.1.X, revision: r139774

I will produce test builds on monday.

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

comment:6 by bird, 4 years ago

Resolution: fixed
Status: acceptedclosed
Summary: Can't build kernel modules on SLES12 SP5Can't build kernel modules on SLES12 SP5 => fixed in SVN
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