VirtualBox

Opened 7 years ago

Closed 6 years ago

#16966 closed defect (fixed)

get_user_pages() interface change backported on OpenSUSE -> fixed in 5.2 and later builds after Nov 3 2017

Reported by: Dmitri Chubarov Owned by:
Component: host support Version: VirtualBox 5.1.26
Keywords: Cc:
Guest type: all Host type: Linux

Description

Several changes to the linux kernel memory management interface had been backported on OpenSUSE.

These two patches are

mm/gup: Overload get_user_pages() functions

https://github.com/torvalds/linux/commit/cde70140fed8429acf7a14e2e2cbd3e329036653 and

mm/gup: Remove the macro overload API migration helpers from the get_user*() APIs

https://github.com/torvalds/linux/commit/c12d2da56d0e07d230968ee2305aaa86b93a6832

This leads to the failure of vboxdrv compilation on OpenSUSE Leap 42.3 with the following diagnostics in /var/log/vbox-install.log:

/usr/src/linux-4.4.76-1/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.76-1/include/linux/mm.h:1264:6: note: declared here
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^

As one can see the kernel version here is 4.4.76-1, however the get_user_pages() interface looks already has the changes from Ingo Molnar that went into the 4.6.y series.

Attached is the vbox-install.log and the mm.h file provided with the distribution.

Attachments (7)

mm.h (74.4 KB ) - added by Dmitri Chubarov 7 years ago.
include/linux/mm.h file provided with OpenSUSE 42.3
vbox-install.log.gz (2.8 KB ) - added by Dmitri Chubarov 7 years ago.
vbox-install.log from failing installation
vbox-install.log (44.1 KB ) - added by Dmitri Chubarov 7 years ago.
uncompressed vbox-install.log
memobj-2.patch (2.5 KB ) - added by Dmitri Chubarov 7 years ago.
A quick fix that pushes all linux version checks for new mm/gup code back to 4.4.0
VIRTUALBOX_INSTALL_TEST.tar.gz (19.8 KB ) - added by jcdole 6 years ago.
Virtualbox install log for 5.2, 5.1.30, 5.1.28 on kernel 4.4.87-25-default
KERNEL_4_4_92.tar.gz (440.8 KB ) - added by jcdole 6 years ago.
Logs and config files kernel 4.4.92 - Virtualbox 5.2
install_guest_add.tar.gz (18.6 KB ) - added by jcdole 6 years ago.
errors logs when installing guest additions

Download all attachments as: .zip

Change History (26)

by Dmitri Chubarov, 7 years ago

Attachment: mm.h added

include/linux/mm.h file provided with OpenSUSE 42.3

by Dmitri Chubarov, 7 years ago

Attachment: vbox-install.log.gz added

vbox-install.log from failing installation

by Dmitri Chubarov, 7 years ago

Attachment: vbox-install.log added

uncompressed vbox-install.log

by Dmitri Chubarov, 7 years ago

Attachment: memobj-2.patch added

A quick fix that pushes all linux version checks for new mm/gup code back to 4.4.0

comment:1 by Dmitri Chubarov, 7 years ago

Added a patch that seems to fix the immediate issue on OpenSUSE Leap 42.3.

comment:2 by Frank Mehnert, 7 years ago

Sorry, that fix is not appropriate because it would break vanilla kernels. Any way to detect the specific openSUSE kernels?

comment:3 by Frank Mehnert, 7 years ago

Could you point me to the browsable Leap 42.3 reopsitory, in particular to the source code of the Leap kernel?

comment:4 by Frank Mehnert, 7 years ago

Nevermind, found it.

in reply to:  4 comment:5 by Dmitri Chubarov, 7 years ago

In case someone finds it helpful. OpenSUSE developers maintain the kernel tree with their patches at http://kernel.opensuse.org/cgit/kernel and the patches themselves at http://kernel.opensuse.org/cgit/kernel-source. The patches that broke virtual box installation were introduced by Joerg Roedell in December 2016-March 2017.

Version 0, edited 7 years ago by Dmitri Chubarov (next)

comment:6 by Frank Mehnert, 7 years ago

Fixed in diff:@68214:68217. These changes will be part of the next maintenance release.

in reply to:  6 comment:7 by Dmitri Chubarov, 7 years ago

Thank you. This is a nice one.

comment:8 by Don Hughes, 7 years ago

Same issue with SuSE Leap 42.3 and VB 5.1.26. Temporary fix was to revert to kernel 4.4.74

comment:9 by Frank Mehnert, 7 years ago

Just use the most recent 5.1 Guest Additions ISO image from our test builds page.

comment:10 by Michael Thayer, 7 years ago

Resolution: fixed
Status: newclosed
Summary: get_user_pages() interface change backported on OpenSUSEget_user_pages() interface change backported on OpenSUSE -> fixed in 5.1.28

comment:11 by jcdole, 7 years ago

Resolution: fixed
Status: closedreopened

Same probleme with VirtualBox-5.2-5.2.0_118431_openSUSE132-1.x86_64.rpm on opensuse leap 42.3 with kernel 4.4.87-25-default.

Install error 1

make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG= -C /lib/modules/4.4.79-4-default/build -j8 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make -C /usr/src/linux-4.4.79-4-obj/x86_64/default KBUILD_SRC=/usr/src/linux-4.4.79-4 \
-f /usr/src/linux-4.4.79-4/Makefile modules
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)

Install error 2

/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockUser’:
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1100: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.79-4/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:1100: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.79-4/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:1100: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.79-4/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:1100: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.79-4/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:1100: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.79-4/include/linux/mm.h:1264:6: note: declared here
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^

comment:12 by jcdole, 7 years ago

Cannot install VirtualBox-5.1-5.1.28_117968_openSUSE132-1.x86_64.rpm on kernel 4.4.87-25-default I must say that every kernel source files are installed and dkms is installed.

comment:13 by Michael Thayer, 7 years ago

Does this apply to 5.1.30 and 5.2.0 as well?

comment:14 by jcdole, 6 years ago

Tomorrow, I will try a full install of 5.1.28, 5.1.30, 5.2.0

by jcdole, 6 years ago

Virtualbox install log for 5.2, 5.1.30, 5.1.28 on kernel 4.4.87-25-default

comment:15 by jcdole, 6 years ago

Kernel : ========== Linux Linux 4.4.87-25-default #1 SMP Wed Sep 13 07:19:13 UTC 2017 (3927ef5) x86_64 x86_64 x86_64 GNU/Linux

Install : ========== VirtualBox-5.2-5.2.0_118431_openSUSE132-1.x86_64.rpm

install error : ================

Multiple error of this kind, but nothing else.

make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/4.4.87-25-default/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j8 modules make[1]: warning: -jN forced in submake: disabling jobserver mode. make -C /usr/src/linux-4.4.87-25-obj/x86_64/default KBUILD_SRC=/usr/src/linux-4.4.87-25 \ -f /usr/src/linux-4.4.87-25/Makefile modules

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)

lsmod : ======== vboxdrv 516096 3 vboxnetadp,vboxnetflt,vboxpci vboxnetadp 28672 0 vboxnetflt 32768 0 vboxpci 28672 0

Removing VirtualBox-5.2 =========================

Error : ========= depmod: ERROR: fstatat(5, vboxnetadp.ko): No such file or directory depmod: ERROR: fstatat(5, vboxnetflt.ko): No such file or directory depmod: ERROR: fstatat(5, vboxpci.ko): No such file or directory depmod: ERROR: fstatat(5, vboxdrv.ko): No such file or directory

Similar kind of errors for the three version on kernel 4.4.87-25-default

See attachment for virtualbox log.

I will try to install kernel 4.4.90 and give you news.

by jcdole, 6 years ago

Attachment: KERNEL_4_4_92.tar.gz added

Logs and config files kernel 4.4.92 - Virtualbox 5.2

comment:16 by jcdole, 6 years ago

After installing kernel 4.4.92 I installed Virtualbox 5.2 No error during installation. After installing Guest addition no errors on the WINDOWS 10 VM On linux VM, I have an error (xmessage) each time user log on : "VBoxClient: VBoxClient (seamless): failed to start. Stage: Setting guest IRQ filter mask Error: VERR_INTERNAL_ERROR"

See attachements for details.

I you need more ask me.

by jcdole, 6 years ago

Attachment: install_guest_add.tar.gz added

errors logs when installing guest additions

comment:17 by jcdole, 6 years ago

Cannot install module vboxsf when installing guest additions See attachements for details. I you need more ask me.

comment:18 by jcdole, 6 years ago

After applying current update to the linux hosts and linux guest vm there is no more alarm when reinstalling guest addition. Every things seems OK.

comment:19 by Michael Thayer, 6 years ago

Resolution: fixed
Status: reopenedclosed
Summary: get_user_pages() interface change backported on OpenSUSE -> fixed in 5.1.28get_user_pages() interface change backported on OpenSUSE -> fixed in 5.2 and later builds after Nov 3 2017
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use