VirtualBox

Opened 8 years ago

Closed 8 years ago

#16576 closed defect (worksforme)

Virtualbox Guest Additions FTBFS on Kernel 4.10 - memobj-r0drv-linux.c

Reported by: David C Rankin Owned by:
Component: guest additions Version: VirtualBox 5.1.18
Keywords: Cc:
Guest type: Linux Host type: Linux

Description (last modified by Frank Mehnert)

Attempting to update virtualbox guest additions for Linux guests running the Linux 4.10 kernel results in a Failure To Build From Source in memobj-r0drv-linux.c. The specific build error is:

/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1067:18: error: too few arguments to function ‘get_user_pages_remote’
             rc = get_user_pages_remote(
                  ^~~~~~~~~~~~~~~~~~~~~
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:
./include/linux/mm.h:1267:6: note: declared here
 long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
      ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:294: /tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/tmp/vbox.0/r0drv/linux/memuserkernel-r0drv-linux.o: warning: objtool: .fixup: unexpected end of section
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/linux/memuserkernel-r0drv-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/r0drv/linux/memuserkernel-r0drv-linux.o"; fi; fi;
make[1]: *** [Makefile:1490: _module_/tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile.include.footer:84: vboxguest] Error 2

Build fails for both 5.1.18 and 5.1.16.

Attachments (2)

vboxadd-install.log (43.4 KB ) - added by David C Rankin 8 years ago.
Arch Host/Arch Gues, both with Linux-4.10.4-1 kernel
arch_1_64_showvminfo.txt (5.2 KB ) - added by David C Rankin 8 years ago.
Arch Guest - showvminfo (running)

Download all attachments as: .zip

Change History (8)

comment:1 by Frank Mehnert, 8 years ago

Description: modified (diff)

comment:2 by Frank Mehnert, 8 years ago

To me it seems that your are compiling an older version of the Guest Additions. The 5.1.18 Guest Additions code looks like this:

            rc = get_user_pages_remote(
                                pTask,                  /* Task for fault accounting. */
                                pTask->mm,              /* Whose pages. */
                                R3Ptr,                  /* Where from. */
                                cPages,                 /* How many pages. */
# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
                                fWrite ? FOLL_WRITE |   /* Write to memory. */
                                         FOLL_FORCE     /* force write access. */
                                       : 0,             /* Write to memory. */
# else
                                fWrite,                 /* Write to memory. */
                                fWrite,                 /* force write access. */
# endif
                                &pMemLnx->apPages[0],   /* Page array. */
                                papVMAs                 /* vmas */
# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
                                , NULL                  /* locked */
# endif
                                );

which extracts with Linux 4.10 like this:

            rc = get_user_pages_remote(
                                pTask,                  /* Task for fault accounting. */
                                pTask->mm,              /* Whose pages. */
                                R3Ptr,                  /* Where from. */
                                cPages,                 /* How many pages. */
                                fWrite ? FOLL_WRITE |   /* Write to memory. */
                                         FOLL_FORCE     /* force write access. */
                                       : 0,             /* Write to memory. */
                                &pMemLnx->apPages[0],   /* Page array. */
                                papVMAs                 /* vmas */
                                , NULL                  /* locked */
                                );

which entirely fits to the Linux 4.10 kernel header prototype:

long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
                unsigned long start, unsigned long nr_pages,
                unsigned int gup_flags, struct page **pages,
                struct vm_area_struct **vmas, int *locked);

The prototype requires 8 parameters and the VirtualBox code provides 8 parameters. To me it seems like something is wrong with your setup.

comment:3 by David C Rankin, 8 years ago

I'll give it a shot. Just installed an updated Linux-4.10.4-1 on Arch and I'll try the rebuild recompile and report back.

by David C Rankin, 8 years ago

Attachment: vboxadd-install.log added

Arch Host/Arch Gues, both with Linux-4.10.4-1 kernel

by David C Rankin, 8 years ago

Attachment: arch_1_64_showvminfo.txt added

Arch Guest - showvminfo (running)

comment:4 by David C Rankin, 8 years ago

frank,

I have updated both the Archlinux Host and Guest to virtualbox 5.1.18 (with ext-oracle additions). All modules build without issue on the Host. However, when attempting to setup the kernel modules on the Guest by running '# rcvboxadd setup', I experience the build failure originally posted.

This is kernel related, because I have the same Guest on an Archlinux Host (host running 4.10.4 kernel) where the Guest is running the 4.9.11 kernel (I have not upgraded the guest kernel there to prevent losing the modules)

So the problem is the Guest modules will not build when the guest kernel is upgraded to 4.10.X. When the guest was running 4.9.X, I had no problems with the kernel modules at all, e.g.:

vboxsf                 45056  0
vboxvideo              45056  1
vboxguest             221184  3 vboxsf,vboxvideo
ttm                    86016  1 vboxvideo
drm_kms_helper        126976  1 vboxvideo
drm                   294912  4 vboxvideo,ttm,drm_kms_helper
syscopyarea            16384  2 vboxvideo,drm_kms_helper
sysfillrect            16384  2 vboxvideo,drm_kms_helper
sysimgblt              16384  2 vboxvideo,drm_kms_helper

I'm happy to run whatever additional test will help, but right now I'm stuck with an Arch guest that I cannot build the guest addition modules on after updating the Guest to the 4.10 kernel. Thanks for all your help.

comment:5 by David C Rankin, 8 years ago

UUGH!!! As is normally the case it is the stupid end user doing something wrong. It was here too. I apologize, you were correct, I found the old additions, removed them, and 5.18.1 then built fine.

Please CLOSE this bug... and keep up the great work... and watch out for dummies.

comment:6 by Frank Mehnert, 8 years ago

Resolution: worksforme
Status: newclosed

Thanks for letting me know.

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