Hello,

I ran into a problem with Virtualbox 5.1.26 and Linux kernels 4.4.76 and 4.4.79 on x86_64 when trying to build the kernel module:


/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,
      ^
/usr/src/linux-4.4.76-1/scripts/Makefile.build:259: recipe for target '/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.o' failed

Looking at the signature of get_user_pages() and the provided parameters, it looks to me like get_user_pages() is the wrong function to call here, at least on the 4.4 kernel series. The function signature and provided parameters match get_user_pages_remote() instead, replacing the call then made the kernel module compile successfully and afterwards start without issues:

--- ./src/vboxguest-5.1.26/vboxguest/r0drv/linux/memobj-r0drv-linux.c 2017-08-09 17:56:34.080441174 +0200 +++ ./src/vboxguest-5.1.26/vboxguest/r0drv/linux/memobj-r0drv-linux.c.new 2017-08-09 17:33:08.004000000 +0200
@@ -1101,7 +1101,7 @@
 # endif
                                 );
 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
- rc = get_user_pages(pTask, /* Task for fault accounting. */ + rc = get_user_pages_remote(pTask, /* Task for fault accounting. */
                                 pTask->mm, /* Whose pages. */
                                 R3Ptr,                  /* Where from. */
                                 cPages,                 /* How many pages. */

Perhaps this needs to be #ifdef'ed further based on kernel versions.

Regards,
Ingmar
_______________________________________________
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to