VirtualBox

Ticket #16966 (closed defect: fixed)

Opened 15 months ago

Last modified 12 months ago

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

Reported by: dimchub Owned by:
Priority: critical 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

mm.h Download (74.4 KB) - added by dimchub 15 months ago.
include/linux/mm.h file provided with OpenSUSE 42.3
vbox-install.log.gz Download (2.8 KB) - added by dimchub 15 months ago.
vbox-install.log from failing installation
vbox-install.log Download (44.1 KB) - added by dimchub 15 months ago.
uncompressed vbox-install.log
memobj-2.patch Download (2.5 KB) - added by dimchub 15 months 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 Download (19.8 KB) - added by jcdole 12 months 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 Download (440.8 KB) - added by jcdole 12 months ago.
Logs and config files kernel 4.4.92 - Virtualbox 5.2
install_guest_add.tar.gz Download (18.6 KB) - added by jcdole 12 months ago.
errors logs when installing guest additions

Change History

Changed 15 months ago by dimchub

  • attachment mm.h Download added

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

Changed 15 months ago by dimchub

vbox-install.log from failing installation

Changed 15 months ago by dimchub

uncompressed vbox-install.log

Changed 15 months ago by dimchub

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

comment:1 Changed 15 months ago by dimchub

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

comment:2 Changed 15 months ago by frank

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

comment:3 Changed 15 months ago by frank

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

comment:4 follow-up: ↓ 5 Changed 15 months ago by frank

Nevermind, found it.

comment:5 in reply to: ↑ 4 Changed 15 months ago by dimchub

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 Roedel in December 2016-March 2017.

Last edited 15 months ago by dimchub (previous) (diff)

comment:6 follow-up: ↓ 7 Changed 15 months ago by frank

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

comment:7 in reply to: ↑ 6 Changed 15 months ago by dimchub

Thank you. This is a nice one.

comment:8 Changed 14 months ago by ...don

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

comment:9 Changed 14 months ago by frank

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

comment:10 Changed 13 months ago by michael

  • Status changed from new to closed
  • Resolution set to fixed
  • Summary changed from get_user_pages() interface change backported on OpenSUSE to get_user_pages() interface change backported on OpenSUSE -> fixed in 5.1.28

comment:11 Changed 12 months ago by jcdole

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 12 months ago by jcdole

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 Changed 12 months ago by michael

Does this apply to 5.1.30 and 5.2.0 as well?

comment:14 Changed 12 months ago by jcdole

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

Changed 12 months ago by jcdole

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

comment:15 Changed 12 months ago by jcdole

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.

Changed 12 months ago by jcdole

Logs and config files kernel 4.4.92 - Virtualbox 5.2

comment:16 Changed 12 months ago by jcdole

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.

Changed 12 months ago by jcdole

errors logs when installing guest additions

comment:17 Changed 12 months ago by jcdole

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

comment:18 Changed 12 months ago by jcdole

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 Changed 12 months ago by michael

  • Status changed from reopened to closed
  • Resolution set to fixed
  • Summary changed from get_user_pages() interface change backported on OpenSUSE -> fixed in 5.1.28 to get_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.

www.oracle.com
ContactPrivacy policyTerms of Use