{"id":1834,"date":"2016-10-24T07:14:25","date_gmt":"2016-10-24T06:14:25","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=1834"},"modified":"2016-10-24T07:14:25","modified_gmt":"2016-10-24T06:14:25","slug":"kernel-4-9-rc2-breaks-vmware-and-nvidia-patch-for-nvidia","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=1834","title":{"rendered":"Kernel &#8211; 4.9-rc2 Breaks VMware and NVIDIA &#8211; Patch for NVIDIA.."},"content":{"rendered":"<p>Updated the test system to Kernel <strong>4.9-rc2<\/strong>, and both VMware (<strong>12.5.0<\/strong>) and NVIDIA (<strong>370.28<\/strong> and <strong>375.10<\/strong>) failed to compile..<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">Fedora 25 (Workstation Edition)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Kernel 4.9.0-rc2 on an x86_64 (ttyS0)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">..............<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"># uname -a<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Linux rgtest 4.9.0-rc2 #1 SMP Sun Oct 23 20:33:10 PDT 2016 x86_64 x86_64 x86_64 GNU\/Linux<\/span><\/strong><\/pre>\n<p>NVIDIA compile fail:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">..............<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia\/os-mlock.c:120:55: error: passing argument 5 of \u2018get_user_pages\u2019 from incompatible pointer type [-Werror=incompatible-pointer-types]<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> page_count, write, force, user_pages, NULL);<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> ^~~~~~~~~~<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">In file included from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/common\/inc\/nv-pgprot.h:17:0,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/common\/inc\/nv-linux.h:17,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia\/os-mlock.c:15:<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/usr\/src\/linux-4.9-rc2\/include\/linux\/mm.h:1282:6: note: expected \u2018struct vm_area_struct **\u2019 but argument is of type \u2018struct page **\u2019<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> long get_user_pages(unsigned long start, unsigned long nr_pages,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> ^~~~~~~~~~~~~~<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">In file included from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/common\/inc\/nv-linux.h:18:0,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia\/os-mlock.c:15:<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/common\/inc\/nv-mm.h:45:41: error: too many arguments to function \u2018get_user_pages\u2019<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> #define NV_GET_USER_PAGES get_user_pages<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> ^<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia\/os-mlock.c:119:11: note: in expansion of macro \u2018NV_GET_USER_PAGES\u2019<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> ret = NV_GET_USER_PAGES((unsigned long)address,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> ^~~~~~~~~~~~~~~~~<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">In file included from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/common\/inc\/nv-pgprot.h:17:0,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/common\/inc\/nv-linux.h:17,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> from \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia\/os-mlock.c:15:<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/usr\/src\/linux-4.9-rc2\/include\/linux\/mm.h:1282:6: note: declared here<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> long get_user_pages(unsigned long start, unsigned long nr_pages,<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> ^~~~~~~~~~~~~~<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">cc1: some warnings being treated as errors<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/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<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">.......................<\/span><\/strong><\/pre>\n<p>Thanks to<em><strong> Flex1911<\/strong><\/em> on the DevTalk forum, there is already a patch for the NVIDIA problem:\u00a0 <a href=\"https:\/\/devtalk.nvidia.com\/default\/topic\/972761\/linux\/linux-4-9-git-rc1-375-10-build-errors\/\" target=\"_blank\">https:\/\/devtalk.nvidia.com\/default\/topic\/972761\/linux\/linux-4-9-git-rc1-375-10-build-errors\/<\/a>\u00a0\u00a0\u00a0 This was actually for a later <em>4.9rc1 git<\/em> version, but I have applied it to <strong>370.28, <\/strong>and this now compiles successfully on 4.9-rc2..:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\"> ..........................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Building modules, stage 2.<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> MODPOST 4 modules<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> CC \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia-drm.mod.o<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> LD [M] \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia-drm.ko<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> CC \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia-modeset.mod.o<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> LD [M] \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia-modeset.ko<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> CC \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia-uvm.mod.o<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> LD [M] \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia-uvm.ko<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> CC \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia.mod.o<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> LD [M] \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia.ko<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">make[2]: Leaving directory '\/usr\/src\/linux-4.9-rc2'<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">make[1]: Leaving directory '\/usr\/src\/linux-4.9-rc2'<\/span><\/strong><\/pre>\n<p>VMware compile fail:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">CC [M] \/tmp\/modconfig-erKppl\/vmmon-only\/common\/cpuid.o\r\n\/tmp\/modconfig-erKppl\/vmmon-only\/linux\/hostif.c: In function \u2018HostIFGetUserPages\u2019:\r\n\/tmp\/modconfig-erKppl\/vmmon-only\/linux\/hostif.c:1166:67: error: passing argument 5 of \u2018get_user_pages\u2019 from incompatible pointer type [-Werror=incompatible-pointer-types]\r\n retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);\r\n ^~~~~~\r\nIn file included from \/tmp\/modconfig-erKppl\/vmmon-only\/.\/include\/compat_page.h:23:0,\r\n from \/tmp\/modconfig-erKppl\/vmmon-only\/linux\/hostif.c:32:\r\n.\/include\/linux\/mm.h:1282:6: note: expected \u2018struct vm_area_struct **\u2019 but argument is of type \u2018struct page **\u2019\r\n long get_user_pages(unsigned long start, unsigned long nr_pages,\r\n ^~~~~~~~~~~~~~\r\n\/tmp\/modconfig-erKppl\/vmmon-only\/linux\/hostif.c:1166:13: error: too many arguments to function \u2018get_user_pages\u2019\r\n retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);\r\n ^~~~~~~~~~~~~~\r\nIn file included from \/tmp\/modconfig-erKppl\/vmmon-only\/.\/include\/compat_page.h:23:0,\r\n from \/tmp\/modconfig-erKppl\/vmmon-only\/linux\/hostif.c:32:\r\n.\/include\/linux\/mm.h:1282:6: note: declared here\r\n long get_user_pages(unsigned long start, unsigned long nr_pages,\r\n ^~~~~~~~~~~~~~\r\ncc1: some warnings being treated as errors\r\nscripts\/Makefile.build:290: recipe for target '\/tmp\/modconfig-erKppl\/vmmon-only\/linux\/hostif.o' failed\r\nmake[2]: *** [\/tmp\/modconfig-erKppl\/vmmon-only\/linux\/hostif.o] Error 1\r\nmake[2]: *** Waiting for unfinished jobs....\r\n\/tmp\/modconfig-erKppl\/vmmon-only\/linux\/driver.c:1283:1: warning: always_inline function might not be inlinable [-Wattributes]\r\n LinuxDriverSyncReadTSCs(uint64 *delta) \/\/ OUT: TSC max - TSC min\r\n ^~~~~~~~~~~~~~~~~~~~~~~\r\nMakefile:1482: recipe for target '_module_\/tmp\/modconfig-erKppl\/vmmon-only' failed\r\nmake[1]: *** [_module_\/tmp\/modconfig-erKppl\/vmmon-only] Error 2\r\nmake[1]: Leaving directory '\/usr\/src\/linux-4.9-rc2'\r\nMakefile:120: recipe for target 'vmmon.ko' failed\r\nmake: *** [vmmon.ko] Error 2\r\nmake: Leaving directory '\/tmp\/modconfig-erKppl\/vmmon-only'\r\nmake: Entering directory '\/tmp\/modconfig-erKppl\/vmnet-only'\r\nUsing kernel build system.\r\n\/usr\/bin\/make -C \/lib\/modules\/4.9.0-rc2\/build\/include\/.. SUBDIRS=$PWD SRCROOT=$PWD\/. \\\r\n MODULEBUILDDIR= modules\r\nmake[1]: Entering directory '\/usr\/src\/linux-4.9-rc2'\r\n CC [M] \/tmp\/modconfig-erKppl\/vmnet-only\/driver.o\r\n CC [M] \/tmp\/modconfig-erKppl\/vmnet-only\/hub.o\r\n CC [M] \/tmp\/modconfig-erKppl\/vmnet-only\/userif.o\r\n CC [M] \/tmp\/modconfig-erKppl\/vmnet-only\/netif.o\r\n\/tmp\/modconfig-erKppl\/vmnet-only\/userif.c: In function \u2018UserifLockPage\u2019:\r\n\/tmp\/modconfig-erKppl\/vmnet-only\/userif.c:117:43: error: passing argument 5 of \u2018get_user_pages\u2019 from incompatible pointer type [-Werror=incompatible-pointer-types]\r\n retval = get_user_pages(addr, 1, 1, 0, &amp;page, NULL);\r\n ^\r\nIn file included from .\/include\/linux\/highmem.h:7:0,\r\n from \/tmp\/modconfig-erKppl\/vmnet-only\/userif.c:26:\r\n.\/include\/linux\/mm.h:1282:6: note: expected \u2018struct vm_area_struct **\u2019 but argument is of type \u2018struct page **\u2019\r\n long get_user_pages(unsigned long start, unsigned long nr_pages,\r\n ^~~~~~~~~~~~~~\r\n\/tmp\/modconfig-erKppl\/vmnet-only\/userif.c:117:13: error: too many arguments to function \u2018get_user_pages\u2019\r\n retval = get_user_pages(addr, 1, 1, 0, &amp;page, NULL);\r\n ^~~~~~~~~~~~~~\r\nIn file included from .\/include\/linux\/highmem.h:7:0,\r\n from \/tmp\/modconfig-erKppl\/vmnet-only\/userif.c:26:\r\n.\/include\/linux\/mm.h:1282:6: note: declared here\r\n long get_user_pages(unsigned long start, unsigned long nr_pages,\r\n ^~~~~~~~~~~~~~\r\ncc1: some warnings being treated as errors\r\nscripts\/Makefile.build:290: recipe for target '\/tmp\/modconfig-erKppl\/vmnet-only\/userif.o' failed\r\nmake[2]: *** [\/tmp\/modconfig-erKppl\/vmnet-only\/userif.o] Error 1\r\nmake[2]: *** Waiting for unfinished jobs....\r\nIn file included from .\/include\/linux\/pci.h:35:0,\r\n from \/tmp\/modconfig-erKppl\/vmnet-only\/compat_netdevice.h:27,\r\n from \/tmp\/modconfig-erKppl\/vmnet-only\/netif.c:43:\r\n.\/include\/linux\/pci_ids.h:2253:0: warning: \"PCI_VENDOR_ID_VMWARE\" redefined\r\n #define PCI_VENDOR_ID_VMWARE 0x15ad\r\n \r\nIn file included from \/tmp\/modconfig-erKppl\/vmnet-only\/net.h:38:0,\r\n from \/tmp\/modconfig-erKppl\/vmnet-only\/vnetInt.h:26,\r\n from \/tmp\/modconfig-erKppl\/vmnet-only\/netif.c:42:\r\n\/tmp\/modconfig-erKppl\/vmnet-only\/vm_device_version.h:56:0: note: this is the location of the previous definition\r\n #define PCI_VENDOR_ID_VMWARE 0x15AD\r\n \r\nMakefile:1482: recipe for target '_module_\/tmp\/modconfig-erKppl\/vmnet-only' failed\r\nmake[1]: *** [_module_\/tmp\/modconfig-erKppl\/vmnet-only] Error 2\r\nmake[1]: Leaving directory '\/usr\/src\/linux-4.9-rc2'\r\nMakefile:120: recipe for target 'vmnet.ko' failed\r\nmake: *** [vmnet.ko] Error 2\r\nmake: Leaving directory '\/tmp\/modconfig-erKppl\/vmnet-only'\r\nUnable to install all modules. See log for details.<\/span><\/strong><\/pre>\n<p>The <strong><span style=\"font-family: courier new,courier;\">\u2018get_user_pages\u2019<\/span> <\/strong>error sounded very familiar, and appears to be yet another change to that function, as mentioned in the notes for 4.9-rc2:<\/p>\n<pre><span style=\"font-family: arial,helvetica,sans-serif;\"><strong>Lorenzo Stoakes (10):<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>      mm: remove write\/force parameters from __get_user_pages_locked()<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>      mm: remove write\/force parameters from __get_user_pages_unlocked()<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>      mm: replace get_user_pages_unlocked() write\/force parameters<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>with gup_flags<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>      mm: replace get_user_pages_locked() write\/force parameters with gup_flags<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>      mm: replace get_vaddr_frames() write\/force parameters with gup_flags<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>      mm: replace get_user_pages() write\/force parameters with gup_flags<\/strong><\/span>\r\n<span style=\"font-family: arial,helvetica,sans-serif;\"><strong>      mm: replace get_user_pages_remote() write\/force parameters with gup_flags<\/strong><\/span><\/pre>\n<p>This would <em>appear<\/em> to be relatively simple to fix, and so I will try to find some more references, and do some more testing&#8230;<\/p>\n<p><em>Robert Gadsdon.\u00a0\u00a0 October 23, 2016<\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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) &#8230;&#8230;&#8230;&#8230;.. # 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: &#8230;&#8230;&#8230;&#8230;.. \/home\/rgadsdon\/kernel\/NVIDIA-Linux-x86_64-370.28\/kernel\/nvidia\/os-mlock.c:120:55: error: passing argument 5 <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=1834\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5,6,11,14,15,18,19,25],"tags":[1470,1471,1469,280,405],"class_list":["post-1834","post","type-post","status-publish","format-standard","hentry","category-compilation","category-crash-and-burn","category-hacks","category-kernel","category-linux-2","category-nvidia","category-opinion","category-vmware","tag-fix-for-nvidia","tag-get_user_pages-changed","tag-kernel-4-9-rc2","tag-nvidia-compile-fail","tag-vmware-compile-fail"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1834"}],"version-history":[{"count":3,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1834\/revisions"}],"predecessor-version":[{"id":1837,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1834\/revisions\/1837"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}