Kernel – 4.9-rc2 Breaks VMware and NVIDIA – Patch for NVIDIA..
Updated the test system to Kernel 4.9-rc2, and both VMware (12.5.0) and NVIDIA (370.28 and 375.10) failed to compile..
Fedora 25 (Workstation Edition) Kernel 4.9.0-rc2 on an x86_64 (ttyS0) .............. # uname -a Linux rgtest 4.9.0-rc2 #1 SMP Sun Oct 23 20:33:10 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux
NVIDIA compile fail:
.............. /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia/os-mlock.c:120:55: error: passing argument 5 of ‘get_user_pages’ from incompatible pointer type [-Werror=incompatible-pointer-types] page_count, write, force, user_pages, NULL); ^~~~~~~~~~ In file included from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/common/inc/nv-pgprot.h:17:0, from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/common/inc/nv-linux.h:17, from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia/os-mlock.c:15: /usr/src/linux-4.9-rc2/include/linux/mm.h:1282:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’ long get_user_pages(unsigned long start, unsigned long nr_pages, ^~~~~~~~~~~~~~ In file included from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/common/inc/nv-linux.h:18:0, from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia/os-mlock.c:15: /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/common/inc/nv-mm.h:45:41: error: too many arguments to function ‘get_user_pages’ #define NV_GET_USER_PAGES get_user_pages ^ /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia/os-mlock.c:119:11: note: in expansion of macro ‘NV_GET_USER_PAGES’ ret = NV_GET_USER_PAGES((unsigned long)address, ^~~~~~~~~~~~~~~~~ In file included from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/common/inc/nv-pgprot.h:17:0, from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/common/inc/nv-linux.h:17, from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia/os-mlock.c:15: /usr/src/linux-4.9-rc2/include/linux/mm.h:1282:6: note: declared here long get_user_pages(unsigned long start, unsigned long nr_pages, ^~~~~~~~~~~~~~ cc1: some warnings being treated as errors /usr/src/linux-4.9-rc2/scripts/Makefile.build:290: recipe for target '/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia/os-mlock.o' failed .......................
Thanks to Flex1911 on the DevTalk forum, there is already a patch for the NVIDIA problem: https://devtalk.nvidia.com/default/topic/972761/linux/linux-4-9-git-rc1-375-10-build-errors/ This was actually for a later 4.9rc1 git version, but I have applied it to 370.28, and this now compiles successfully on 4.9-rc2..:
.......................... Building modules, stage 2. MODPOST 4 modules CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia-drm.mod.o LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia-drm.ko CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia-modeset.mod.o LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia-modeset.ko CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia-uvm.mod.o LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia-uvm.ko CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia.mod.o LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-370.28/kernel/nvidia.ko make[2]: Leaving directory '/usr/src/linux-4.9-rc2' make[1]: Leaving directory '/usr/src/linux-4.9-rc2'
VMware compile fail:
CC [M] /tmp/modconfig-erKppl/vmmon-only/common/cpuid.o
/tmp/modconfig-erKppl/vmmon-only/linux/hostif.c: In function ‘HostIFGetUserPages’:
/tmp/modconfig-erKppl/vmmon-only/linux/hostif.c:1166:67: error: passing argument 5 of ‘get_user_pages’ from incompatible pointer type [-Werror=incompatible-pointer-types]
retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
^~~~~~
In file included from /tmp/modconfig-erKppl/vmmon-only/./include/compat_page.h:23:0,
from /tmp/modconfig-erKppl/vmmon-only/linux/hostif.c:32:
./include/linux/mm.h:1282:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
/tmp/modconfig-erKppl/vmmon-only/linux/hostif.c:1166:13: error: too many arguments to function ‘get_user_pages’
retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
^~~~~~~~~~~~~~
In file included from /tmp/modconfig-erKppl/vmmon-only/./include/compat_page.h:23:0,
from /tmp/modconfig-erKppl/vmmon-only/linux/hostif.c:32:
./include/linux/mm.h:1282:6: note: declared here
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:290: recipe for target '/tmp/modconfig-erKppl/vmmon-only/linux/hostif.o' failed
make[2]: *** [/tmp/modconfig-erKppl/vmmon-only/linux/hostif.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/tmp/modconfig-erKppl/vmmon-only/linux/driver.c:1283:1: warning: always_inline function might not be inlinable [-Wattributes]
LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
^~~~~~~~~~~~~~~~~~~~~~~
Makefile:1482: recipe for target '_module_/tmp/modconfig-erKppl/vmmon-only' failed
make[1]: *** [_module_/tmp/modconfig-erKppl/vmmon-only] Error 2
make[1]: Leaving directory '/usr/src/linux-4.9-rc2'
Makefile:120: recipe for target 'vmmon.ko' failed
make: *** [vmmon.ko] Error 2
make: Leaving directory '/tmp/modconfig-erKppl/vmmon-only'
make: Entering directory '/tmp/modconfig-erKppl/vmnet-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/4.9.0-rc2/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-4.9-rc2'
CC [M] /tmp/modconfig-erKppl/vmnet-only/driver.o
CC [M] /tmp/modconfig-erKppl/vmnet-only/hub.o
CC [M] /tmp/modconfig-erKppl/vmnet-only/userif.o
CC [M] /tmp/modconfig-erKppl/vmnet-only/netif.o
/tmp/modconfig-erKppl/vmnet-only/userif.c: In function ‘UserifLockPage’:
/tmp/modconfig-erKppl/vmnet-only/userif.c:117:43: error: passing argument 5 of ‘get_user_pages’ from incompatible pointer type [-Werror=incompatible-pointer-types]
retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
^
In file included from ./include/linux/highmem.h:7:0,
from /tmp/modconfig-erKppl/vmnet-only/userif.c:26:
./include/linux/mm.h:1282:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
/tmp/modconfig-erKppl/vmnet-only/userif.c:117:13: error: too many arguments to function ‘get_user_pages’
retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
^~~~~~~~~~~~~~
In file included from ./include/linux/highmem.h:7:0,
from /tmp/modconfig-erKppl/vmnet-only/userif.c:26:
./include/linux/mm.h:1282:6: note: declared here
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:290: recipe for target '/tmp/modconfig-erKppl/vmnet-only/userif.o' failed
make[2]: *** [/tmp/modconfig-erKppl/vmnet-only/userif.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ./include/linux/pci.h:35:0,
from /tmp/modconfig-erKppl/vmnet-only/compat_netdevice.h:27,
from /tmp/modconfig-erKppl/vmnet-only/netif.c:43:
./include/linux/pci_ids.h:2253:0: warning: "PCI_VENDOR_ID_VMWARE" redefined
#define PCI_VENDOR_ID_VMWARE 0x15ad
In file included from /tmp/modconfig-erKppl/vmnet-only/net.h:38:0,
from /tmp/modconfig-erKppl/vmnet-only/vnetInt.h:26,
from /tmp/modconfig-erKppl/vmnet-only/netif.c:42:
/tmp/modconfig-erKppl/vmnet-only/vm_device_version.h:56:0: note: this is the location of the previous definition
#define PCI_VENDOR_ID_VMWARE 0x15AD
Makefile:1482: recipe for target '_module_/tmp/modconfig-erKppl/vmnet-only' failed
make[1]: *** [_module_/tmp/modconfig-erKppl/vmnet-only] Error 2
make[1]: Leaving directory '/usr/src/linux-4.9-rc2'
Makefile:120: recipe for target 'vmnet.ko' failed
make: *** [vmnet.ko] Error 2
make: Leaving directory '/tmp/modconfig-erKppl/vmnet-only'
Unable to install all modules. See log for details.
The ‘get_user_pages’ error sounded very familiar, and appears to be yet another change to that function, as mentioned in the notes for 4.9-rc2:
Lorenzo Stoakes (10): mm: remove write/force parameters from __get_user_pages_locked() mm: remove write/force parameters from __get_user_pages_unlocked() mm: replace get_user_pages_unlocked() write/force parameters with gup_flags mm: replace get_user_pages_locked() write/force parameters with gup_flags mm: replace get_vaddr_frames() write/force parameters with gup_flags mm: replace get_user_pages() write/force parameters with gup_flags mm: replace get_user_pages_remote() write/force parameters with gup_flags
This would appear to be relatively simple to fix, and so I will try to find some more references, and do some more testing…
Robert Gadsdon. October 23, 2016
I have a working VirtualBox driver now, but I forgot to make a backup of the sources, so I can’t make a patch. I’ll be happy to send a file for you to run diff against, though…
Thanks for the offer.. I couldn’t find any VMware vmmon/vmnet patches, so I made a quick hack myself – see latest article!
RG
No problem, but I was referring to VirtualBox, not VMWare, so my offer still stands 🙂
Thanks, but I don’t use VirtualBox..