commit 0742ac76b8953763a3c773614675b62093c80f1d
Author: Nicolas ViƩville <nicolas.vieville(a)uphf.fr>
Date: Fri Apr 19 19:46:54 2024 +0200
Try to fix errors and warnings for Fedora 40 and gcc14 - RFBZ#6905
Signed-off-by: Nicolas ViƩville <nicolas.vieville(a)uphf.fr>
...32-kernel-6.8-conftest_h-wait_on_bit_lock.patch | 46 +++++++
...d-0033-kernel-5.6-ioremap_nocache_removed.patch | 32 +++++
...mod-0034-kernel-5.9-dma_is_direct-removed.patch | 31 +++++
...prototype-for-nv_load_dma_map_scatterlist.patch | 29 +++++
...CPI_BUS_GET_DEVICE_PRESENT-in-conftest_sh.patch | 23 ++++
...-0037-add-RPM_CFLAGS-setup-in-conftest_sh.patch | 14 +++
...kmod-0038-workaround-NV_EFI_ENABLED-macro.patch | 13 ++
...-incompatible-function-type-nv_gpu_numa_c.patch | 33 +++++
...od-0040-fix-fallthrough-warning-nv_mmap_c.patch | 12 ++
...rototype-for-exercise_error_forwarding_va.patch | 13 ++
...NV_DO_GETTIMEOFDAY_PRESENT-in-conftest_sh.patch | 27 +++++
...ET_MEMORY_ARRAY_UC_PRESENT-in-conftest_sh.patch | 29 +++++
...CQUIRE_CONSOLE_SEM_PRESENT-in-conftest_sh.patch | 24 ++++
..._UNSAFE_FOLLOW_PFN_PRESENT-in-conftest_sh.patch | 24 ++++
...IFFIES_TO_TIMESPEC_PRESENT-in-conftest_sh.patch | 23 ++++
..._NPU2_INIT_CONTEXT_PRESENT-in-conftest_sh.patch | 27 +++++
...-0048-fix-atomic64-include-in-conftest_sh.patch | 17 +++
...0049-fix-dma_buf_map-renamed-to-iosys_map.patch | 19 +++
...ious-prototype-for-nv_pci_register_driver.patch | 12 ++
...otype-for-nvidia_init_exit_module-in-nv_c.patch | 20 ++++
...52-no-previous-prototype-for-on_nv_assert.patch | 13 ++
...53-no-previous-prototype-for-_raw_q_flush.patch | 13 ++
...revious-prototype-for-nv-ibmnpu-functions.patch | 14 +++
...revious-prototype-for-uvm_tools_init_exit.patch | 12 ++
...type-for-uvm8_test_set_prefetch_filtering.patch | 12 ++
...-no-previous-prototype-in-uvm8_va_space_c.patch | 13 ++
...-uvm_channel_manager_print_pending_pushes.patch | 13 ++
...-no-previous-prototype-in-uvm8_va_range_c.patch | 13 ++
...-previous-prototype-in-uvm8_range_group_c.patch | 37 ++++++
...prototype-in-uvm8_gpu_replayable_faults_c.patch | 12 ++
...-0062-no-previous-prototype-for-block_map.patch | 13 ++
...63-no-previous-prototype-for-try_get_ptes.patch | 13 ++
...o-previous-prototype-in-uvm8_pushbuffer_c.patch | 22 ++++
...o-previous-prototype-in-uvm8_kepler_mmu_c.patch | 12 ++
...o-previous-prototype-in-uvm8_pascal_mmu_c.patch | 12 ++
...us-prototype-for-parse_fault_entry_common.patch | 13 ++
...ype-in-uvm8_volta_access_counter_buffer_c.patch | 11 ++
...-for-va_block_set_read_duplication_locked.patch | 13 ++
...no-previous-prototype-for-map_rm_pt_range.patch | 13 ++
...previous-prototype-in-uvm8_user_channel_c.patch | 12 ++
...evious-prototype-in-uvm8_perf_thrashing_c.patch | 12 ++
...revious-prototype-in-uvm8_perf_prefetch_c.patch | 12 ++
...4-no-previous-prototype-for-test_tracking.patch | 13 ++
...evious-prototype-in-uvm8_page_tree_test_c.patch | 41 +++++++
...previous-prototype-in-uvm8_tracker_test_c.patch | 22 ++++
...no-previous-prototype-in-uvm8_push_test_c.patch | 22 ++++
...previous-prototype-in-uvm8_channel_test_c.patch | 46 +++++++
...vious-prototype-in-nvidia-modeset-linux_c.patch | 31 +++++
...vm_fault_access_type_t-in-uvm8_va_range_c.patch | 13 ++
...lt_type_t-in-uvm8_gpu_replayable_faults_c.patch | 22 ++++
...ype_t-in-uvm8_gpu_non_replayable_faults_c.patch | 13 ++
..._t-to-uvm_fault_type_t-in-uvm8_va_block_c.patch | 13 ++
...4-no-previous-prototype-in-nvlink_linux_c.patch | 11 ++
..._OBJECT_PUT_UNLOCK_PRESENT-in-conftest_sh.patch | 30 +++++
...OR_FUNCS_HAVE_MODE_IN_NAME-in-conftest_sh.patch | 24 ++++
...PRIMARY_MODE_GROUP_PRESENT-in-conftest_sh.patch | 26 ++++
...PER_CONNECTOR_DPMS_PRESENT-in-conftest_sh.patch | 26 ++++
nvidia-390xx-kmod.spec | 133 +++++++++++++++++++--
58 files changed, 1255 insertions(+), 9 deletions(-)
---
diff --git a/nvidia-390xx-kmod-0032-kernel-6.8-conftest_h-wait_on_bit_lock.patch
b/nvidia-390xx-kmod-0032-kernel-6.8-conftest_h-wait_on_bit_lock.patch
new file mode 100644
index 0000000..f4ed057
--- /dev/null
+++ b/nvidia-390xx-kmod-0032-kernel-6.8-conftest_h-wait_on_bit_lock.patch
@@ -0,0 +1,46 @@
+From f920ddf40d2df460ab822778117bcd06e3c0ba33 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville(a)uphf.fr>
+Date: Mon, 8 Apr 2024 15:43:34 +0200
+Subject: [PATCH] Linux 6.8: conftest.h fix wait_on_bit_lock function not found
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Nicolas ViƩville <nicolas.vieville(a)uphf.fr>
+---
+ conftest.sh | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/conftest.sh b/conftest.sh
+index f00a42e..beaae93 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -2792,7 +2792,12 @@ compile_test() {
+ # 2014-07-07 743162013d40ca612b4cb53d3a200dff2d9ab26e
+ #
+ echo "$CONFTEST_PREAMBLE
++ #include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
+ #include <linux/wait.h>
++#else
++ #include <linux/wait_bit.h>
++#endif
+ void conftest_wait_on_bit_lock(void) {
+ wait_on_bit_lock(NULL, 0, 0);
+ }" > conftest$$.c
+@@ -2807,7 +2812,12 @@ compile_test() {
+ fi
+
+ echo "$CONFTEST_PREAMBLE
++ #include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
+ #include <linux/wait.h>
++#else
++ #include <linux/wait_bit.h>
++#endif
+ void conftest_wait_on_bit_lock(void) {
+ wait_on_bit_lock(NULL, 0, NULL, 0);
+ }" > conftest$$.c
+--
+2.44.0
+
diff --git a/nvidia-390xx-kmod-0033-kernel-5.6-ioremap_nocache_removed.patch
b/nvidia-390xx-kmod-0033-kernel-5.6-ioremap_nocache_removed.patch
new file mode 100644
index 0000000..2ca6397
--- /dev/null
+++ b/nvidia-390xx-kmod-0033-kernel-5.6-ioremap_nocache_removed.patch
@@ -0,0 +1,32 @@
+From 78d25bd87d5ec4a509d37131defe100804afbf41 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville(a)uphf.fr>
+Date: Mon, 8 Apr 2024 16:04:49 +0200
+Subject: [PATCH] Linux 5.6: nv-linux.h ioremap_nocache replaced with ioremap
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Nicolas ViƩville <nicolas.vieville(a)uphf.fr>
+---
+ common/inc/nv-linux.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/common/inc/nv-linux.h b/common/inc/nv-linux.h
+index 2c4cb7b..295d5a8 100644
+--- a/common/inc/nv-linux.h
++++ b/common/inc/nv-linux.h
+@@ -565,7 +565,11 @@ static inline void *nv_ioremap(NvU64 phys, NvU64 size)
+ static inline void *nv_ioremap_nocache(NvU64 phys, NvU64 size)
+ {
+ #if defined(NV_IOREMAP_NOCACHE_PRESENT)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
+ void *ptr = ioremap_nocache(phys, size);
++#else
++ void *ptr = ioremap(phys, size);
++#endif
+ #else
+ void *ptr = ioremap(phys, size);
+ #endif
+--
+2.44.0
+
diff --git a/nvidia-390xx-kmod-0034-kernel-5.9-dma_is_direct-removed.patch
b/nvidia-390xx-kmod-0034-kernel-5.9-dma_is_direct-removed.patch
new file mode 100644
index 0000000..a0f6725
--- /dev/null
+++ b/nvidia-390xx-kmod-0034-kernel-5.9-dma_is_direct-removed.patch
@@ -0,0 +1,31 @@
+From c36f010b25237eda4919950f622f0a39ec5cf4c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville(a)uphf.fr>
+Date: Mon, 8 Apr 2024 17:42:05 +0200
+Subject: [PATCH] Linux 5.9: nv-linux.h dma_is_direct no longer available
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Nicolas ViƩville <nicolas.vieville(a)uphf.fr>
+---
+ common/inc/nv-linux.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/common/inc/nv-linux.h b/common/inc/nv-linux.h
+index 295d5a8..d35d064 100644
+--- a/common/inc/nv-linux.h
++++ b/common/inc/nv-linux.h
+@@ -1298,8 +1298,10 @@ static inline NvBool nv_is_dma_direct(struct device *dev)
+ NvBool is_direct = NV_FALSE;
+
+ #if defined(NV_DMA_IS_DIRECT_PRESENT)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
+ if (dma_is_direct(get_dma_ops(dev)))
+ is_direct = NV_TRUE;
++#endif
+ #endif
+
+ return is_direct;
+--
+2.44.0
+
diff --git
a/nvidia-390xx-kmod-0035-gcc14-no-previous-prototype-for-nv_load_dma_map_scatterlist.patch
b/nvidia-390xx-kmod-0035-gcc14-no-previous-prototype-for-nv_load_dma_map_scatterlist.patch
new file mode 100644
index 0000000..5c967d1
--- /dev/null
+++
b/nvidia-390xx-kmod-0035-gcc14-no-previous-prototype-for-nv_load_dma_map_scatterlist.patch
@@ -0,0 +1,29 @@
+From ed6fe9cb91526948f3de903d8ad866f2fda4ef91 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville(a)uphf.fr>
+Date: Mon, 8 Apr 2024 17:48:38 +0200
+Subject: [PATCH] gcc14: no previous prototype for nv_load_dma_map_scatterlist
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Nicolas ViƩville <nicolas.vieville(a)uphf.fr>
+---
+ nvidia/nv-dma.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nvidia/nv-dma.c b/nvidia/nv-dma.c
+index a06c12c..343e878 100644
+--- a/nvidia/nv-dma.c
++++ b/nvidia/nv-dma.c
+@@ -221,7 +221,7 @@ void nv_destroy_dma_map_scatterlist(nv_dma_map_t *dma_map)
+ os_free_mem(dma_map->mapping.discontig.submaps);
+ }
+
+-void nv_load_dma_map_scatterlist(
++static void nv_load_dma_map_scatterlist(
+ nv_dma_map_t *dma_map,
+ NvU64 *va_array
+ )
+--
+2.44.0
+
diff --git
a/nvidia-390xx-kmod-0036-undef-NV_ACPI_BUS_GET_DEVICE_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0036-undef-NV_ACPI_BUS_GET_DEVICE_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..5631379
--- /dev/null
+++ b/nvidia-390xx-kmod-0036-undef-NV_ACPI_BUS_GET_DEVICE_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,23 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..96b289b 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -4451,12 +4451,13 @@ compile_test() {
+ # ("ACPI: bus: Eliminate acpi_bus_get_device()") in
+ # v5.18-rc2 (2022-04-05).
+ #
+- CODE="
++ #CODE="
+ #include <linux/acpi.h>
+- int conftest_acpi_bus_get_device(void) {
+- return acpi_bus_get_device();
+- }"
+- compile_check_conftest "$CODE"
"NV_ACPI_BUS_GET_DEVICE_PRESENT" "" "functions"
++ #int conftest_acpi_bus_get_device(void) {
++ # return acpi_bus_get_device();
++ #}"
++ #compile_check_conftest "$CODE"
"NV_ACPI_BUS_GET_DEVICE_PRESENT" "" "functions"
++ echo "#undef NV_ACPI_BUS_GET_DEVICE_PRESENT" | append_conftest
"functions"
+ ;;
+
+ dma_resv_add_fence)
diff --git a/nvidia-390xx-kmod-0037-add-RPM_CFLAGS-setup-in-conftest_sh.patch
b/nvidia-390xx-kmod-0037-add-RPM_CFLAGS-setup-in-conftest_sh.patch
new file mode 100644
index 0000000..d2d6265
--- /dev/null
+++ b/nvidia-390xx-kmod-0037-add-RPM_CFLAGS-setup-in-conftest_sh.patch
@@ -0,0 +1,14 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..3e69d19 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -154,6 +154,9 @@ build_cflags() {
+ BASE_CFLAGS="-O2 -D__KERNEL__ \
+ -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\"
\
+ -nostdinc -isystem $ISYSTEM"
++ if [ "x${RPM_CFLAGS}" != "x" ] ; then
++ BASE_CFLAGS="${BASE_CFLAGS} ${RPM_CFLAGS}"
++ fi
+
+ if [ "$OUTPUT" != "$SOURCES" ]; then
+ OUTPUT_CFLAGS="-I$OUTPUT/include2 -I$OUTPUT/include"
diff --git a/nvidia-390xx-kmod-0038-workaround-NV_EFI_ENABLED-macro.patch
b/nvidia-390xx-kmod-0038-workaround-NV_EFI_ENABLED-macro.patch
new file mode 100644
index 0000000..b82de2d
--- /dev/null
+++ b/nvidia-390xx-kmod-0038-workaround-NV_EFI_ENABLED-macro.patch
@@ -0,0 +1,13 @@
+diff --git a/common/inc/nv-linux.h b/common/inc/nv-linux.h
+index d35d064..16c7fbe 100644
+--- a/common/inc/nv-linux.h
++++ b/common/inc/nv-linux.h
+@@ -220,7 +220,7 @@ static inline uid_t __kuid_val(kuid_t uid)
+ #error "NV_EFI_ENABLED_ARGUMENT_COUNT value unrecognized!"
+ #endif
+ #elif (defined(NV_EFI_ENABLED_PRESENT) || defined(efi_enabled))
+-#define NV_EFI_ENABLED() efi_enabled
++#define NV_EFI_ENABLED() efi_enabled(0)
+ #else
+ #define NV_EFI_ENABLED() 0
+ #endif
diff --git a/nvidia-390xx-kmod-0039-incompatible-function-type-nv_gpu_numa_c.patch
b/nvidia-390xx-kmod-0039-incompatible-function-type-nv_gpu_numa_c.patch
new file mode 100644
index 0000000..847fdc4
--- /dev/null
+++ b/nvidia-390xx-kmod-0039-incompatible-function-type-nv_gpu_numa_c.patch
@@ -0,0 +1,33 @@
+diff --git a/nvidia/nv-gpu-numa.c b/nvidia/nv-gpu-numa.c
+index 7916d35..646cc0d 100644
+--- a/nvidia/nv-gpu-numa.c
++++ b/nvidia/nv-gpu-numa.c
+@@ -177,6 +177,19 @@ static int filldir_get_memblock_id(struct dir_context *ctx,
+ return 0;
+ }
+
++// Wrapper function to cast between incompatible function types from:
++// int (*)(struct dir_context *, const char *, int, loff_t, u64, unsigned int) to
++// bool (*)(struct dir_context *, const char *, int, loff_t, u64, unsigned int)
++static bool b_filldir_get_memblock_id(struct dir_context *ctx,
++ const char *name,
++ int name_len,
++ loff_t offset,
++ u64 ino,
++ unsigned int d_type)
++{
++ return filldir_get_memblock_id(ctx, name, name_len, offset, ino, d_type);
++}
++
+ /*
+ * Brings memory block online using the sysfs memory-hotplug interface
+ *
https://www.kernel.org/doc/Documentation/memory-hotplug.txt
+@@ -229,7 +242,7 @@ static NV_STATUS gather_memblock_ids_for_node
+ char numa_file_path[BUF_SIZE];
+ struct file *filp;
+ int err;
+- nv_dir_context_t ats_ctx = { .ctx.actor = (filldir_t)filldir_get_memblock_id };
++ nv_dir_context_t ats_ctx = { .ctx.actor = (filldir_t)b_filldir_get_memblock_id };
+
+ memset(numa_file_path, 0, sizeof(numa_file_path));
+ sprintf(numa_file_path, "%s%d", NID_PATH, node_id);
diff --git a/nvidia-390xx-kmod-0040-fix-fallthrough-warning-nv_mmap_c.patch
b/nvidia-390xx-kmod-0040-fix-fallthrough-warning-nv_mmap_c.patch
new file mode 100644
index 0000000..c6a7a04
--- /dev/null
+++ b/nvidia-390xx-kmod-0040-fix-fallthrough-warning-nv_mmap_c.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia/nv-mmap.c b/nvidia/nv-mmap.c
+index dcb8b89..b75b7a2 100644
+--- a/nvidia/nv-mmap.c
++++ b/nvidia/nv-mmap.c
+@@ -261,6 +261,7 @@ int nv_encode_caching(
+ case NV_MEMORY_CACHED:
+ if (NV_ALLOW_CACHING(memory_type))
+ break;
++ fallthrough;
+ default:
+ nv_printf(NV_DBG_ERRORS,
+ "NVRM: VM: cache type %d not supported for memory type
%d!\n",
diff --git
a/nvidia-390xx-kmod-0041-no-previous-prototype-for-exercise_error_forwarding_va.patch
b/nvidia-390xx-kmod-0041-no-previous-prototype-for-exercise_error_forwarding_va.patch
new file mode 100644
index 0000000..3d0a137
--- /dev/null
+++ b/nvidia-390xx-kmod-0041-no-previous-prototype-for-exercise_error_forwarding_va.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia/nv-procfs.c b/nvidia/nv-procfs.c
+index 167b21f..aed7717 100644
+--- a/nvidia/nv-procfs.c
++++ b/nvidia/nv-procfs.c
+@@ -426,7 +426,7 @@ static nv_proc_ops_t nv_procfs_registry_fops = {
+ /*
+ * Forwards error to nv_log_error which exposes data to vendor callback
+ */
+-void
++static void
+ exercise_error_forwarding_va(
+ nv_state_t *nv,
+ NvU32 err,
diff --git a/nvidia-390xx-kmod-0042-undef-NV_DO_GETTIMEOFDAY_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0042-undef-NV_DO_GETTIMEOFDAY_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..f537faf
--- /dev/null
+++ b/nvidia-390xx-kmod-0042-undef-NV_DO_GETTIMEOFDAY_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,27 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..d4a190a 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -3717,16 +3717,17 @@ compile_test() {
+ # 97fc79f97b1111c80010d34ee66312b88f531e41 (2006-06-09) in v2.6.16,
+ # includes linux/time.h and/or linux/timekeeping.h.
+ #
+- CODE="
++ #CODE="
+ #include <linux/time.h>
+ #if defined(NV_LINUX_KTIME_H_PRESENT)
+ #include <linux/ktime.h>
+ #endif
+- void conftest_do_gettimeofday(void) {
+- do_gettimeofday();
+- }"
++ #void conftest_do_gettimeofday(void) {
++ # do_gettimeofday();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_DO_GETTIMEOFDAY_PRESENT" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_DO_GETTIMEOFDAY_PRESENT" "" "functions"
++ echo "#undef NV_DO_GETTIMEOFDAY_PRESENT" | append_conftest
"functions"
+ ;;
+
+ drm_framebuffer_get)
diff --git
a/nvidia-390xx-kmod-0043-undef-NV_SET_MEMORY_ARRAY_UC_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0043-undef-NV_SET_MEMORY_ARRAY_UC_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..1192db8
--- /dev/null
+++ b/nvidia-390xx-kmod-0043-undef-NV_SET_MEMORY_ARRAY_UC_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,29 @@
+index beaae93..9fa9c74 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -453,7 +453,7 @@ compile_test() {
+ #
+ # Determine if the set_memory_array_uc() function is present.
+ #
+- CODE="
++ #CODE="
+ #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
+ #if defined(NV_ASM_PGTABLE_TYPES_H_PRESENT)
+ #include <asm/pgtable_types.h>
+@@ -462,11 +462,12 @@ compile_test() {
+ #else
+ #include <asm/cacheflush.h>
+ #endif
+- void conftest_set_memory_array_uc(void) {
+- set_memory_array_uc();
+- }"
++ #void conftest_set_memory_array_uc(void) {
++ # set_memory_array_uc();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_SET_MEMORY_ARRAY_UC_PRESENT" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_SET_MEMORY_ARRAY_UC_PRESENT" "" "functions"
++ echo "#undef NV_SET_MEMORY_ARRAY_UC_PRESENT" | append_conftest
"functions"
+ ;;
+
+ sysfs_slab_unlink)
diff --git
a/nvidia-390xx-kmod-0044-undef-NV_ACQUIRE_CONSOLE_SEM_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0044-undef-NV_ACQUIRE_CONSOLE_SEM_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..1217f00
--- /dev/null
+++ b/nvidia-390xx-kmod-0044-undef-NV_ACQUIRE_CONSOLE_SEM_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,24 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..59a3985 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -895,13 +895,14 @@ compile_test() {
+ # Determine if the acquire_console_sem() function
+ # is present.
+ #
+- CODE="
++ #CODE="
+ #include <linux/console.h>
+- void conftest_acquire_console_sem(void) {
+- acquire_console_sem(NULL);
+- }"
++ #void conftest_acquire_console_sem(void) {
++ # acquire_console_sem(NULL);
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_ACQUIRE_CONSOLE_SEM_PRESENT" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_ACQUIRE_CONSOLE_SEM_PRESENT" "" "functions"
++ echo "#undef NV_ACQUIRE_CONSOLE_SEM_PRESENT" | append_conftest
"functions"
+ ;;
+
+ console_lock)
diff --git
a/nvidia-390xx-kmod-0045-undef-NV_UNSAFE_FOLLOW_PFN_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0045-undef-NV_UNSAFE_FOLLOW_PFN_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..43bdd16
--- /dev/null
+++ b/nvidia-390xx-kmod-0045-undef-NV_UNSAFE_FOLLOW_PFN_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,24 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..e06b27e 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -4380,13 +4380,14 @@ compile_test() {
+ # unsafe_follow_pfn() was added by commit 69bacee7f9ad
+ # ("mm: Add unsafe_follow_pfn") in v5.13-rc1.
+ #
+- CODE="
++ #CODE="
+ #include <linux/mm.h>
+- void conftest_unsafe_follow_pfn(void) {
+- unsafe_follow_pfn();
+- }"
++ #void conftest_unsafe_follow_pfn(void) {
++ # unsafe_follow_pfn();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_UNSAFE_FOLLOW_PFN_PRESENT" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_UNSAFE_FOLLOW_PFN_PRESENT" "" "functions"
++ echo "#undef NV_UNSAFE_FOLLOW_PFN_PRESENT" | append_conftest
"functions"
+ ;;
+
+ drm_plane_atomic_check_has_atomic_state_arg)
diff --git
a/nvidia-390xx-kmod-0046-undef-NV_JIFFIES_TO_TIMESPEC_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0046-undef-NV_JIFFIES_TO_TIMESPEC_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..3f17a37
--- /dev/null
+++ b/nvidia-390xx-kmod-0046-undef-NV_JIFFIES_TO_TIMESPEC_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,23 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..289c0c1 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -2542,12 +2542,13 @@ compile_test() {
+ # removed by commit 751addac78b6
+ # ("y2038: remove obsolete jiffies conversion functions")
+ # in v5.6-rc1 (2019-12-13).
+- CODE="
++ #CODE="
+ #include <linux/jiffies.h>
+- void conftest_jiffies_to_timespec(void){
+- jiffies_to_timespec();
+- }"
+- compile_check_conftest "$CODE"
"NV_JIFFIES_TO_TIMESPEC_PRESENT" "" "functions"
++ #void conftest_jiffies_to_timespec(void){
++ # jiffies_to_timespec();
++ #}"
++ # compile_check_conftest "$CODE"
"NV_JIFFIES_TO_TIMESPEC_PRESENT" "" "functions"
++ echo "#undef NV_JIFFIES_TO_TIMESPEC_PRESENT" | append_conftest
"functions"
+ ;;
+
+ drm_init_function_args)
diff --git
a/nvidia-390xx-kmod-0047-undef-NV_PNV_NPU2_INIT_CONTEXT_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0047-undef-NV_PNV_NPU2_INIT_CONTEXT_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..316ae7c
--- /dev/null
+++ b/nvidia-390xx-kmod-0047-undef-NV_PNV_NPU2_INIT_CONTEXT_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,27 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..386faf4 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -3312,16 +3312,17 @@ compile_test() {
+ # Determine if the pnv_npu2_init_context() function is
+ # present.
+ #
+- CODE="
++ #CODE="
+ #if defined(NV_ASM_POWERNV_H_PRESENT)
+ #include <linux/pci.h>
+ #include <asm/powernv.h>
+ #endif
+- void conftest_pnv_npu2_init_context(void) {
+- pnv_npu2_init_context();
+- }"
++ #void conftest_pnv_npu2_init_context(void) {
++ # pnv_npu2_init_context();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_PNV_NPU2_INIT_CONTEXT_PRESENT" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_PNV_NPU2_INIT_CONTEXT_PRESENT" "" "functions"
++ echo "#undef NV_PNV_NPU2_INIT_CONTEXT_PRESENT" | append_conftest
"functions"
+ ;;
+
+ drm_driver_unload_has_int_return_type)
diff --git a/nvidia-390xx-kmod-0048-fix-atomic64-include-in-conftest_sh.patch
b/nvidia-390xx-kmod-0048-fix-atomic64-include-in-conftest_sh.patch
new file mode 100644
index 0000000..177798a
--- /dev/null
+++ b/nvidia-390xx-kmod-0048-fix-atomic64-include-in-conftest_sh.patch
@@ -0,0 +1,17 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..b3865af 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -1906,7 +1906,11 @@ compile_test() {
+ atomic64_type)
+ # Determine if atomic64_t and associated functions are defined
+ CODE="
+- #include <asm/atomic.h>
++ #include <linux/init.h>
++ #include <linux/bug.h>
++ #include <linux/kernel.h>
++ #include <linux/atomic.h>
++ #include <linux/module.h>
+ void conftest_atomic64(void) {
+ atomic64_t data;
+ atomic64_read(&data);
diff --git a/nvidia-390xx-kmod-0049-fix-dma_buf_map-renamed-to-iosys_map.patch
b/nvidia-390xx-kmod-0049-fix-dma_buf_map-renamed-to-iosys_map.patch
new file mode 100644
index 0000000..c13cabf
--- /dev/null
+++ b/nvidia-390xx-kmod-0049-fix-dma_buf_map-renamed-to-iosys_map.patch
@@ -0,0 +1,19 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..6a465ef 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -4371,8 +4371,13 @@ compile_test() {
+ #
+ CODE="
+ #include <drm/drm_gem.h>
++ #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
++ typedef struct iosys_map nv_sysio_map_t;
++ #else
++ typedef struct dma_buf_map nv_sysio_map_t;
++ #endif
+ int conftest_drm_gem_object_vmap_has_map_arg(
+- struct drm_gem_object *obj, struct dma_buf_map *map) {
++ struct drm_gem_object *obj, nv_sysio_map_t *map) {
+ return obj->funcs->vmap(obj, map);
+ }"
+
diff --git a/nvidia-390xx-kmod-0050-no-previous-prototype-for-nv_pci_register_driver.patch
b/nvidia-390xx-kmod-0050-no-previous-prototype-for-nv_pci_register_driver.patch
new file mode 100644
index 0000000..19e060a
--- /dev/null
+++ b/nvidia-390xx-kmod-0050-no-previous-prototype-for-nv_pci_register_driver.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia/nv-instance.c b/nvidia/nv-instance.c
+index 33d39c2..2ebc0f5 100644
+--- a/nvidia/nv-instance.c
++++ b/nvidia/nv-instance.c
+@@ -13,6 +13,7 @@
+ #include "nv-linux.h"
+ #include "nv-frontend.h"
+ #include "nv-pci-table.h"
++#include "nv-instance.h"
+
+ #define MODULE_BASE_NAME "nvidia"
+ #define MODULE_INSTANCE_NUMBER 0
diff --git
a/nvidia-390xx-kmod-0051-no-previous-prototype-for-nvidia_init_exit_module-in-nv_c.patch
b/nvidia-390xx-kmod-0051-no-previous-prototype-for-nvidia_init_exit_module-in-nv_c.patch
new file mode 100644
index 0000000..f5646c5
--- /dev/null
+++
b/nvidia-390xx-kmod-0051-no-previous-prototype-for-nvidia_init_exit_module-in-nv_c.patch
@@ -0,0 +1,20 @@
+diff --git a/nvidia/nv.c b/nvidia/nv.c
+index ad64e88..ef655d5 100644
+--- a/nvidia/nv.c
++++ b/nvidia/nv.c
+@@ -768,6 +768,7 @@ int nv_verify_cpa_interface(void)
+ }
+ #endif /* defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) */
+
++int __init nvidia_init_module(void);
+ int __init nvidia_init_module(void)
+ {
+ NV_STATUS status;
+@@ -1165,6 +1166,7 @@ failed6:
+ return rc;
+ }
+
++void nvidia_exit_module(void);
+ void nvidia_exit_module(void)
+ {
+ nvidia_stack_t *sp = __nv_init_sp;
diff --git a/nvidia-390xx-kmod-0052-no-previous-prototype-for-on_nv_assert.patch
b/nvidia-390xx-kmod-0052-no-previous-prototype-for-on_nv_assert.patch
new file mode 100644
index 0000000..c92c5d2
--- /dev/null
+++ b/nvidia-390xx-kmod-0052-no-previous-prototype-for-on_nv_assert.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia/nv-kthread-q-selftest.c b/nvidia/nv-kthread-q-selftest.c
+index a8db326..61f01fb 100644
+--- a/nvidia/nv-kthread-q-selftest.c
++++ b/nvidia/nv-kthread-q-selftest.c
+@@ -71,7 +71,7 @@
+ #define NUM_Q_ITEMS_IN_MULTITHREAD_TEST (NUM_TEST_Q_ITEMS * NUM_TEST_KTHREADS)
+
+ // This exists in order to have a function to place a breakpoint on:
+-void on_nvq_assert(void)
++static void on_nvq_assert(void)
+ {
+ (void)NULL;
+ }
diff --git a/nvidia-390xx-kmod-0053-no-previous-prototype-for-_raw_q_flush.patch
b/nvidia-390xx-kmod-0053-no-previous-prototype-for-_raw_q_flush.patch
new file mode 100644
index 0000000..9871851
--- /dev/null
+++ b/nvidia-390xx-kmod-0053-no-previous-prototype-for-_raw_q_flush.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia/nv-kthread-q.c b/nvidia/nv-kthread-q.c
+index 9c475b7..6e4e8a3 100644
+--- a/nvidia/nv-kthread-q.c
++++ b/nvidia/nv-kthread-q.c
+@@ -241,7 +241,7 @@ static void _q_flush_function(void *args)
+ }
+
+
+-void _raw_q_flush(nv_kthread_q_t *q)
++static void _raw_q_flush(nv_kthread_q_t *q)
+ {
+ nv_kthread_q_item_t q_item;
+ DECLARE_COMPLETION(completion);
diff --git a/nvidia-390xx-kmod-0054-no-previous-prototype-for-nv-ibmnpu-functions.patch
b/nvidia-390xx-kmod-0054-no-previous-prototype-for-nv-ibmnpu-functions.patch
new file mode 100644
index 0000000..d08dec5
--- /dev/null
+++ b/nvidia-390xx-kmod-0054-no-previous-prototype-for-nv-ibmnpu-functions.patch
@@ -0,0 +1,14 @@
+diff --git a/nvidia/nv-ibmnpu.c b/nvidia/nv-ibmnpu.c
+index 50503e1..545d261 100644
+--- a/nvidia/nv-ibmnpu.c
++++ b/nvidia/nv-ibmnpu.c
+@@ -26,8 +26,8 @@
+ */
+ #include "nv-linux.h"
+
+-#if defined(NVCPU_PPC64LE)
+ #include "nv-ibmnpu.h"
++#if defined(NVCPU_PPC64LE)
+
+ #include "nvlink_common.h"
+ #include "nvlink_errors.h"
diff --git a/nvidia-390xx-kmod-0055-no-previous-prototype-for-uvm_tools_init_exit.patch
b/nvidia-390xx-kmod-0055-no-previous-prototype-for-uvm_tools_init_exit.patch
new file mode 100644
index 0000000..b13524a
--- /dev/null
+++ b/nvidia-390xx-kmod-0055-no-previous-prototype-for-uvm_tools_init_exit.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_tools.c b/nvidia-uvm/uvm8_tools.c
+index ea52194..e1b72c3 100644
+--- a/nvidia-uvm/uvm8_tools.c
++++ b/nvidia-uvm/uvm8_tools.c
+@@ -33,6 +33,7 @@
+ #include "uvm8_forward_decl.h"
+ #include "uvm8_range_group.h"
+ #include "uvm8_mem.h"
++#include "uvm8_tools_init.h"
+
+ // We limit the number of times a page can be retained by the kernel
+ // to prevent the user from maliciously passing UVM tools the same page
diff --git
a/nvidia-390xx-kmod-0056-no-previous-prototype-for-uvm8_test_set_prefetch_filtering.patch
b/nvidia-390xx-kmod-0056-no-previous-prototype-for-uvm8_test_set_prefetch_filtering.patch
new file mode 100644
index 0000000..c1b2a99
--- /dev/null
+++
b/nvidia-390xx-kmod-0056-no-previous-prototype-for-uvm8_test_set_prefetch_filtering.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_gpu.c b/nvidia-uvm/uvm8_gpu.c
+index 775dd09..66e2148 100644
+--- a/nvidia-uvm/uvm8_gpu.c
++++ b/nvidia-uvm/uvm8_gpu.c
+@@ -38,6 +38,7 @@
+ #include "ctrl2080mc.h"
+ #include "nv-kthread-q.h"
+ #include "uvm8_gpu_access_counters.h"
++#include "uvm8_test.h"
+
+ int uvm8_ats_mode = 0;
+ module_param(uvm8_ats_mode, int, S_IRUGO);
diff --git a/nvidia-390xx-kmod-0057-no-previous-prototype-in-uvm8_va_space_c.patch
b/nvidia-390xx-kmod-0057-no-previous-prototype-in-uvm8_va_space_c.patch
new file mode 100644
index 0000000..c2584df
--- /dev/null
+++ b/nvidia-390xx-kmod-0057-no-previous-prototype-in-uvm8_va_space_c.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_va_space.c b/nvidia-uvm/uvm8_va_space.c
+index 42b7bb9..0744d6b 100644
+--- a/nvidia-uvm/uvm8_va_space.c
++++ b/nvidia-uvm/uvm8_va_space.c
+@@ -34,6 +34,8 @@
+ #include "uvm_common.h"
+ #include "nv_uvm_interface.h"
+ #include "nv-kthread-q.h"
++#include "uvm8_api.h"
++#include "uvm8_test.h"
+
+ static NV_STATUS enable_peers(uvm_va_space_t *va_space, uvm_gpu_t *gpu_1, uvm_gpu_t
*gpu_2);
+ static void disable_peers(uvm_va_space_t *va_space,
diff --git
a/nvidia-390xx-kmod-0058-no-previous-prototype-for-uvm_channel_manager_print_pending_pushes.patch
b/nvidia-390xx-kmod-0058-no-previous-prototype-for-uvm_channel_manager_print_pending_pushes.patch
new file mode 100644
index 0000000..d7d87fa
--- /dev/null
+++
b/nvidia-390xx-kmod-0058-no-previous-prototype-for-uvm_channel_manager_print_pending_pushes.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_channel.c b/nvidia-uvm/uvm8_channel.c
+index ed52910..7edede9 100644
+--- a/nvidia-uvm/uvm8_channel.c
++++ b/nvidia-uvm/uvm8_channel.c
+@@ -1137,7 +1137,7 @@ void uvm_channel_print_pending_pushes(uvm_channel_t *channel)
+ channel_print_pushes(channel, 0, NULL);
+ }
+
+-void uvm_channel_manager_print_pending_pushes(uvm_channel_manager_t *manager, struct
seq_file *seq)
++static void uvm_channel_manager_print_pending_pushes(uvm_channel_manager_t *manager,
struct seq_file *seq)
+ {
+ uvm_channel_t *channel;
+
diff --git a/nvidia-390xx-kmod-0059-no-previous-prototype-in-uvm8_va_range_c.patch
b/nvidia-390xx-kmod-0059-no-previous-prototype-in-uvm8_va_range_c.patch
new file mode 100644
index 0000000..ed35a16
--- /dev/null
+++ b/nvidia-390xx-kmod-0059-no-previous-prototype-in-uvm8_va_range_c.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_va_range.c b/nvidia-uvm/uvm8_va_range.c
+index a1fb44c..9e47e40 100644
+--- a/nvidia-uvm/uvm8_va_range.c
++++ b/nvidia-uvm/uvm8_va_range.c
+@@ -559,7 +559,7 @@ NV_STATUS uvm_va_range_add_gpu_va_space(uvm_va_range_t *va_range,
uvm_gpu_va_spa
+ }
+ }
+
+-void uvm_va_range_remove_gpu_va_space_managed(uvm_va_range_t *va_range,
uvm_gpu_va_space_t *gpu_va_space)
++static void uvm_va_range_remove_gpu_va_space_managed(uvm_va_range_t *va_range,
uvm_gpu_va_space_t *gpu_va_space)
+ {
+ uvm_va_block_t *va_block;
+ uvm_va_space_t *va_space = va_range->va_space;
diff --git a/nvidia-390xx-kmod-0060-no-previous-prototype-in-uvm8_range_group_c.patch
b/nvidia-390xx-kmod-0060-no-previous-prototype-in-uvm8_range_group_c.patch
new file mode 100644
index 0000000..40a492c
--- /dev/null
+++ b/nvidia-390xx-kmod-0060-no-previous-prototype-in-uvm8_range_group_c.patch
@@ -0,0 +1,37 @@
+diff --git a/nvidia-uvm/uvm8_range_group.c b/nvidia-uvm/uvm8_range_group.c
+index 307aaa2..19760b3 100644
+--- a/nvidia-uvm/uvm8_range_group.c
++++ b/nvidia-uvm/uvm8_range_group.c
+@@ -29,6 +29,7 @@
+ #include "uvm_ioctl.h"
+ #include "uvmtypes.h"
+ #include "uvm8_api.h"
++#include "uvm8_test.h"
+
+ static struct kmem_cache *g_uvm_range_group_cache __read_mostly;
+ static struct kmem_cache *g_uvm_range_group_range_cache __read_mostly;
+@@ -506,13 +507,13 @@ static uvm_range_group_range_t
*range_group_range_container(uvm_range_tree_node_
+ return container_of(node, uvm_range_group_range_t, node);
+ }
+
+-uvm_range_group_range_t *uvm_range_group_range_prev(uvm_va_space_t *va_space,
uvm_range_group_range_t *range)
++static uvm_range_group_range_t *uvm_range_group_range_prev(uvm_va_space_t *va_space,
uvm_range_group_range_t *range)
+ {
+ uvm_range_tree_node_t *node =
uvm_range_tree_prev(&va_space->range_group_ranges, &range->node);
+ return range_group_range_container(node);
+ }
+
+-uvm_range_group_range_t *uvm_range_group_range_next(uvm_va_space_t *va_space,
uvm_range_group_range_t *range)
++static uvm_range_group_range_t *uvm_range_group_range_next(uvm_va_space_t *va_space,
uvm_range_group_range_t *range)
+ {
+ uvm_range_tree_node_t *node =
uvm_range_tree_next(&va_space->range_group_ranges, &range->node);
+ return range_group_range_container(node);
+@@ -664,7 +665,7 @@ uvm_range_group_range_t
*uvm_range_group_range_iter_next(uvm_va_space_t *va_spac
+ return range_group_range_container(node);
+ }
+
+-void range_group_range_iter_advance(uvm_range_group_range_iter_t *iter, NvU64 end)
++static void range_group_range_iter_advance(uvm_range_group_range_iter_t *iter, NvU64
end)
+ {
+ if (iter->node == NULL) {
+ iter->end = end;
diff --git
a/nvidia-390xx-kmod-0061-no-previous-prototype-in-uvm8_gpu_replayable_faults_c.patch
b/nvidia-390xx-kmod-0061-no-previous-prototype-in-uvm8_gpu_replayable_faults_c.patch
new file mode 100644
index 0000000..cf51822
--- /dev/null
+++ b/nvidia-390xx-kmod-0061-no-previous-prototype-in-uvm8_gpu_replayable_faults_c.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_gpu_replayable_faults.c
b/nvidia-uvm/uvm8_gpu_replayable_faults.c
+index f2279b6..9e1f468 100644
+--- a/nvidia-uvm/uvm8_gpu_replayable_faults.c
++++ b/nvidia-uvm/uvm8_gpu_replayable_faults.c
+@@ -35,6 +35,7 @@
+ #include "uvm8_procfs.h"
+ #include "uvm8_perf_thrashing.h"
+ #include "uvm8_gpu_non_replayable_faults.h"
++#include "uvm8_test.h"
+
+ // TODO: Bug 1881601: [uvm] Add fault handling overview for replayable and
+ // non-replayable faults
diff --git a/nvidia-390xx-kmod-0062-no-previous-prototype-for-block_map.patch
b/nvidia-390xx-kmod-0062-no-previous-prototype-for-block_map.patch
new file mode 100644
index 0000000..01e6549
--- /dev/null
+++ b/nvidia-390xx-kmod-0062-no-previous-prototype-for-block_map.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_va_block.c b/nvidia-uvm/uvm8_va_block.c
+index be6d873..6319251 100644
+--- a/nvidia-uvm/uvm8_va_block.c
++++ b/nvidia-uvm/uvm8_va_block.c
+@@ -6521,7 +6521,7 @@ static void map_get_allowed_destinations(uvm_va_block_t *block,
+ uvm_processor_mask_and(allowed_mask, allowed_mask,
&va_space->can_access[id]);
+ }
+
+-NV_STATUS block_map(uvm_va_block_t *va_block,
++static NV_STATUS block_map(uvm_va_block_t *va_block,
+ uvm_va_block_context_t *va_block_context,
+ uvm_processor_id_t id,
+ uvm_va_block_region_t region,
diff --git a/nvidia-390xx-kmod-0063-no-previous-prototype-for-try_get_ptes.patch
b/nvidia-390xx-kmod-0063-no-previous-prototype-for-try_get_ptes.patch
new file mode 100644
index 0000000..f086fd5
--- /dev/null
+++ b/nvidia-390xx-kmod-0063-no-previous-prototype-for-try_get_ptes.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_mmu.c b/nvidia-uvm/uvm8_mmu.c
+index 2b90a3c..86518f5 100644
+--- a/nvidia-uvm/uvm8_mmu.c
++++ b/nvidia-uvm/uvm8_mmu.c
+@@ -695,7 +695,7 @@ NV_STATUS uvm_page_tree_wait(uvm_page_tree_t *tree)
+ return status;
+ }
+
+-NV_STATUS try_get_ptes(uvm_page_tree_t *tree,
++static NV_STATUS try_get_ptes(uvm_page_tree_t *tree,
+ NvU32 page_size,
+ NvU64 start,
+ NvLength size,
diff --git a/nvidia-390xx-kmod-0064-no-previous-prototype-in-uvm8_pushbuffer_c.patch
b/nvidia-390xx-kmod-0064-no-previous-prototype-in-uvm8_pushbuffer_c.patch
new file mode 100644
index 0000000..53c05a7
--- /dev/null
+++ b/nvidia-390xx-kmod-0064-no-previous-prototype-in-uvm8_pushbuffer_c.patch
@@ -0,0 +1,22 @@
+diff --git a/nvidia-uvm/uvm8_pushbuffer.c b/nvidia-uvm/uvm8_pushbuffer.c
+index 3007f00..8eb686b 100644
+--- a/nvidia-uvm/uvm8_pushbuffer.c
++++ b/nvidia-uvm/uvm8_pushbuffer.c
+@@ -109,7 +109,7 @@ error:
+ return status;
+ }
+
+-NvLength uvm_pushbuffer_get_size(uvm_pushbuffer_t *pushbuffer)
++static NvLength uvm_pushbuffer_get_size(uvm_pushbuffer_t *pushbuffer)
+ {
+ return pushbuffer->memory->size;
+ }
+@@ -210,7 +210,7 @@ static NvU32 *chunk_get_next_push_start_addr(uvm_pushbuffer_t
*pushbuffer, uvm_p
+ return (NvU32*)push_start;
+ }
+
+-void uvm_pushbuffer_update_progress(uvm_pushbuffer_t *pushbuffer)
++static void uvm_pushbuffer_update_progress(uvm_pushbuffer_t *pushbuffer)
+ {
+ uvm_channel_manager_update_progress(pushbuffer->channel_manager);
+ }
diff --git a/nvidia-390xx-kmod-0065-no-previous-prototype-in-uvm8_kepler_mmu_c.patch
b/nvidia-390xx-kmod-0065-no-previous-prototype-in-uvm8_kepler_mmu_c.patch
new file mode 100644
index 0000000..c2b084b
--- /dev/null
+++ b/nvidia-390xx-kmod-0065-no-previous-prototype-in-uvm8_kepler_mmu_c.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_kepler_mmu.c b/nvidia-uvm/uvm8_kepler_mmu.c
+index ba46019..c9a1660 100644
+--- a/nvidia-uvm/uvm8_kepler_mmu.c
++++ b/nvidia-uvm/uvm8_kepler_mmu.c
+@@ -40,6 +40,7 @@
+ #include "uvm8_mmu.h"
+ #include "uvm8_push_macros.h"
+ #include "hwref/kepler/gk104/dev_mmu.h"
++#include "uvm8_hal.h"
+
+ #define MMU_BIG 0
+ #define MMU_SMALL 1
diff --git a/nvidia-390xx-kmod-0066-no-previous-prototype-in-uvm8_pascal_mmu_c.patch
b/nvidia-390xx-kmod-0066-no-previous-prototype-in-uvm8_pascal_mmu_c.patch
new file mode 100644
index 0000000..1a46377
--- /dev/null
+++ b/nvidia-390xx-kmod-0066-no-previous-prototype-in-uvm8_pascal_mmu_c.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_pascal_mmu.c b/nvidia-uvm/uvm8_pascal_mmu.c
+index b3bf7b6..5719fa4 100644
+--- a/nvidia-uvm/uvm8_pascal_mmu.c
++++ b/nvidia-uvm/uvm8_pascal_mmu.c
+@@ -38,6 +38,7 @@
+ #include "uvm8_push_macros.h"
+ #include "hwref/pascal/gp100/dev_fb.h"
+ #include "hwref/pascal/gp100/dev_mmu.h"
++#include "uvm8_hal.h"
+
+ #define MMU_BIG 0
+ #define MMU_SMALL 1
diff --git
a/nvidia-390xx-kmod-0067-no-previous-prototype-for-parse_fault_entry_common.patch
b/nvidia-390xx-kmod-0067-no-previous-prototype-for-parse_fault_entry_common.patch
new file mode 100644
index 0000000..cacc3af
--- /dev/null
+++ b/nvidia-390xx-kmod-0067-no-previous-prototype-for-parse_fault_entry_common.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_volta_fault_buffer.c b/nvidia-uvm/uvm8_volta_fault_buffer.c
+index 5ab6a81..b85352e 100644
+--- a/nvidia-uvm/uvm8_volta_fault_buffer.c
++++ b/nvidia-uvm/uvm8_volta_fault_buffer.c
+@@ -351,7 +351,7 @@ static NvU32 *get_fault_buffer_entry(uvm_gpu_t *gpu, NvU32 index)
+ return fault_entry;
+ }
+
+-void parse_fault_entry_common(uvm_gpu_t *gpu, NvU32 *fault_entry,
uvm_fault_buffer_entry_t *buffer_entry)
++static void parse_fault_entry_common(uvm_gpu_t *gpu, NvU32 *fault_entry,
uvm_fault_buffer_entry_t *buffer_entry)
+ {
+ NV_STATUS status;
+ NvU64 addr_hi, addr_lo;
diff --git
a/nvidia-390xx-kmod-0068-no-previous-prototype-in-uvm8_volta_access_counter_buffer_c.patch
b/nvidia-390xx-kmod-0068-no-previous-prototype-in-uvm8_volta_access_counter_buffer_c.patch
new file mode 100644
index 0000000..ef870a2
--- /dev/null
+++
b/nvidia-390xx-kmod-0068-no-previous-prototype-in-uvm8_volta_access_counter_buffer_c.patch
@@ -0,0 +1,11 @@
+index 992cca5..3fedfc2 100644
+--- a/nvidia-uvm/uvm8_volta_access_counter_buffer.c
++++ b/nvidia-uvm/uvm8_volta_access_counter_buffer.c
+@@ -25,6 +25,7 @@
+ #include "uvm8_gpu.h"
+ #include "clc365.h"
+ #include "uvm8_volta_fault_buffer.h"
++#include "uvm8_hal.h"
+
+ typedef struct {
+ NvU8 bufferEntry[NVC365_NOTIFY_BUF_SIZE];
diff --git
a/nvidia-390xx-kmod-0069-no-previous-prototype-for-va_block_set_read_duplication_locked.patch
b/nvidia-390xx-kmod-0069-no-previous-prototype-for-va_block_set_read_duplication_locked.patch
new file mode 100644
index 0000000..50d4022
--- /dev/null
+++
b/nvidia-390xx-kmod-0069-no-previous-prototype-for-va_block_set_read_duplication_locked.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_policy.c b/nvidia-uvm/uvm8_policy.c
+index 03b1a90..eb3523c 100644
+--- a/nvidia-uvm/uvm8_policy.c
++++ b/nvidia-uvm/uvm8_policy.c
+@@ -354,7 +354,7 @@ NV_STATUS uvm_api_unset_accessed_by(UVM_UNSET_ACCESSED_BY_PARAMS
*params, struct
+ return accessed_by_set(va_space, params->requestedBase, params->length,
¶ms->accessedByUuid, false);
+ }
+
+-NV_STATUS va_block_set_read_duplication_locked(uvm_va_block_t *va_block,
++static NV_STATUS va_block_set_read_duplication_locked(uvm_va_block_t *va_block,
+ uvm_va_block_retry_t *va_block_retry,
+ uvm_va_block_context_t
*va_block_context)
+ {
diff --git a/nvidia-390xx-kmod-0070-no-previous-prototype-for-map_rm_pt_range.patch
b/nvidia-390xx-kmod-0070-no-previous-prototype-for-map_rm_pt_range.patch
new file mode 100644
index 0000000..866daa9
--- /dev/null
+++ b/nvidia-390xx-kmod-0070-no-previous-prototype-for-map_rm_pt_range.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_map_external.c b/nvidia-uvm/uvm8_map_external.c
+index 67620a2..df5e8bd 100644
+--- a/nvidia-uvm/uvm8_map_external.c
++++ b/nvidia-uvm/uvm8_map_external.c
+@@ -275,7 +275,7 @@ static NV_STATUS copy_ptes(uvm_page_tree_t *tree,
+ //
+ // If the mapped range ends on va_range->node.end, a TLB invalidate for upgrade
+ // is also issued.
+-NV_STATUS map_rm_pt_range(uvm_va_range_t *va_range,
++static NV_STATUS map_rm_pt_range(uvm_va_range_t *va_range,
+ uvm_page_tree_t *tree,
+ uvm_page_table_range_t *pt_range,
+ uvm_pte_buffer_t *pte_buffer,
diff --git a/nvidia-390xx-kmod-0071-no-previous-prototype-in-uvm8_user_channel_c.patch
b/nvidia-390xx-kmod-0071-no-previous-prototype-in-uvm8_user_channel_c.patch
new file mode 100644
index 0000000..c327e0b
--- /dev/null
+++ b/nvidia-390xx-kmod-0071-no-previous-prototype-in-uvm8_user_channel_c.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_user_channel.c b/nvidia-uvm/uvm8_user_channel.c
+index e8906f9..7e2d30a 100644
+--- a/nvidia-uvm/uvm8_user_channel.c
++++ b/nvidia-uvm/uvm8_user_channel.c
+@@ -36,6 +36,7 @@
+ #include "uvm8_map_external.h"
+ #include "uvm8_init.h"
+ #include "nv_uvm_interface.h"
++#include "uvm8_test.h"
+
+ #include <linux/sort.h>
+
diff --git a/nvidia-390xx-kmod-0072-no-previous-prototype-in-uvm8_perf_thrashing_c.patch
b/nvidia-390xx-kmod-0072-no-previous-prototype-in-uvm8_perf_thrashing_c.patch
new file mode 100644
index 0000000..0fba389
--- /dev/null
+++ b/nvidia-390xx-kmod-0072-no-previous-prototype-in-uvm8_perf_thrashing_c.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_perf_thrashing.c b/nvidia-uvm/uvm8_perf_thrashing.c
+index 0ed3b18..5d47b0e 100644
+--- a/nvidia-uvm/uvm8_perf_thrashing.c
++++ b/nvidia-uvm/uvm8_perf_thrashing.c
+@@ -29,6 +29,7 @@
+ #include "uvm8_va_range.h"
+ #include "uvm8_kvmalloc.h"
+ #include "uvm8_tools.h"
++#include "uvm8_test.h"
+
+ // Number of bits for page-granularity time stamps. Currently we ignore the first 6
bits
+ // of the timestamp (i.e. we have 64ns resolution, which is good enough)
diff --git a/nvidia-390xx-kmod-0073-no-previous-prototype-in-uvm8_perf_prefetch_c.patch
b/nvidia-390xx-kmod-0073-no-previous-prototype-in-uvm8_perf_prefetch_c.patch
new file mode 100644
index 0000000..7014485
--- /dev/null
+++ b/nvidia-390xx-kmod-0073-no-previous-prototype-in-uvm8_perf_prefetch_c.patch
@@ -0,0 +1,12 @@
+diff --git a/nvidia-uvm/uvm8_perf_prefetch.c b/nvidia-uvm/uvm8_perf_prefetch.c
+index 4f390ee..8206d63 100644
+--- a/nvidia-uvm/uvm8_perf_prefetch.c
++++ b/nvidia-uvm/uvm8_perf_prefetch.c
+@@ -28,6 +28,7 @@
+ #include "uvm8_kvmalloc.h"
+ #include "uvm8_va_block.h"
+ #include "uvm8_va_range.h"
++#include "uvm8_test.h"
+
+ // Global cache to allocate the per-VA block prefetch detection structures
+ static struct kmem_cache *g_prefetch_info_cache __read_mostly;
diff --git a/nvidia-390xx-kmod-0074-no-previous-prototype-for-test_tracking.patch
b/nvidia-390xx-kmod-0074-no-previous-prototype-for-test_tracking.patch
new file mode 100644
index 0000000..d721d83
--- /dev/null
+++ b/nvidia-390xx-kmod-0074-no-previous-prototype-for-test_tracking.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_gpu_semaphore_test.c b/nvidia-uvm/uvm8_gpu_semaphore_test.c
+index 8b734b8..1523821 100644
+--- a/nvidia-uvm/uvm8_gpu_semaphore_test.c
++++ b/nvidia-uvm/uvm8_gpu_semaphore_test.c
+@@ -54,7 +54,7 @@ static NV_STATUS add_and_test(uvm_gpu_tracking_semaphore_t
*tracking_sem, NvU32
+ return NV_OK;
+ }
+
+-NV_STATUS test_tracking(uvm_va_space_t *va_space)
++static NV_STATUS test_tracking(uvm_va_space_t *va_space)
+ {
+ NV_STATUS status;
+ uvm_gpu_tracking_semaphore_t tracking_sem;
diff --git a/nvidia-390xx-kmod-0075-no-previous-prototype-in-uvm8_page_tree_test_c.patch
b/nvidia-390xx-kmod-0075-no-previous-prototype-in-uvm8_page_tree_test_c.patch
new file mode 100644
index 0000000..c11c15e
--- /dev/null
+++ b/nvidia-390xx-kmod-0075-no-previous-prototype-in-uvm8_page_tree_test_c.patch
@@ -0,0 +1,41 @@
+index 91861b8..9a306b5 100644
+--- a/nvidia-uvm/uvm8_page_tree_test.c
++++ b/nvidia-uvm/uvm8_page_tree_test.c
+@@ -55,7 +55,7 @@ static void fake_ce_memset_8(uvm_push_t *push, uvm_gpu_address_t dst,
NvU64 valu
+ *(NvU64 *)phys_to_virt(dst.address + i) = value;
+ }
+
+-void *cpu_addr_from_fake(uvm_gpu_address_t fake_gpu_addr)
++static void *cpu_addr_from_fake(uvm_gpu_address_t fake_gpu_addr)
+ {
+ if (fake_gpu_addr.is_virtual)
+ return (void*)fake_gpu_addr.address;
+@@ -69,16 +69,16 @@ static void fake_ce_memcopy(uvm_push_t *push, uvm_gpu_address_t dst,
uvm_gpu_add
+ memcpy(cpu_addr_from_fake(dst), cpu_addr_from_fake(src), size);
+ }
+
+-void fake_wait_for_idle(uvm_push_t *push)
++static void fake_wait_for_idle(uvm_push_t *push)
+ {
+ }
+
+-void fake_noop(uvm_push_t *push, NvU32 size)
++static void fake_noop(uvm_push_t *push, NvU32 size)
+ {
+ push->next += size / 4;
+ }
+
+-void fake_membar(uvm_push_t *push)
++static void fake_membar(uvm_push_t *push)
+ {
+ }
+
+@@ -304,7 +304,7 @@ static NV_STATUS test_page_tree_get_entry(uvm_page_tree_t *tree,
NvU32 page_size
+ return uvm_page_tree_get_entry(tree, page_size, start, UVM_PMM_ALLOC_FLAGS_NONE,
single);
+ }
+
+-NV_STATUS test_page_tree_alloc_table(uvm_page_tree_t *tree, NvU32 page_size,
++static NV_STATUS test_page_tree_alloc_table(uvm_page_tree_t *tree, NvU32 page_size,
+ uvm_page_table_range_t *single, uvm_page_table_range_t *children)
+ {
+ return uvm_page_tree_alloc_table(tree, page_size, UVM_PMM_ALLOC_FLAGS_NONE, single,
children);
diff --git a/nvidia-390xx-kmod-0076-no-previous-prototype-in-uvm8_tracker_test_c.patch
b/nvidia-390xx-kmod-0076-no-previous-prototype-in-uvm8_tracker_test_c.patch
new file mode 100644
index 0000000..ffd75ba
--- /dev/null
+++ b/nvidia-390xx-kmod-0076-no-previous-prototype-in-uvm8_tracker_test_c.patch
@@ -0,0 +1,22 @@
+diff --git a/nvidia-uvm/uvm8_tracker_test.c b/nvidia-uvm/uvm8_tracker_test.c
+index 02ce1ce..9d3ea97 100644
+--- a/nvidia-uvm/uvm8_tracker_test.c
++++ b/nvidia-uvm/uvm8_tracker_test.c
+@@ -225,7 +225,7 @@ done:
+ return status;
+ }
+
+-NV_STATUS test_tracker_overwrite(uvm_va_space_t *va_space)
++static NV_STATUS test_tracker_overwrite(uvm_va_space_t *va_space)
+ {
+ uvm_gpu_t *gpu;
+ uvm_channel_t *channel;
+@@ -313,7 +313,7 @@ done:
+ return status;
+ }
+
+-NV_STATUS test_tracker_add_tracker(uvm_va_space_t *va_space)
++static NV_STATUS test_tracker_add_tracker(uvm_va_space_t *va_space)
+ {
+ uvm_gpu_t *gpu;
+ uvm_channel_t *channel;
diff --git a/nvidia-390xx-kmod-0077-no-previous-prototype-in-uvm8_push_test_c.patch
b/nvidia-390xx-kmod-0077-no-previous-prototype-in-uvm8_push_test_c.patch
new file mode 100644
index 0000000..7718a70
--- /dev/null
+++ b/nvidia-390xx-kmod-0077-no-previous-prototype-in-uvm8_push_test_c.patch
@@ -0,0 +1,22 @@
+diff --git a/nvidia-uvm/uvm8_push_test.c b/nvidia-uvm/uvm8_push_test.c
+index 7eedb32..f00c661 100644
+--- a/nvidia-uvm/uvm8_push_test.c
++++ b/nvidia-uvm/uvm8_push_test.c
+@@ -355,7 +355,7 @@ done:
+ //
+ // Starting more than a single push is not safe to do outside of a test as if multiple
threads tried doing so,
+ // it could easily deadlock.
+-NV_STATUS test_push_interleaving(uvm_va_space_t *va_space)
++static NV_STATUS test_push_interleaving(uvm_va_space_t *va_space)
+ {
+ NV_STATUS status;
+ uvm_gpu_t *gpu;
+@@ -584,7 +584,7 @@ typedef struct
+ NvU64 timestamp;
+ } timestamp_test_t;
+
+-void timestamp_on_complete(void *void_data)
++static void timestamp_on_complete(void *void_data)
+ {
+ timestamp_test_t *data = (timestamp_test_t *)void_data;
+
diff --git a/nvidia-390xx-kmod-0078-no-previous-prototype-in-uvm8_channel_test_c.patch
b/nvidia-390xx-kmod-0078-no-previous-prototype-in-uvm8_channel_test_c.patch
new file mode 100644
index 0000000..a3ca4b4
--- /dev/null
+++ b/nvidia-390xx-kmod-0078-no-previous-prototype-in-uvm8_channel_test_c.patch
@@ -0,0 +1,46 @@
+diff --git a/nvidia-uvm/uvm8_channel_test.c b/nvidia-uvm/uvm8_channel_test.c
+index eafcf85..0bd1540 100644
+--- a/nvidia-uvm/uvm8_channel_test.c
++++ b/nvidia-uvm/uvm8_channel_test.c
+@@ -40,7 +40,7 @@
+ // increment a counter into an adjacent memory location in a buffer. And then
+ // verify that all the values are correct on the CPU.
+ // GK110+ is required for the CE semaphore reduction method.
+-NV_STATUS test_ordering(uvm_va_space_t *va_space)
++static NV_STATUS test_ordering(uvm_va_space_t *va_space)
+ {
+ NV_STATUS status;
+ uvm_gpu_t *gpu;
+@@ -295,12 +295,12 @@ static void set_counter(uvm_push_t *push, uvm_rm_mem_t
*counter_mem, NvU32 value
+ gpu->ce_hal->memset_v_4(push, counter_gpu_va, value, count * sizeof(NvU32));
+ }
+
+-uvm_channel_type_t random_channel_type(uvm_test_rng_t *rng)
++static uvm_channel_type_t random_channel_type(uvm_test_rng_t *rng)
+ {
+ return (uvm_channel_type_t)uvm_test_rng_range_32(rng, 0, UVM_CHANNEL_TYPE_COUNT -
1);
+ }
+
+-uvm_gpu_t *random_gpu(uvm_test_rng_t *rng, uvm_processor_mask_t *mask)
++static uvm_gpu_t *random_gpu(uvm_test_rng_t *rng, uvm_processor_mask_t *mask)
+ {
+ uvm_gpu_t *gpu;
+ NvU32 gpu_count = uvm_processor_mask_get_gpu_count(mask);
+@@ -314,7 +314,7 @@ uvm_gpu_t *random_gpu(uvm_test_rng_t *rng, uvm_processor_mask_t
*mask)
+ }
+
+
+-void test_memset_rm_mem(uvm_push_t *push, uvm_rm_mem_t *rm_mem, NvU32 value)
++static void test_memset_rm_mem(uvm_push_t *push, uvm_rm_mem_t *rm_mem, NvU32 value)
+ {
+ uvm_gpu_t *gpu;
+ NvU64 gpu_va;
+@@ -336,7 +336,7 @@ void test_memset_rm_mem(uvm_push_t *push, uvm_rm_mem_t *rm_mem, NvU32
value)
+ // threads and contains some schedule() calls to help get as many threads
+ // through the init phase before other threads continue. It also has a random
+ // schedule() call in the main loop scheduling GPU work.
+-NV_STATUS stress_test_all_gpus_in_va(uvm_va_space_t *va_space, NvU32 num_streams, NvU32
iterations_per_stream,
++static NV_STATUS stress_test_all_gpus_in_va(uvm_va_space_t *va_space, NvU32 num_streams,
NvU32 iterations_per_stream,
+ NvU32 seed, NvU32 verbose)
+ {
+ NV_STATUS status = NV_OK;
diff --git a/nvidia-390xx-kmod-0079-no-previous-prototype-in-nvidia-modeset-linux_c.patch
b/nvidia-390xx-kmod-0079-no-previous-prototype-in-nvidia-modeset-linux_c.patch
new file mode 100644
index 0000000..1f8234c
--- /dev/null
+++ b/nvidia-390xx-kmod-0079-no-previous-prototype-in-nvidia-modeset-linux_c.patch
@@ -0,0 +1,31 @@
+diff --git a/nvidia-modeset/nvidia-modeset-linux.c
b/nvidia-modeset/nvidia-modeset-linux.c
+index 5bed9dd..3b2b26a 100644
+--- a/nvidia-modeset/nvidia-modeset-linux.c
++++ b/nvidia-modeset/nvidia-modeset-linux.c
+@@ -762,7 +762,7 @@ static void nvkms_kapi_event_kthread_q_callback(void *arg)
+ nvKmsKapiHandleEventQueueChange(device);
+ }
+
+-struct nvkms_per_open *nvkms_open_common(enum NvKmsClientType type,
++static struct nvkms_per_open *nvkms_open_common(enum NvKmsClientType type,
+ struct NvKmsKapiDevice *device,
+ int *status)
+ {
+@@ -814,7 +814,7 @@ failed:
+ return NULL;
+ }
+
+-void NVKMS_API_CALL nvkms_close_common(struct nvkms_per_open *popen)
++static void NVKMS_API_CALL nvkms_close_common(struct nvkms_per_open *popen)
+ {
+ /*
+ * Don't use down_interruptible(): we need to free resources
+@@ -852,7 +852,7 @@ void NVKMS_API_CALL nvkms_close_common(struct nvkms_per_open *popen)
+ nvkms_free(popen, sizeof(*popen));
+ }
+
+-int NVKMS_API_CALL nvkms_ioctl_common
++static int NVKMS_API_CALL nvkms_ioctl_common
+ (
+ struct nvkms_per_open *popen,
+ NvU32 cmd, NvU64 address, const size_t size
diff --git
a/nvidia-390xx-kmod-0080-fix-enum-implicit-conversion-from-uvm_fault_type_t-to-uvm_fault_access_type_t-in-uvm8_va_range_c.patch
b/nvidia-390xx-kmod-0080-fix-enum-implicit-conversion-from-uvm_fault_type_t-to-uvm_fault_access_type_t-in-uvm8_va_range_c.patch
new file mode 100644
index 0000000..28221a7
--- /dev/null
+++
b/nvidia-390xx-kmod-0080-fix-enum-implicit-conversion-from-uvm_fault_type_t-to-uvm_fault_access_type_t-in-uvm8_va_range_c.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_va_range.c b/nvidia-uvm/uvm8_va_range.c
+index a1fb44c..b8fb02b 100644
+--- a/nvidia-uvm/uvm8_va_range.c
++++ b/nvidia-uvm/uvm8_va_range.c
+@@ -1568,7 +1568,7 @@ NV_STATUS uvm_va_range_check_logical_permissions(uvm_va_range_t
*va_range,
+ // example on mprotect) and here we are not guaranteed to have
+ // vma->vm_mm->mmap_lock. During tests we ensure that this scenario does
+ // not happen
+- if (uvm_enable_builtin_tests && !fault_check_range_permission(va_range,
access_type))
++ if (uvm_enable_builtin_tests && !fault_check_range_permission(va_range,
(uvm_fault_access_type_t) access_type))
+ return NV_ERR_INVALID_ACCESS_TYPE;
+ }
+
diff --git
a/nvidia-390xx-kmod-0081-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_replayable_faults_c.patch
b/nvidia-390xx-kmod-0081-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_replayable_faults_c.patch
new file mode 100644
index 0000000..5cd45c3
--- /dev/null
+++
b/nvidia-390xx-kmod-0081-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_replayable_faults_c.patch
@@ -0,0 +1,22 @@
+diff --git a/nvidia-uvm/uvm8_gpu_replayable_faults.c
b/nvidia-uvm/uvm8_gpu_replayable_faults.c
+index f2279b6..e67e137 100644
+--- a/nvidia-uvm/uvm8_gpu_replayable_faults.c
++++ b/nvidia-uvm/uvm8_gpu_replayable_faults.c
+@@ -972,7 +972,7 @@ static uvm_fault_access_type_t
check_fault_access_permissions(uvm_gpu_t *gpu,
+
+ perm_status = uvm_va_range_check_logical_permissions(va_block->va_range,
+ gpu->id,
+-
fault_entry->fault_access_type,
++
(uvm_fault_type_t)fault_entry->fault_access_type,
+ allow_migration);
+ if (perm_status == NV_OK)
+ return fault_entry->fault_access_type;
+@@ -995,7 +995,7 @@ static uvm_fault_access_type_t
check_fault_access_permissions(uvm_gpu_t *gpu,
+ if (uvm_fault_access_type_mask_test(fault_entry->access_type_mask,
UVM_FAULT_ACCESS_TYPE_READ)) {
+ perm_status = uvm_va_range_check_logical_permissions(va_block->va_range,
+ gpu->id,
+-
UVM_FAULT_ACCESS_TYPE_READ,
++
(uvm_fault_type_t)UVM_FAULT_ACCESS_TYPE_READ,
+ allow_migration);
+ if (perm_status == NV_OK)
+ return UVM_FAULT_ACCESS_TYPE_READ;
diff --git
a/nvidia-390xx-kmod-0082-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_non_replayable_faults_c.patch
b/nvidia-390xx-kmod-0082-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_non_replayable_faults_c.patch
new file mode 100644
index 0000000..1a1235d
--- /dev/null
+++
b/nvidia-390xx-kmod-0082-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_non_replayable_faults_c.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_gpu_non_replayable_faults.c
b/nvidia-uvm/uvm8_gpu_non_replayable_faults.c
+index c78d0ff..728f7db 100644
+--- a/nvidia-uvm/uvm8_gpu_non_replayable_faults.c
++++ b/nvidia-uvm/uvm8_gpu_non_replayable_faults.c
+@@ -221,7 +221,7 @@ static NV_STATUS service_non_replayable_fault_block_locked(uvm_gpu_t
*gpu,
+ // Check logical permissions
+ status = uvm_va_range_check_logical_permissions(va_block->va_range,
+ gpu->id,
+- fault_entry->fault_access_type,
++
(uvm_fault_type_t)fault_entry->fault_access_type,
+
uvm_range_group_address_migratable(va_space,
+
fault_entry->fault_address));
+ if (status != NV_OK) {
diff --git
a/nvidia-390xx-kmod-0083-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_va_block_c.patch
b/nvidia-390xx-kmod-0083-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_va_block_c.patch
new file mode 100644
index 0000000..77c8434
--- /dev/null
+++
b/nvidia-390xx-kmod-0083-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_va_block_c.patch
@@ -0,0 +1,13 @@
+diff --git a/nvidia-uvm/uvm8_va_block.c b/nvidia-uvm/uvm8_va_block.c
+index be6d873..b52eeb4 100644
+--- a/nvidia-uvm/uvm8_va_block.c
++++ b/nvidia-uvm/uvm8_va_block.c
+@@ -9389,7 +9389,7 @@ static NV_STATUS block_cpu_fault_locked(uvm_va_block_t *va_block,
+ // Check logical permissions
+ status = uvm_va_range_check_logical_permissions(va_block->va_range,
+ UVM_CPU_ID,
+- fault_access_type,
++
(uvm_fault_type_t)fault_access_type,
+
uvm_range_group_address_migratable(va_range->va_space, fault_addr));
+ if (status != NV_OK)
+ return status;
diff --git a/nvidia-390xx-kmod-0084-no-previous-prototype-in-nvlink_linux_c.patch
b/nvidia-390xx-kmod-0084-no-previous-prototype-in-nvlink_linux_c.patch
new file mode 100644
index 0000000..bd579d3
--- /dev/null
+++ b/nvidia-390xx-kmod-0084-no-previous-prototype-in-nvlink_linux_c.patch
@@ -0,0 +1,11 @@
+index ba57b86..9f7d8c1 100644
+--- a/nvidia/nvlink_linux.c
++++ b/nvidia/nvlink_linux.c
+@@ -30,6 +30,7 @@
+ #include "nv-linux.h"
+ #include "nv-procfs.h"
+ #include "nv-time.h"
++#include "nvlink_proto.h"
+
+ #define MAX_ERROR_STRING 512
+
diff --git
a/nvidia-390xx-kmod-0085-undef-NV_DRM_GEM_OBJECT_PUT_UNLOCK_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0085-undef-NV_DRM_GEM_OBJECT_PUT_UNLOCK_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..dd88f5c
--- /dev/null
+++
b/nvidia-390xx-kmod-0085-undef-NV_DRM_GEM_OBJECT_PUT_UNLOCK_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,30 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..58636bf 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -4152,7 +4152,7 @@ compile_test() {
+ # drm_gem_object_put_unlocked()") finally removes
+ # drm_gem_object_put_unlocked() macro.
+ #
+- CODE="
++ #CODE="
+ #if defined(NV_DRM_DRMP_H_PRESENT)
+ #include <drm/drmP.h>
+ #endif
+@@ -4160,11 +4160,12 @@ compile_test() {
+ #if defined(NV_DRM_DRM_GEM_H_PRESENT)
+ #include <drm/drm_gem.h>
+ #endif
+- void conftest_drm_gem_object_put_unlocked(void) {
+- drm_gem_object_put_unlocked();
+- }"
++ #void conftest_drm_gem_object_put_unlocked(void) {
++ # drm_gem_object_put_unlocked();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_DRM_GEM_OBJECT_PUT_UNLOCK_PRESENT" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_DRM_GEM_OBJECT_PUT_UNLOCK_PRESENT" "" "functions"
++ echo "#undef NV_DRM_GEM_OBJECT_PUT_UNLOCK_PRESENT" |
append_conftest "functions"
+ ;;
+
+ drm_display_mode_has_vrefresh)
diff --git
a/nvidia-390xx-kmod-0086-undef-NV_DRM_CONNECTOR_FUNCS_HAVE_MODE_IN_NAME-in-conftest_sh.patch
b/nvidia-390xx-kmod-0086-undef-NV_DRM_CONNECTOR_FUNCS_HAVE_MODE_IN_NAME-in-conftest_sh.patch
new file mode 100644
index 0000000..c6d4e2d
--- /dev/null
+++
b/nvidia-390xx-kmod-0086-undef-NV_DRM_CONNECTOR_FUNCS_HAVE_MODE_IN_NAME-in-conftest_sh.patch
@@ -0,0 +1,24 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..8e2b262 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -3669,13 +3669,14 @@ compile_test() {
+ # 2018-07-09 cde4c44d8769c1be16074c097592c46c7d64092b
+ # 2018-07-09 97e14fbeb53fe060c5f6a7a07e37fd24c087ed0c
+ #
+- CODE="
++ #CODE="
+ #include <drm/drm_connector.h>
+- void conftest_drm_connector_funcs_have_mode_in_name(void) {
+- drm_mode_connector_attach_encoder();
+- }"
++ #void conftest_drm_connector_funcs_have_mode_in_name(void) {
++ # drm_mode_connector_attach_encoder();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_DRM_CONNECTOR_FUNCS_HAVE_MODE_IN_NAME" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_DRM_CONNECTOR_FUNCS_HAVE_MODE_IN_NAME" "" "functions"
++ echo "#undef NV_DRM_CONNECTOR_FUNCS_HAVE_MODE_IN_NAME" |
append_conftest "functions"
+ ;;
+
+ vm_fault_t)
diff --git
a/nvidia-390xx-kmod-0087-undef-NV_DRM_REINIT_PRIMARY_MODE_GROUP_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0087-undef-NV_DRM_REINIT_PRIMARY_MODE_GROUP_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..6baf93c
--- /dev/null
+++
b/nvidia-390xx-kmod-0087-undef-NV_DRM_REINIT_PRIMARY_MODE_GROUP_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,26 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..c1ba563 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -2783,15 +2783,16 @@ compile_test() {
+ # removed by commit:
+ # 2015-07-09 3fdefa399e4644399ce3e74e65a75122d52dba6a
+ #
+- CODE="
++ #CODE="
+ #if defined(NV_DRM_DRM_CRTC_H_PRESENT)
+ #include <drm/drm_crtc.h>
+ #endif
+- void conftest_drm_reinit_primary_mode_group(void) {
+- drm_reinit_primary_mode_group();
+- }"
++ #void conftest_drm_reinit_primary_mode_group(void) {
++ # drm_reinit_primary_mode_group();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_DRM_REINIT_PRIMARY_MODE_GROUP_PRESENT" "" "functions"
++ #compile_check_conftest "$CODE"
"NV_DRM_REINIT_PRIMARY_MODE_GROUP_PRESENT" "" "functions"
++ echo "#undef NV_DRM_REINIT_PRIMARY_MODE_GROUP_PRESENT" |
append_conftest "functions"
+ ;;
+
+ wait_on_bit_lock_argument_count)
diff --git
a/nvidia-390xx-kmod-0088-undef-NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT-in-conftest_sh.patch
b/nvidia-390xx-kmod-0088-undef-NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT-in-conftest_sh.patch
new file mode 100644
index 0000000..11e97d7
--- /dev/null
+++
b/nvidia-390xx-kmod-0088-undef-NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT-in-conftest_sh.patch
@@ -0,0 +1,26 @@
+diff --git a/conftest.sh b/conftest.sh
+index beaae93..1e13dcc 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -3458,15 +3458,16 @@ compile_test() {
+ # drm_atomic_helper_connector_dpms() was removed by:
+ # 2017-07-25 7d902c05b480cc44033dcb56e12e51b082656b42
+ #
+- CODE="
++ #CODE="
+ #if defined(NV_DRM_DRM_ATOMIC_HELPER_H_PRESENT)
+ #include <drm/drm_atomic_helper.h>
+ #endif
+- void conftest_drm_atomic_helper_connector_dpms(void) {
+- drm_atomic_helper_connector_dpms();
+- }"
++ #void conftest_drm_atomic_helper_connector_dpms(void) {
++ # drm_atomic_helper_connector_dpms();
++ #}"
+
+- compile_check_conftest "$CODE"
"NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT" ""
"functions"
++ #compile_check_conftest "$CODE"
"NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT" ""
"functions"
++ echo "#undef NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT" |
append_conftest "functions"
+ ;;
+
+ backlight_device_register)
diff --git a/nvidia-390xx-kmod.spec b/nvidia-390xx-kmod.spec
index a443a0e..d8e5e6d 100644
--- a/nvidia-390xx-kmod.spec
+++ b/nvidia-390xx-kmod.spec
@@ -36,15 +36,72 @@ Source11: nvidia-390xx-kmodtool-excludekernel-filterfile
Patch12: do-div-cast.patch
Patch13: 0018-backport-nv_install_notifier-changes-from-418.30.patch
#Copied from Arch
-Patch19: kernel-4.16+-memory-encryption.patch
-Patch20: nvidia-390xx-kmod-0024-kernel-6.2-adaptation.patch
-Patch21: nvidia-390xx-kmod-0025-kernel-6.3-adaptation.patch
-Patch22: nvidia-390xx-kmod-0026-kernel-6.4-adaptation.patch
-Patch23:
nvidia-390xx-kmod-0027-kernel-6.5-garbage-collect-all-references-to-get_user.patch
-Patch24:
nvidia-390xx-kmod-0028-kernel-6.5-handle-get_user_pages-vmas-argument-remova.patch
-Patch25:
nvidia-390xx-kmod-0029-kernel-6.6-backport-drm_gem_prime_handle_to_fd-changes-from-470.patch
-Patch26:
nvidia-390xx-kmod-0030-kernel-6.6-refuse-to-load-legacy-module-if-IBT-is-enabled.patch
-Patch27: nvidia-390xx-kmod-0031-kernel-6.8-adaptation.patch
+Patch19: kernel-4.16+-memory-encryption.patch
+Patch20: nvidia-390xx-kmod-0024-kernel-6.2-adaptation.patch
+Patch21: nvidia-390xx-kmod-0025-kernel-6.3-adaptation.patch
+Patch22: nvidia-390xx-kmod-0026-kernel-6.4-adaptation.patch
+Patch23:
nvidia-390xx-kmod-0027-kernel-6.5-garbage-collect-all-references-to-get_user.patch
+Patch24:
nvidia-390xx-kmod-0028-kernel-6.5-handle-get_user_pages-vmas-argument-remova.patch
+Patch25:
nvidia-390xx-kmod-0029-kernel-6.6-backport-drm_gem_prime_handle_to_fd-changes-from-470.patch
+Patch26:
nvidia-390xx-kmod-0030-kernel-6.6-refuse-to-load-legacy-module-if-IBT-is-enabled.patch
+Patch27: nvidia-390xx-kmod-0031-kernel-6.8-adaptation.patch
+Patch28: nvidia-390xx-kmod-0032-kernel-6.8-conftest_h-wait_on_bit_lock.patch
+Patch29: nvidia-390xx-kmod-0033-kernel-5.6-ioremap_nocache_removed.patch
+Patch100: nvidia-390xx-kmod-0034-kernel-5.9-dma_is_direct-removed.patch
+Patch101:
nvidia-390xx-kmod-0035-gcc14-no-previous-prototype-for-nv_load_dma_map_scatterlist.patch
+Patch102:
nvidia-390xx-kmod-0036-undef-NV_ACPI_BUS_GET_DEVICE_PRESENT-in-conftest_sh.patch
+Patch103: nvidia-390xx-kmod-0037-add-RPM_CFLAGS-setup-in-conftest_sh.patch
+Patch104: nvidia-390xx-kmod-0038-workaround-NV_EFI_ENABLED-macro.patch
+Patch105: nvidia-390xx-kmod-0039-incompatible-function-type-nv_gpu_numa_c.patch
+Patch106: nvidia-390xx-kmod-0040-fix-fallthrough-warning-nv_mmap_c.patch
+Patch107:
nvidia-390xx-kmod-0041-no-previous-prototype-for-exercise_error_forwarding_va.patch
+Patch108: nvidia-390xx-kmod-0042-undef-NV_DO_GETTIMEOFDAY_PRESENT-in-conftest_sh.patch
+Patch109:
nvidia-390xx-kmod-0043-undef-NV_SET_MEMORY_ARRAY_UC_PRESENT-in-conftest_sh.patch
+Patch110:
nvidia-390xx-kmod-0044-undef-NV_ACQUIRE_CONSOLE_SEM_PRESENT-in-conftest_sh.patch
+Patch111: nvidia-390xx-kmod-0045-undef-NV_UNSAFE_FOLLOW_PFN_PRESENT-in-conftest_sh.patch
+Patch112:
nvidia-390xx-kmod-0046-undef-NV_JIFFIES_TO_TIMESPEC_PRESENT-in-conftest_sh.patch
+Patch113:
nvidia-390xx-kmod-0047-undef-NV_PNV_NPU2_INIT_CONTEXT_PRESENT-in-conftest_sh.patch
+Patch114: nvidia-390xx-kmod-0048-fix-atomic64-include-in-conftest_sh.patch
+Patch115: nvidia-390xx-kmod-0049-fix-dma_buf_map-renamed-to-iosys_map.patch
+Patch116: nvidia-390xx-kmod-0050-no-previous-prototype-for-nv_pci_register_driver.patch
+Patch117:
nvidia-390xx-kmod-0051-no-previous-prototype-for-nvidia_init_exit_module-in-nv_c.patch
+Patch118: nvidia-390xx-kmod-0052-no-previous-prototype-for-on_nv_assert.patch
+Patch119: nvidia-390xx-kmod-0053-no-previous-prototype-for-_raw_q_flush.patch
+Patch120: nvidia-390xx-kmod-0054-no-previous-prototype-for-nv-ibmnpu-functions.patch
+Patch121: nvidia-390xx-kmod-0055-no-previous-prototype-for-uvm_tools_init_exit.patch
+Patch122:
nvidia-390xx-kmod-0056-no-previous-prototype-for-uvm8_test_set_prefetch_filtering.patch
+Patch123: nvidia-390xx-kmod-0057-no-previous-prototype-in-uvm8_va_space_c.patch
+Patch124:
nvidia-390xx-kmod-0058-no-previous-prototype-for-uvm_channel_manager_print_pending_pushes.patch
+Patch125: nvidia-390xx-kmod-0059-no-previous-prototype-in-uvm8_va_range_c.patch
+Patch126: nvidia-390xx-kmod-0060-no-previous-prototype-in-uvm8_range_group_c.patch
+Patch127:
nvidia-390xx-kmod-0061-no-previous-prototype-in-uvm8_gpu_replayable_faults_c.patch
+Patch128: nvidia-390xx-kmod-0062-no-previous-prototype-for-block_map.patch
+Patch129: nvidia-390xx-kmod-0063-no-previous-prototype-for-try_get_ptes.patch
+Patch130: nvidia-390xx-kmod-0064-no-previous-prototype-in-uvm8_pushbuffer_c.patch
+Patch131: nvidia-390xx-kmod-0065-no-previous-prototype-in-uvm8_kepler_mmu_c.patch
+Patch132: nvidia-390xx-kmod-0066-no-previous-prototype-in-uvm8_pascal_mmu_c.patch
+Patch133:
nvidia-390xx-kmod-0067-no-previous-prototype-for-parse_fault_entry_common.patch
+Patch134:
nvidia-390xx-kmod-0068-no-previous-prototype-in-uvm8_volta_access_counter_buffer_c.patch
+Patch135:
nvidia-390xx-kmod-0069-no-previous-prototype-for-va_block_set_read_duplication_locked.patch
+Patch136: nvidia-390xx-kmod-0070-no-previous-prototype-for-map_rm_pt_range.patch
+Patch137: nvidia-390xx-kmod-0071-no-previous-prototype-in-uvm8_user_channel_c.patch
+Patch138: nvidia-390xx-kmod-0072-no-previous-prototype-in-uvm8_perf_thrashing_c.patch
+Patch139: nvidia-390xx-kmod-0073-no-previous-prototype-in-uvm8_perf_prefetch_c.patch
+Patch140: nvidia-390xx-kmod-0074-no-previous-prototype-for-test_tracking.patch
+Patch141: nvidia-390xx-kmod-0075-no-previous-prototype-in-uvm8_page_tree_test_c.patch
+Patch142: nvidia-390xx-kmod-0076-no-previous-prototype-in-uvm8_tracker_test_c.patch
+Patch143: nvidia-390xx-kmod-0077-no-previous-prototype-in-uvm8_push_test_c.patch
+Patch144: nvidia-390xx-kmod-0078-no-previous-prototype-in-uvm8_channel_test_c.patch
+Patch145: nvidia-390xx-kmod-0079-no-previous-prototype-in-nvidia-modeset-linux_c.patch
+Patch146:
nvidia-390xx-kmod-0080-fix-enum-implicit-conversion-from-uvm_fault_type_t-to-uvm_fault_access_type_t-in-uvm8_va_range_c.patch
+Patch147:
nvidia-390xx-kmod-0081-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_replayable_faults_c.patch
+Patch148:
nvidia-390xx-kmod-0082-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_gpu_non_replayable_faults_c.patch
+Patch149:
nvidia-390xx-kmod-0083-fix-enum-implicit-conversion-from-uvm_fault_access_type_t-to-uvm_fault_type_t-in-uvm8_va_block_c.patch
+Patch150: nvidia-390xx-kmod-0084-no-previous-prototype-in-nvlink_linux_c.patch
+Patch151:
nvidia-390xx-kmod-0085-undef-NV_DRM_GEM_OBJECT_PUT_UNLOCK_PRESENT-in-conftest_sh.patch
+Patch152:
nvidia-390xx-kmod-0086-undef-NV_DRM_CONNECTOR_FUNCS_HAVE_MODE_IN_NAME-in-conftest_sh.patch
+Patch153:
nvidia-390xx-kmod-0087-undef-NV_DRM_REINIT_PRIMARY_MODE_GROUP_PRESENT-in-conftest_sh.patch
+Patch154:
nvidia-390xx-kmod-0088-undef-NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT-in-conftest_sh.patch
# build system updates
Patch30: use-kbuild-compiler.patch
@@ -91,6 +148,63 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
%patch -P 25 -p1 -b 25 -d kernel
%patch -P 26 -p1 -b 26 -d kernel
%patch -P 27 -p1 -b 27 -d kernel
+%patch -P 28 -p1 -b 28 -d kernel
+%patch -P 29 -p1 -b 29 -d kernel
+%patch -P 100 -p1 -b 100 -d kernel
+%patch -P 101 -p1 -b 101 -d kernel
+%patch -P 102 -p1 -b 102 -d kernel
+%patch -P 103 -p1 -b 103 -d kernel
+%patch -P 104 -p1 -b 104 -d kernel
+%patch -P 105 -p1 -b 105 -d kernel
+%patch -P 106 -p1 -b 106 -d kernel
+%patch -P 107 -p1 -b 107 -d kernel
+%patch -P 108 -p1 -b 108 -d kernel
+%patch -P 109 -p1 -b 109 -d kernel
+%patch -P 110 -p1 -b 110 -d kernel
+%patch -P 111 -p1 -b 111 -d kernel
+%patch -P 112 -p1 -b 112 -d kernel
+%patch -P 113 -p1 -b 113 -d kernel
+%patch -P 114 -p1 -b 114 -d kernel
+%patch -P 115 -p1 -b 115 -d kernel
+%patch -P 116 -p1 -b 116 -d kernel
+%patch -P 117 -p1 -b 117 -d kernel
+%patch -P 118 -p1 -b 118 -d kernel
+%patch -P 119 -p1 -b 119 -d kernel
+%patch -P 120 -p1 -b 120 -d kernel
+%patch -P 121 -p1 -b 121 -d kernel
+%patch -P 122 -p1 -b 122 -d kernel
+%patch -P 123 -p1 -b 123 -d kernel
+%patch -P 124 -p1 -b 124 -d kernel
+%patch -P 125 -p1 -b 125 -d kernel
+%patch -P 126 -p1 -b 126 -d kernel
+%patch -P 127 -p1 -b 127 -d kernel
+%patch -P 128 -p1 -b 128 -d kernel
+%patch -P 129 -p1 -b 129 -d kernel
+%patch -P 130 -p1 -b 130 -d kernel
+%patch -P 131 -p1 -b 131 -d kernel
+%patch -P 132 -p1 -b 132 -d kernel
+%patch -P 133 -p1 -b 133 -d kernel
+%patch -P 134 -p1 -b 134 -d kernel
+%patch -P 135 -p1 -b 135 -d kernel
+%patch -P 136 -p1 -b 136 -d kernel
+%patch -P 137 -p1 -b 137 -d kernel
+%patch -P 138 -p1 -b 138 -d kernel
+%patch -P 139 -p1 -b 139 -d kernel
+%patch -P 140 -p1 -b 140 -d kernel
+%patch -P 141 -p1 -b 141 -d kernel
+%patch -P 142 -p1 -b 142 -d kernel
+%patch -P 143 -p1 -b 143 -d kernel
+%patch -P 144 -p1 -b 144 -d kernel
+%patch -P 145 -p1 -b 145 -d kernel
+%patch -P 146 -p1 -b 146 -d kernel
+%patch -P 147 -p1 -b 147 -d kernel
+%patch -P 148 -p1 -b 148 -d kernel
+%patch -P 149 -p1 -b 149 -d kernel
+%patch -P 150 -p1 -b 150 -d kernel
+%patch -P 151 -p1 -b 151 -d kernel
+%patch -P 152 -p1 -b 152 -d kernel
+%patch -P 153 -p1 -b 153 -d kernel
+%patch -P 154 -p1 -b 154 -d kernel
%patch -P 30 -p1 -b 30 -d kernel
%patch -P 31 -p1 -b 31 -d kernel
@@ -111,6 +225,7 @@ done
for kernel_version in %{?kernel_versions}; do
pushd _kmod_build_${kernel_version%%___*}/
make V=1 %{?_smp_mflags} \
+ RPM_CFLAGS="%{optflags}" \
KERNEL_UNAME="${kernel_version%%___*}"
SYSSRC="${kernel_version##*___}" \
IGNORE_CC_MISMATCH=1 IGNORE_XEN_PRESENCE=1 IGNORE_PREEMPT_RT_PRESENCE=1 \
module