make -f /usr/src/linux-4.14.11-gentoo/scripts/Makefile.modpost find /var/tmp/portage/x11-drivers/nvidia-drivers-387.34/work/kernel/.tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost -i ./Module.symvers -I /var/tmp/portage/x11-drivers/nvidia-drivers-387.34/work/kernel/Module.symvers -o /var/tmp/portage/x11-drivers/nvidia-drivers-387.34/work/kernel/Module.symvers -S -w -s -T - FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol 'cpu_tlbstate' make[3]: *** [/usr/src/linux-4.14.11-gentoo/scripts/Makefile.modpost:92: __modpost] Error 1 Recompiling gentoo-sources-4.14.11 with PAGE_TABLE_ISOLATION disables allows the nVidia driver to compile and install.
when 340.104, same issue too.
*** Bug 643250 has been marked as a duplicate of this bug. ***
Identical error to Chris's, and can confirm that his change, building sys-kernel/gentoo-sources-4.14.11 with # CONFIG_PAGE_TABLE_ISOLATION is not set allows x11-drivers/nvidia-drivers-387.34 to compile/install OK
Created attachment 513124 [details] 4.14.11 .config file Added kernel config
It remains to be seen how serious x86 PTI issue really is, even without an hypervisor. Considering the noise in the media and despite potential serious performance impact PAGE_TABLE_ISOLATION can became mandatory for Intel CPUs. As a personal opinion, I do not want to assume that kind of risks. Short term solution ? Nouveau ?
Short term solution that keeps PAGE_TABLE_ISOLATION=y is this: https://devtalk.nvidia.com/default/topic/1028222/lts-kernel-patch-for-intel-cpu-vulnerability-breaks-nvidia-driver/ I can confirm that applying the patch in the link allows nvidia-drivers to compile with PAGE_TABLE_ISOLATION=y on 4.14.11, and the driver seems to work fine upon booting (despite what the poster who provides the patch says, I needed to change the license in all three files and not just nv.c). I'm not going to attach it as a patch since I doubt this can be endorsed by distros but here is the text of the patch you want (in /etc/portage/patches/x11-drivers/nvidia-drivers-<VERSION>) in case the link becomes broken: diff -urN NVIDIA-Linux-x86_64-384.98/kernel/nvidia/nv.c NVIDIA-Linux-x86_64-384.98-new/kernel/nvidia/nv.c --- NVIDIA-Linux-x86_64-384.98/kernel/nvidia/nv.c 2017-10-26 23:19:51.000000000 +0000 +++ NVIDIA-Linux-x86_64-384.98-new/kernel/nvidia/nv.c 2018-01-03 11:11:11.642969571 +0000 @@ -40,7 +40,7 @@ #if (NV_BUILD_MODULE_INSTANCES != 0) #if defined(MODULE_LICENSE) -MODULE_LICENSE("NVIDIA"); +MODULE_LICENSE("GPL"); #endif #if defined(MODULE_INFO) MODULE_INFO(supported, "external"); diff -urN NVIDIA-Linux-x86_64-384.98/kernel/nvidia/nv-frontend.c NVIDIA-Linux-x86_64-384.98-new/kernel/nvidia/nv-frontend.c --- NVIDIA-Linux-x86_64-384.98/kernel/nvidia/nv-frontend.c 2017-10-26 23:19:52.000000000 +0000 +++ NVIDIA-Linux-x86_64-384.98-new/kernel/nvidia/nv-frontend.c 2018-01-03 11:11:34.569635270 +0000 @@ -15,7 +15,7 @@ #include "nv-frontend.h" #if defined(MODULE_LICENSE) -MODULE_LICENSE("NVIDIA"); +MODULE_LICENSE("GPL"); #endif #if defined(MODULE_INFO) MODULE_INFO(supported, "external"); diff -urN NVIDIA-Linux-x86_64-384.98/kernel/nvidia-modeset/nvidia-modeset-linux.c NVIDIA-Linux-x86_64-384.98-new/kernel/nvidia-modeset/nvidia-modeset-linux.c --- NVIDIA-Linux-x86_64-384.98/kernel/nvidia-modeset/nvidia-modeset-linux.c 2017-10-26 23:19:56.000000000 +0000 +++ NVIDIA-Linux-x86_64-384.98-new/kernel/nvidia-modeset/nvidia-modeset-linux.c 2018-01-03 11:12:20.209633345 +0000 @@ -1309,7 +1309,7 @@ module_exit(nvkms_exit); #if defined(MODULE_LICENSE) - MODULE_LICENSE("NVIDIA"); + MODULE_LICENSE("GPL"); #endif #if defined(MODULE_INFO) MODULE_INFO(supported, "external");
Yes, both solutions, Nick posted patch and setting EXPORT_SYMBOL(cpu_tlbstate) in /usr/src/linux/arch/x86/mm/init.c work, but only as temporarily personal workaround. Of course, no distribution can "officially" resort to that kind of fix. Thank you!
You could try out 384.111 or 390.12. Make sure you have a backup kernel in place in case it goes horribly wrong and you can't stop it from loading nvidia.ko.
I can verify that nvidia-drivers-390.12 builds and running fine with 4.11.2 with page_isolation enabled
Success building nvidia-drivers-390.12 against gentoo-sources-4.14.11-r2. Running OK so far.
(In reply to Chris Smith from comment #10) > Success building nvidia-drivers-390.12 against gentoo-sources-4.14.11-r2. > Running OK so far. Yes, with KPTI enabled.
nvidia-drivers-390.12 builds OK on gentoo-sources-4.14.11-r2
Just a note of WARNING: be very careful about running this on an AMD CPU. Those patches were not written with *gasp* alternative x86 architectures in mind. Indeed, it crashed one of my systems while loading a web browser that does some *GL stuff for *gasp* rendering web pages.
*** Bug 643362 has been marked as a duplicate of this bug. ***
(In reply to email200202 from comment #12) > nvidia-drivers-390.12 builds OK on gentoo-sources-4.14.11-r2 Confirm original bug, confirm that 390.12 builds on 4.14.11-r2, seemingly the resulting driver works okay also with bbswitch/bumblebee.
Works for me on amd64 without issues: sys-kernel/gentoo-sources-4.14.12 and x11-drivers/nvidia-drivers-390.12
https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/plain/queue-4.4/x86-tlb-drop-the-_gpl-from-the-cpu_tlbstate-export.patch https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/plain /queue-4.9/x86-tlb-drop-the-_gpl-from-the-cpu_tlbstate-export.patch https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/plain/queue-4.14/x86-tlb-drop-the-_gpl-from-the-cpu_tlbstate-export.patch
I should have posted the upstream commit. Here it is:- https://github.com/torvalds/linux/commit/1e5476815fd7.patch
The problem is fixed with kernel 4.14.13 !
fixed upstream as reported https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.14.y&id=98f42e3f849412895171d096b901bfa3ff0fe004