slackbuilds/k/kmod-nvidia/kmod-nvidia-linux-5.8.patch
Michal Cieslakiewicz 0e917c8775 k/kmod-nvidia: nvidia kernel modules added, version 390.138.
These are kernel modules from Nvidia proprietary driver, legacy version
(for older cards, supported until 2022). CUDA is not supported. Fix for
5.8 kernels is included. Module taints kernel.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2020-10-24 10:54:27 +02:00

30 lines
1.0 KiB
Diff

--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h 2020-05-14 14:29:21.000000000 +0200
+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h 2020-09-10 21:56:45.927763032 +0200
@@ -531,7 +531,11 @@
static inline void *nv_vmalloc(unsigned long size)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
void *ptr = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
+#else
+ void *ptr = __vmalloc(size, GFP_KERNEL);
+#endif
if (ptr)
NV_MEMDBG_ADD(ptr, size);
return ptr;
--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-mm.h 2020-05-14 14:29:21.000000000 +0200
+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-mm.h 2020-09-10 22:25:40.666693863 +0200
@@ -29,6 +29,12 @@
typedef int vm_fault_t;
#endif
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+/* kernel 5.8.0-rc1 renamed mmap_sem to mmap_lock */
+#define mmap_sem mmap_lock
+#endif
+
/* get_user_pages
*
* The 8-argument version of get_user_pages was deprecated by commit