Version in base suite: 535.247.01-1~deb12u1 Base version: nvidia-open-gpu-kernel-modules_535.247.01-1~deb12u1 Target version: nvidia-open-gpu-kernel-modules_535.261.03-1 Base file: /srv/ftp-master.debian.org/ftp/pool/contrib/n/nvidia-open-gpu-kernel-modules/nvidia-open-gpu-kernel-modules_535.247.01-1~deb12u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/contrib/n/nvidia-open-gpu-kernel-modules/nvidia-open-gpu-kernel-modules_535.261.03-1.dsc README.md | 8 - debian/changelog | 26 +++ debian/copyright | 2 debian/gbp.conf | 3 debian/patches/module/0002-conftest.sh-remove-empty-lines-from-uts_release-outp.patch | 6 debian/patches/module/0052-backport-uvm-warning-fixes-from-560.28.03.patch | 17 ++ debian/patches/module/0053-fix-more-warnings.patch | 37 ---- debian/patches/module/0054-backport-warning-fixes-from-575.51.02.patch | 75 ++++++++++ debian/patches/module/0054-fix-more-uvm-warnings.patch | 17 -- debian/patches/module/0060-backport-module_import_ns_takes_string_literal-chang.patch | 10 - debian/patches/module/0062-Support-BTF-generation-for-non-release-builds.patch | 8 - debian/patches/module/0062-let-pahole-ignore-c-11-in-addition-to-c.patch | 34 ++++ debian/patches/module/bashisms.patch | 2 debian/patches/module/cc_version_check-gcc5.patch | 2 debian/patches/module/conftest-verbose.patch | 14 - debian/patches/module/series | 2 debian/patches/module/use-kbuild-compiler.patch | 2 debian/patches/module/use-kbuild-flags.patch | 38 ++--- debian/rules | 2 debian/rules.defs | 2 debian/source/lintian-overrides | 9 - kernel-open/Kbuild | 57 +++---- kernel-open/common/inc/nv-mm.h | 21 ++ kernel-open/common/inc/nv-timer.h | 11 + kernel-open/conftest.sh | 70 +++++---- kernel-open/nvidia-drm/nvidia-drm-connector.c | 4 kernel-open/nvidia-drm/nvidia-drm.Kbuild | 2 kernel-open/nvidia-modeset/nvidia-modeset-linux.c | 10 + kernel-open/nvidia-modeset/nvidia-modeset.Kbuild | 1 kernel-open/nvidia-uvm/nvidia-uvm.Kbuild | 3 kernel-open/nvidia-uvm/uvm_ats_sva.c | 9 + kernel-open/nvidia-uvm/uvm_hmm.c | 40 ++++- kernel-open/nvidia-uvm/uvm_linux.h | 5 kernel-open/nvidia-uvm/uvm_pmm_gpu.c | 2 kernel-open/nvidia/nv-caps.c | 29 +++ kernel-open/nvidia/nv-dmabuf.c | 5 kernel-open/nvidia/nv-mmap.c | 74 +++++++++ kernel-open/nvidia/nv-nano-timer.c | 9 - kernel-open/nvidia/nv.c | 4 kernel-open/nvidia/nvidia.Kbuild | 6 src/common/inc/nvBldVer.h | 20 +- src/common/inc/nvUnixVersion.h | 2 src/common/nvswitch/kernel/ls10/minion_ls10.c | 1 src/nvidia/arch/nvalloc/common/inc/nvcst.h | 5 src/nvidia/arch/nvalloc/common/inc/nvpcie.h | 14 + src/nvidia/arch/nvalloc/common/inc/oob/smbpbi_priv.h | 30 ---- src/nvidia/generated/g_gpu_access_nvoc.h | 8 + src/nvidia/generated/g_gpu_nvoc.h | 3 src/nvidia/generated/rmconfig.h | 1 src/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h | 1 src/nvidia/kernel/vgpu/nv/rpc.c | 7 src/nvidia/src/kernel/gpu/arch/hopper/kern_gpu_gh100.c | 5 src/nvidia/src/kernel/gpu/fsp/kern_fsp.c | 63 +++----- src/nvidia/src/kernel/gpu/mig_mgr/gpu_instance_subscription.c | 2 src/nvidia/src/kernel/platform/chipset/chipset_info.c | 13 - src/nvidia/src/kernel/platform/chipset/chipset_pcie.c | 55 +++++++ version.mk | 2 57 files changed, 632 insertions(+), 278 deletions(-) diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/README.md nvidia-open-gpu-kernel-modules-535.261.03/README.md --- nvidia-open-gpu-kernel-modules-535.247.01/README.md 2025-03-26 13:46:49.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/README.md 2025-06-14 16:21:13.000000000 +0000 @@ -1,7 +1,7 @@ # NVIDIA Linux Open GPU Kernel Module Source This is the source release of the NVIDIA Linux open GPU kernel modules, -version 535.247.01. +version 535.261.03. ## How to Build @@ -17,7 +17,7 @@ Note that the kernel modules built here must be used with GSP firmware and user-space NVIDIA GPU driver components from a corresponding -535.247.01 driver release. This can be achieved by installing +535.261.03 driver release. This can be achieved by installing the NVIDIA GPU driver from the .run file using the `--no-kernel-modules` option. E.g., @@ -180,7 +180,7 @@ ## Compatible GPUs The open-gpu-kernel-modules can be used on any Turing or later GPU -(see the table below). However, in the 535.247.01 release, +(see the table below). However, in the 535.261.03 release, GeForce and Workstation support is still considered alpha-quality. To enable use of the open kernel modules on GeForce and Workstation GPUs, @@ -188,7 +188,7 @@ parameter to 1. For more details, see the NVIDIA GPU driver end user README here: -https://us.download.nvidia.com/XFree86/Linux-x86_64/535.247.01/README/kernel_open.html +https://us.download.nvidia.com/XFree86/Linux-x86_64/535.261.03/README/kernel_open.html In the below table, if three IDs are listed, the first is the PCI Device ID, the second is the PCI Subsystem Vendor ID, and the third is the PCI diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/changelog nvidia-open-gpu-kernel-modules-535.261.03/debian/changelog --- nvidia-open-gpu-kernel-modules-535.247.01/debian/changelog 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/changelog 2025-12-20 23:05:31.000000000 +0000 @@ -1,3 +1,21 @@ +nvidia-open-gpu-kernel-modules (535.261.03-1) bookworm; urgency=medium + + * New upstream LTS and Tesla branch release 535.261.03 (2025-07-17). + * Fixed CVE-2025-23279, CVE-2025-23286. (Closes: #1109915) + https://nvidia.custhelp.com/app/answers/detail/a_id/5670 + * Sync with src:nvidia-graphics-drivers. + * Upload to bookworm. + + -- Andreas Beckmann Sun, 21 Dec 2025 00:05:31 +0100 + +nvidia-open-gpu-kernel-modules (535.247.01-2) UNRELEASED; urgency=medium + + * Backport page_pgmap and hmm_make_device_exclusive_range changes from + 570.153.02 to fix open kernel module build for Linux 6.15. + * Sync with src:nvidia-graphics-drivers. + + -- Andreas Beckmann Fri, 06 Jun 2025 15:11:06 +0200 + nvidia-open-gpu-kernel-modules (535.247.01-1~deb12u1) bookworm; urgency=medium * Rebuild for bookworm. @@ -98,12 +116,18 @@ * New upstream LTS and Tesla branch release 535.183.01 (2024-06-04). * Fixed CVE-2024-0090, CVE-2024-0092. (Closes: #1072800) https://nvidia.custhelp.com/app/answers/detail/a_id/5551 + * Sync with src:nvidia-graphics-drivers. + + -- Andreas Beckmann Wed, 19 Jun 2024 04:56:43 +0200 + +nvidia-open-gpu-kernel-modules (535.179-1) UNRELEASED; urgency=medium + * New upstream long term support branch release 535.179 (2024-05-09). * New upstream long term support branch release 535.171.04 (2024-03-21). * Sync with src:nvidia-graphics-drivers. * Refresh patches. - -- Andreas Beckmann Wed, 19 Jun 2024 04:56:43 +0200 + -- Andreas Beckmann Tue, 18 Jun 2024 09:58:53 +0200 nvidia-open-gpu-kernel-modules (535.161.08-1~deb12u1) bookworm; urgency=medium diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/copyright nvidia-open-gpu-kernel-modules-535.261.03/debian/copyright --- nvidia-open-gpu-kernel-modules-535.247.01/debian/copyright 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/copyright 2025-12-20 23:05:31.000000000 +0000 @@ -11,7 +11,7 @@ Files: * Copyright: - (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. License: Expat Comment: Except where noted otherwise, the individual files within this package are diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/gbp.conf nvidia-open-gpu-kernel-modules-535.261.03/debian/gbp.conf --- nvidia-open-gpu-kernel-modules-535.247.01/debian/gbp.conf 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/gbp.conf 2025-12-20 23:05:31.000000000 +0000 @@ -1,3 +1,4 @@ [DEFAULT] -debian-branch = main +debian-branch = 535/main +upstream-branch = 535/upstream upstream-vcs-tag = %(version)s diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0002-conftest.sh-remove-empty-lines-from-uts_release-outp.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0002-conftest.sh-remove-empty-lines-from-uts_release-outp.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0002-conftest.sh-remove-empty-lines-from-uts_release-outp.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0002-conftest.sh-remove-empty-lines-from-uts_release-outp.patch 2025-12-20 23:05:31.000000000 +0000 @@ -1,4 +1,4 @@ -From 575dab59a98c0c6938124763f1d08052c922e159 Mon Sep 17 00:00:00 2001 +From c273e7506268be0ca9810464f2c98f19f9fd5f3a Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Mon, 31 Oct 2022 14:40:42 +0100 Subject: [PATCH] conftest.sh: remove empty lines from uts_release output @@ -8,10 +8,10 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conftest.sh b/conftest.sh -index 60277da8..70a3d5af 100755 +index 79baf185..012bc0dc 100755 --- a/conftest.sh +++ b/conftest.sh -@@ -5985,7 +5985,7 @@ compile_test() { +@@ -5958,7 +5958,7 @@ compile_test() { echo "#include UTS_RELEASE" > conftest$$.c diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0052-backport-uvm-warning-fixes-from-560.28.03.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0052-backport-uvm-warning-fixes-from-560.28.03.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0052-backport-uvm-warning-fixes-from-560.28.03.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0052-backport-uvm-warning-fixes-from-560.28.03.patch 2025-12-20 23:05:31.000000000 +0000 @@ -1,4 +1,4 @@ -From 4cad785a66fe11ea3c70e8436b159bdf4dd84608 Mon Sep 17 00:00:00 2001 +From 801c9ef5360863c1a0b9cca59cd0525b9375816e Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Sun, 8 Dec 2024 22:54:59 +0100 Subject: [PATCH] backport uvm warning fixes from 560.28.03 @@ -16,7 +16,8 @@ nvidia-uvm/uvm_pmm_sysmem_test.c | 7 +++++-- nvidia-uvm/uvm_pmm_test.c | 10 +++++----- nvidia-uvm/uvm_populate_pageable.c | 2 +- - 12 files changed, 26 insertions(+), 23 deletions(-) + nvidia-uvm/uvm_tools.c | 1 + + 13 files changed, 27 insertions(+), 23 deletions(-) diff --git a/nvidia-uvm/uvm_channel_test.c b/nvidia-uvm/uvm_channel_test.c index c4521d22..f3cfd494 100644 @@ -252,6 +253,18 @@ { NV_STATUS status = NV_OK; +diff --git a/nvidia-uvm/uvm_tools.c b/nvidia-uvm/uvm_tools.c +index 3619a7ce..7b81a54a 100644 +--- a/nvidia-uvm/uvm_tools.c ++++ b/nvidia-uvm/uvm_tools.c +@@ -25,6 +25,7 @@ + #include "uvm_gpu.h" + #include "uvm_hal.h" + #include "uvm_tools.h" ++#include "uvm_tools_init.h" + #include "uvm_va_space.h" + #include "uvm_api.h" + #include "uvm_hal_types.h" -- 2.39.5 diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0053-fix-more-warnings.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0053-fix-more-warnings.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0053-fix-more-warnings.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0053-fix-more-warnings.patch 2025-12-20 23:05:31.000000000 +0000 @@ -5,11 +5,9 @@ --- common/inc/nv-linux.h | 8 ++++++++ - common/inc/nv-proto.h | 2 +- - nvidia/libspdm_aead.c | 2 ++ nvidia/nv-frontend.c | 2 -- nvidia/nv-frontend.h | 3 +++ - 5 files changed, 14 insertions(+), 3 deletions(-) + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/common/inc/nv-linux.h b/common/inc/nv-linux.h index 433e5587..54b2ce17 100644 @@ -53,39 +51,6 @@ } #define NV_KFREE(ptr, size) \ -diff --git a/common/inc/nv-proto.h b/common/inc/nv-proto.h -index 815107d2..b016e42e 100644 ---- a/common/inc/nv-proto.h -+++ b/common/inc/nv-proto.h -@@ -43,7 +43,7 @@ void nv_procfs_remove_gpu (nv_linux_state_t *); - - int nvidia_mmap (struct file *, struct vm_area_struct *); - int nvidia_mmap_helper (nv_state_t *, nv_linux_file_private_t *, nvidia_stack_t *, struct vm_area_struct *, void *); --int nv_encode_caching (pgprot_t *, NvU32, NvU32); -+int nv_encode_caching (pgprot_t *, NvU32, nv_memory_type_t); - void nv_revoke_gpu_mappings_locked(nv_state_t *); - - NvUPtr nv_vm_map_pages (struct page **, NvU32, NvBool, NvBool); -diff --git a/nvidia/libspdm_aead.c b/nvidia/libspdm_aead.c -index 3844da48..18d23ba2 100644 ---- a/nvidia/libspdm_aead.c -+++ b/nvidia/libspdm_aead.c -@@ -38,6 +38,7 @@ struct lkca_aead_ctx - }; - #endif - -+static - int libspdm_aead_prealloc(void **context, char const *alg) - { - #ifndef USE_LKCA -@@ -168,6 +169,7 @@ static int lkca_aead_internal(struct crypto_aead *aead, - } - #endif - -+static - int libspdm_aead_prealloced(void *context, - const uint8_t *key, size_t key_size, - const uint8_t *iv, size_t iv_size, diff --git a/nvidia/nv-frontend.c b/nvidia/nv-frontend.c index eb7a2e08..0bdbe02a 100644 --- a/nvidia/nv-frontend.c diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0054-backport-warning-fixes-from-575.51.02.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0054-backport-warning-fixes-from-575.51.02.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0054-backport-warning-fixes-from-575.51.02.patch 1970-01-01 00:00:00.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0054-backport-warning-fixes-from-575.51.02.patch 2025-12-20 23:05:31.000000000 +0000 @@ -0,0 +1,75 @@ +From a6e092742f84c41fb94d700bcd4a1c7b247134fd Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Tue, 27 May 2025 17:50:15 +0200 +Subject: [PATCH] backport warning fixes from 575.51.02 + +--- + common/inc/nv-proto.h | 2 +- + nvidia-uvm/uvm_gpu_access_counters.c | 1 + + nvidia/libspdm_aead.c | 18 +++++++++--------- + 3 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/common/inc/nv-proto.h b/common/inc/nv-proto.h +index 815107d2..b016e42e 100644 +--- a/common/inc/nv-proto.h ++++ b/common/inc/nv-proto.h +@@ -43,7 +43,7 @@ void nv_procfs_remove_gpu (nv_linux_state_t *); + + int nvidia_mmap (struct file *, struct vm_area_struct *); + int nvidia_mmap_helper (nv_state_t *, nv_linux_file_private_t *, nvidia_stack_t *, struct vm_area_struct *, void *); +-int nv_encode_caching (pgprot_t *, NvU32, NvU32); ++int nv_encode_caching (pgprot_t *, NvU32, nv_memory_type_t); + void nv_revoke_gpu_mappings_locked(nv_state_t *); + + NvUPtr nv_vm_map_pages (struct page **, NvU32, NvBool, NvBool); +diff --git a/nvidia-uvm/uvm_gpu_access_counters.c b/nvidia-uvm/uvm_gpu_access_counters.c +index 77512d6d..d042f63d 100644 +--- a/nvidia-uvm/uvm_gpu_access_counters.c ++++ b/nvidia-uvm/uvm_gpu_access_counters.c +@@ -24,6 +24,7 @@ + #include "nv_uvm_interface.h" + #include "uvm_gpu_access_counters.h" + #include "uvm_global.h" ++#include "uvm_api.h" + #include "uvm_gpu.h" + #include "uvm_hal.h" + #include "uvm_kvmalloc.h" +diff --git a/nvidia/libspdm_aead.c b/nvidia/libspdm_aead.c +index 3844da48..6ff5adeb 100644 +--- a/nvidia/libspdm_aead.c ++++ b/nvidia/libspdm_aead.c +@@ -38,7 +38,7 @@ struct lkca_aead_ctx + }; + #endif + +-int libspdm_aead_prealloc(void **context, char const *alg) ++static int libspdm_aead_prealloc(void **context, char const *alg) + { + #ifndef USE_LKCA + return -ENODEV; +@@ -168,14 +168,14 @@ static int lkca_aead_internal(struct crypto_aead *aead, + } + #endif + +-int libspdm_aead_prealloced(void *context, +- const uint8_t *key, size_t key_size, +- const uint8_t *iv, size_t iv_size, +- const uint8_t *a_data, size_t a_data_size, +- const uint8_t *data_in, size_t data_in_size, +- uint8_t *tag, size_t tag_size, +- uint8_t *data_out, size_t *data_out_size, +- bool enc) ++static int libspdm_aead_prealloced(void *context, ++ const uint8_t *key, size_t key_size, ++ const uint8_t *iv, size_t iv_size, ++ const uint8_t *a_data, size_t a_data_size, ++ const uint8_t *data_in, size_t data_in_size, ++ uint8_t *tag, size_t tag_size, ++ uint8_t *data_out, size_t *data_out_size, ++ bool enc) + { + #ifndef USE_LKCA + return -ENODEV; +-- +2.39.5 + diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0054-fix-more-uvm-warnings.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0054-fix-more-uvm-warnings.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0054-fix-more-uvm-warnings.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0054-fix-more-uvm-warnings.patch 2025-12-20 23:05:31.000000000 +0000 @@ -4,9 +4,8 @@ Subject: [PATCH] fix more uvm warnings --- - nvidia-uvm/uvm_gpu.c | 1 + - nvidia-uvm/uvm_tools.c | 1 + - 2 files changed, 2 insertions(+) + nvidia-uvm/uvm_gpu.c | 1 + + 1 file changed, 1 insertion(+) diff --git a/nvidia-uvm/uvm_gpu.c b/nvidia-uvm/uvm_gpu.c index 9070f444..f7874a9e 100644 @@ -20,18 +19,6 @@ uvm_gpu_t *uvm_gpu_get_by_parent_and_swizz_id_locked(uvm_parent_gpu_t *parent_gpu, NvU32 swizz_id) { uvm_gpu_t *gpu; -diff --git a/nvidia-uvm/uvm_tools.c b/nvidia-uvm/uvm_tools.c -index 3619a7ce..569c454b 100644 ---- a/nvidia-uvm/uvm_tools.c -+++ b/nvidia-uvm/uvm_tools.c -@@ -35,6 +35,7 @@ - #include "uvm_range_group.h" - #include "uvm_mem.h" - #include "nv_speculation_barrier.h" -+#include "uvm_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 -- 2.39.5 diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0060-backport-module_import_ns_takes_string_literal-chang.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0060-backport-module_import_ns_takes_string_literal-chang.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0060-backport-module_import_ns_takes_string_literal-chang.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0060-backport-module_import_ns_takes_string_literal-chang.patch 2025-12-20 23:05:31.000000000 +0000 @@ -1,4 +1,4 @@ -From a46fa4405ec31fbf621696fd99e5dd6d200af156 Mon Sep 17 00:00:00 2001 +From e080e43c4f0ff8d861f29821b3a319a8933e49cd Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Fri, 21 Feb 2025 10:21:42 +0100 Subject: [PATCH] backport module_import_ns_takes_string_literal changes from @@ -10,10 +10,10 @@ 2 files changed, 18 insertions(+) diff --git a/conftest.sh b/conftest.sh -index 70a3d5af..bf61ef7b 100755 +index 012bc0dc..aae3b07a 100755 --- a/conftest.sh +++ b/conftest.sh -@@ -5517,6 +5517,23 @@ compile_test() { +@@ -5490,6 +5490,23 @@ compile_test() { else echo "#undef NV_OF_PROPERTY_READ_VARIABLE_U32_ARRAY_PRESENT" | append_conftest "functions" fi @@ -38,10 +38,10 @@ devm_of_platform_populate) diff --git a/nvidia/nvidia.Kbuild b/nvidia/nvidia.Kbuild -index c88538fd..6a72a6c2 100644 +index 328324d3..22849337 100644 --- a/nvidia/nvidia.Kbuild +++ b/nvidia/nvidia.Kbuild -@@ -194,6 +194,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_task_ioprio +@@ -193,6 +193,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_task_ioprio NV_CONFTEST_FUNCTION_COMPILE_TESTS += mdev_set_iommu_device NV_CONFTEST_FUNCTION_COMPILE_TESTS += offline_and_remove_memory NV_CONFTEST_FUNCTION_COMPILE_TESTS += crypto_tfm_ctx_aligned diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0062-Support-BTF-generation-for-non-release-builds.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0062-Support-BTF-generation-for-non-release-builds.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0062-Support-BTF-generation-for-non-release-builds.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0062-Support-BTF-generation-for-non-release-builds.patch 2025-12-20 23:05:31.000000000 +0000 @@ -96,9 +96,7 @@ Signed-off-by: Rahul Rameshbabu -Ignore c++11 in addition to c++. - -Origin: other, https://github.com/NVIDIA/open-gpu-kernel-modules/issues/756 +Bug: https://github.com/NVIDIA/open-gpu-kernel-modules/issues/756 Origin: other, https://github.com/Binary-Eater/open-gpu-kernel-modules/commit/854449a7b76cdb4ad17919a1c8a662a4ff5b943d --- Makefile | 28 +++++++++++++++++++++++++++- @@ -125,14 +123,14 @@ + # pahole_cmd = "pahole" + # for (i = 1; i < ARGC; i++) { + # if (ARGV[i] ~ /--lang_exclude=/) { -+ # pahole_cmd = pahole_cmd sprintf(" %s,c++,c++11", ARGV[i]) ++ # pahole_cmd = pahole_cmd sprintf(" %s,c++", ARGV[i]) + # } else { + # pahole_cmd = pahole_cmd sprintf(" %s", ARGV[i]) + # } + # } + # system(pahole_cmd) + # } -+ PAHOLE_AWK_PROGRAM = BEGIN { pahole_cmd = \"pahole\"; for (i = 1; i < ARGC; i++) { if (ARGV[i] ~ /--lang_exclude=/) { pahole_cmd = pahole_cmd sprintf(\" %s,c++,c++11\", ARGV[i]); } else { pahole_cmd = pahole_cmd sprintf(\" %s\", ARGV[i]); } } system(pahole_cmd); } ++ PAHOLE_AWK_PROGRAM = BEGIN { pahole_cmd = \"pahole\"; for (i = 1; i < ARGC; i++) { if (ARGV[i] ~ /--lang_exclude=/) { pahole_cmd = pahole_cmd sprintf(\" %s,c++\", ARGV[i]); } else { pahole_cmd = pahole_cmd sprintf(\" %s\", ARGV[i]); } } system(pahole_cmd); } + # If scripts/pahole-flags.sh is not present in the kernel tree, add PAHOLE and + # PAHOLE_AWK_PROGRAM assignments to PAHOLE_VARIABLES; otherwise assign the + # empty string to PAHOLE_VARIABLES. diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0062-let-pahole-ignore-c-11-in-addition-to-c.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0062-let-pahole-ignore-c-11-in-addition-to-c.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/0062-let-pahole-ignore-c-11-in-addition-to-c.patch 1970-01-01 00:00:00.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/0062-let-pahole-ignore-c-11-in-addition-to-c.patch 2025-12-20 23:05:31.000000000 +0000 @@ -0,0 +1,34 @@ +From 6df42b1f5ac27cdd56517d4a1680809b682d1412 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Tue, 1 Apr 2025 14:47:51 +0200 +Subject: [PATCH] let pahole ignore c++11 in addition to c++ + +Bug: https://github.com/NVIDIA/open-gpu-kernel-modules/issues/756#issuecomment-2769237410 +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 0a1394e0..40a9792e 100644 +--- a/Makefile ++++ b/Makefile +@@ -84,14 +84,14 @@ else + # pahole_cmd = "pahole" + # for (i = 1; i < ARGC; i++) { + # if (ARGV[i] ~ /--lang_exclude=/) { +- # pahole_cmd = pahole_cmd sprintf(" %s,c++", ARGV[i]) ++ # pahole_cmd = pahole_cmd sprintf(" %s,c++,c++11", ARGV[i]) + # } else { + # pahole_cmd = pahole_cmd sprintf(" %s", ARGV[i]) + # } + # } + # system(pahole_cmd) + # } +- PAHOLE_AWK_PROGRAM = BEGIN { pahole_cmd = \"pahole\"; for (i = 1; i < ARGC; i++) { if (ARGV[i] ~ /--lang_exclude=/) { pahole_cmd = pahole_cmd sprintf(\" %s,c++\", ARGV[i]); } else { pahole_cmd = pahole_cmd sprintf(\" %s\", ARGV[i]); } } system(pahole_cmd); } ++ PAHOLE_AWK_PROGRAM = BEGIN { pahole_cmd = \"pahole\"; for (i = 1; i < ARGC; i++) { if (ARGV[i] ~ /--lang_exclude=/) { pahole_cmd = pahole_cmd sprintf(\" %s,c++,c++11\", ARGV[i]); } else { pahole_cmd = pahole_cmd sprintf(\" %s\", ARGV[i]); } } system(pahole_cmd); } + # If scripts/pahole-flags.sh is not present in the kernel tree, add PAHOLE and + # PAHOLE_AWK_PROGRAM assignments to PAHOLE_VARIABLES; otherwise assign the + # empty string to PAHOLE_VARIABLES. +-- +2.39.5 + diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/bashisms.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/bashisms.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/bashisms.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/bashisms.patch 2025-12-20 23:05:31.000000000 +0000 @@ -3,7 +3,7 @@ --- a/conftest.sh +++ b/conftest.sh -@@ -7023,7 +7023,7 @@ case "$5" in +@@ -7039,7 +7039,7 @@ case "$5" in if [ -n "$VGX_BUILD" ]; then if [ -f /proc/xen/capabilities ]; then diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/cc_version_check-gcc5.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/cc_version_check-gcc5.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/cc_version_check-gcc5.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/cc_version_check-gcc5.patch 2025-12-20 23:05:31.000000000 +0000 @@ -5,7 +5,7 @@ --- a/conftest.sh +++ b/conftest.sh -@@ -6857,7 +6857,7 @@ case "$5" in +@@ -6873,7 +6873,7 @@ case "$5" in kernel_cc_minor=`echo ${kernel_cc_version} | cut -d '.' -f 2` echo " diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/conftest-verbose.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/conftest-verbose.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/conftest-verbose.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/conftest-verbose.patch 2025-12-20 23:05:31.000000000 +0000 @@ -3,7 +3,7 @@ --- a/Kbuild +++ b/Kbuild -@@ -180,6 +180,17 @@ NV_CONFTEST_HEADERS += $(obj)/conftest/h +@@ -175,6 +175,17 @@ NV_CONFTEST_HEADERS += $(obj)/conftest/h NV_CONFTEST_HEADERS += $(NV_CONFTEST_COMPILE_TEST_HEADERS) @@ -21,7 +21,7 @@ # # Generate a header file for a single conftest compile test. Each compile test # header depends on conftest.sh, as well as the generated conftest/headers.h -@@ -204,6 +215,8 @@ define NV_GENERATE_COMPILE_TEST_HEADER +@@ -199,6 +210,8 @@ define NV_GENERATE_COMPILE_TEST_HEADER @mkdir -p $(obj)/conftest @# concatenate /dev/null to prevent cat from hanging when $$^ is empty @cat $$^ /dev/null > $$@ @@ -30,7 +30,7 @@ endef # -@@ -223,9 +236,11 @@ $(eval $(call NV_GENERATE_COMPILE_TEST_H +@@ -218,9 +231,11 @@ $(eval $(call NV_GENERATE_COMPILE_TEST_H $(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,symbols,$(NV_CONFTEST_SYMBOL_COMPILE_TESTS))) $(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,types,$(NV_CONFTEST_TYPE_COMPILE_TESTS))) @@ -43,7 +43,7 @@ # Each of these headers is checked for presence with a test #include; a -@@ -335,6 +350,7 @@ NV_HEADER_PRESENCE_PART = $(addprefix $( +@@ -330,6 +345,7 @@ NV_HEADER_PRESENCE_PART = $(addprefix $( define NV_HEADER_PRESENCE_CHECK $$(call NV_HEADER_PRESENCE_PART,$(1)): $$(NV_CONFTEST_SCRIPT) $(obj)/conftest/uts_release @mkdir -p $$(dir $$@) @@ -51,7 +51,7 @@ @$$(NV_CONFTEST_CMD) test_kernel_header '$$(NV_CONFTEST_CFLAGS)' '$(1)' > $$@ endef -@@ -344,6 +360,8 @@ $(foreach header,$(NV_HEADER_PRESENCE_TE +@@ -339,6 +355,8 @@ $(foreach header,$(NV_HEADER_PRESENCE_TE # Concatenate all of the parts into headers.h. $(obj)/conftest/headers.h: $(call NV_HEADER_PRESENCE_PART,$(NV_HEADER_PRESENCE_TESTS)) @cat $^ > $@ @@ -60,7 +60,7 @@ clean-dirs := $(obj)/conftest -@@ -364,7 +382,8 @@ BUILD_SANITY_CHECKS = \ +@@ -359,7 +377,8 @@ BUILD_SANITY_CHECKS = \ .PHONY: $(BUILD_SANITY_CHECKS) @@ -70,7 +70,7 @@ @$(NV_CONFTEST_CMD) $@ full_output # Perform all sanity checks before generating the conftest headers -@@ -373,11 +392,13 @@ $(NV_CONFTEST_HEADERS): | $(BUILD_SANITY +@@ -368,11 +387,13 @@ $(NV_CONFTEST_HEADERS): | $(BUILD_SANITY # Make the conftest headers depend on the kernel version string diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/series nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/series --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/series 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/series 2025-12-20 23:05:31.000000000 +0000 @@ -9,11 +9,13 @@ 0046-backport-nv_get_kern_phys_address-changes-from-555.4.patch 0052-backport-uvm-warning-fixes-from-560.28.03.patch 0053-fix-more-warnings.patch +0054-backport-warning-fixes-from-575.51.02.patch 0054-fix-more-uvm-warnings.patch 0058-backport-warning-fixes-from-565.57.01.patch 0059-backport-uvm-warning-fixes-from-550.90.07.patch 0060-backport-module_import_ns_takes_string_literal-chang.patch 0062-Support-BTF-generation-for-non-release-builds.patch +0062-let-pahole-ignore-c-11-in-addition-to-c.patch # build system updates conftest-verbose.patch diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/use-kbuild-compiler.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/use-kbuild-compiler.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/use-kbuild-compiler.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/use-kbuild-compiler.patch 2025-12-20 23:05:31.000000000 +0000 @@ -21,7 +21,7 @@ ./split-object-file.sh $$module.ko; \ --- a/Kbuild +++ b/Kbuild -@@ -161,7 +161,7 @@ NV_CONFTEST_SCRIPT := $(src)/conftest.sh +@@ -154,7 +154,7 @@ NV_CONFTEST_SCRIPT := $(src)/conftest.sh NV_CONFTEST_HEADER := $(obj)/conftest/headers.h NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST_SCRIPT) \ diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/use-kbuild-flags.patch nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/use-kbuild-flags.patch --- nvidia-open-gpu-kernel-modules-535.247.01/debian/patches/module/use-kbuild-flags.patch 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/patches/module/use-kbuild-flags.patch 2025-12-20 23:05:31.000000000 +0000 @@ -1,10 +1,6 @@ Author: Andreas Beckmann Author: Tomas Janousek Description: use KBUILD_CFLAGS and (KBUILD_)LDFLAGS - allows building a amd64 kernel module with i386 user space - . - skip -Werror=* since that breaks how conftest.sh detects stuff - . skip $(GCC_PLUGINS_CFLAGS): fixes build failure when a kernel is built with CONFIG_GCC_PLUGINS, CONFIG_GCC_PLUGIN_STRUCTLEAK and CONFIG_GCC_PLUGIN_RANDSTRUCT -- Tomas Janousek @@ -13,23 +9,33 @@ --- a/Kbuild +++ b/Kbuild -@@ -168,6 +168,16 @@ NV_CFLAGS_FROM_CONFTEST := $(shell $(NV_ - NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(EXTRA_CFLAGS) -fno-pie - NV_CONFTEST_CFLAGS += $(call cc-disable-warning,pointer-sign) - NV_CONFTEST_CFLAGS += $(call cc-option,-fshort-wchar,) -+NV_CONFTEST_CFLAGS += \ +@@ -150,6 +150,15 @@ endif + CC ?= cc + LD ?= ld + ++NV_REMOVE_KBUILD_CFLAGS = $(GCC_PLUGINS_CFLAGS) ++ ++NV_CFLAGS_FROM_KBUILD = \ + $(patsubst -DARM64_ASM_ARCH=%,-DARM64_ASM_ARCH="%",\ -+ $(filter-out $(GCC_PLUGINS_CFLAGS),\ ++ $(filter-out $(NV_REMOVE_KBUILD_CFLAGS),\ + $(KBUILD_CFLAGS)\ + )\ + ) -+NV_CONFTEST_CFLAGS += $(call cc-option,-Wno-error=implicit-function-declaration,) -+NV_CONFTEST_CFLAGS += $(call cc-option,-Wno-error=incompatible-pointer-types,) -+NV_CONFTEST_CFLAGS += $(call cc-option,-Wno-error=return-type,) -+NV_CONFTEST_CFLAGS += $(call cc-option,-Wno-error=strict-prototypes,) ++ + NV_CONFTEST_SCRIPT := $(src)/conftest.sh + NV_CONFTEST_HEADER := $(obj)/conftest/headers.h - NV_CONFTEST_COMPILE_TEST_HEADERS := $(obj)/conftest/macros.h - NV_CONFTEST_COMPILE_TEST_HEADERS += $(obj)/conftest/functions.h +@@ -158,7 +167,9 @@ NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST + + NV_CFLAGS_FROM_CONFTEST := $(shell $(NV_CONFTEST_CMD) build_cflags) + +-NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(ccflags-y) -fno-pie ++NV_CONFTEST_CFLAGS = ++NV_CONFTEST_CFLAGS += $(NV_CFLAGS_FROM_KBUILD) ++NV_CONFTEST_CFLAGS += $(NV_CFLAGS_FROM_CONFTEST) $(ccflags-y) -fno-pie + NV_CONFTEST_CFLAGS += $(filter -std=%,$(KBUILD_CFLAGS)) + NV_CONFTEST_CFLAGS += $(call cc-disable-warning,pointer-sign) + NV_CONFTEST_CFLAGS += $(call cc-option,-fshort-wchar,) --- a/nvidia/nvidia.Kbuild +++ b/nvidia/nvidia.Kbuild @@ -100,7 +100,7 @@ always += $(NVIDIA_INTERFACE) diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/rules nvidia-open-gpu-kernel-modules-535.261.03/debian/rules --- nvidia-open-gpu-kernel-modules-535.247.01/debian/rules 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/rules 2025-12-20 23:05:31.000000000 +0000 @@ -135,7 +135,7 @@ --mtime='@$(SOURCE_DATE_EPOCH)' \ --clamp-mtime \ --remove-files \ - modules | xz -T1 -9 > $(module_source_txz) + modules | xz -T+1 -9 > $(module_source_txz) tar tfv $(module_source_txz) ############################################################################ diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/rules.defs nvidia-open-gpu-kernel-modules-535.261.03/debian/rules.defs --- nvidia-open-gpu-kernel-modules-535.247.01/debian/rules.defs 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/rules.defs 2025-12-20 23:05:31.000000000 +0000 @@ -1,6 +1,6 @@ LINUX_KMOD_VARIANT = -open -LINUX_KMOD_TESTED = 6.14 +LINUX_KMOD_TESTED = 6.16 ARCH_LIST = amd64 ARCH_LIST += arm64 diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/debian/source/lintian-overrides nvidia-open-gpu-kernel-modules-535.261.03/debian/source/lintian-overrides --- nvidia-open-gpu-kernel-modules-535.247.01/debian/source/lintian-overrides 2025-05-08 20:10:43.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/debian/source/lintian-overrides 2025-12-20 23:05:31.000000000 +0000 @@ -1,11 +1,12 @@ +# patching is done by debian/rules instead of dpkg +patch-file-present-but-not-mentioned-in-series + # upstream provides no signatures debian-watch-does-not-check-openpgp-signature -# running tests would require nvidia hardware and using the kernel module +# running tests would require nvidia hardware and using the +# kernel module superficial-tests -# debian/patches/module/series gets generated and applied during the build process -patch-file-present-but-not-mentioned-in-series [debian/patches/module/*.patch] - # binary data very-long-line-length-in-source-file * > 512 [src/nvidia-modeset/src/shaders/g_*_shaders:*] diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/Kbuild nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/Kbuild --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/Kbuild 2025-03-26 06:23:16.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/Kbuild 2025-06-14 15:47:45.000000000 +0000 @@ -75,70 +75,63 @@ $(eval include $(src)/$(_module)/$(_module).Kbuild)) -# -# Define CFLAGS that apply to all the NVIDIA kernel modules. EXTRA_CFLAGS -# is deprecated since 2.6.24 in favor of ccflags-y, but we need to support -# older kernels which do not have ccflags-y. Newer kernels append -# $(EXTRA_CFLAGS) to ccflags-y for compatibility. -# - -EXTRA_CFLAGS += -I$(src)/common/inc -EXTRA_CFLAGS += -I$(src) -EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args -EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM -EXTRA_CFLAGS += -DNV_VERSION_STRING=\"535.247.01\" +ccflags-y += -I$(src)/common/inc +ccflags-y += -I$(src) +ccflags-y += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args +ccflags-y += -D__KERNEL__ -DMODULE -DNVRM +ccflags-y += -DNV_VERSION_STRING=\"535.261.03\" ifneq ($(SYSSRCHOST1X),) - EXTRA_CFLAGS += -I$(SYSSRCHOST1X) + ccflags-y += -I$(SYSSRCHOST1X) endif -EXTRA_CFLAGS += -Wno-unused-function +ccflags-y += -Wno-unused-function ifneq ($(NV_BUILD_TYPE),debug) - EXTRA_CFLAGS += -Wuninitialized + ccflags-y += -Wuninitialized endif -EXTRA_CFLAGS += -fno-strict-aliasing +ccflags-y += -fno-strict-aliasing ifeq ($(ARCH),arm64) - EXTRA_CFLAGS += -mstrict-align + ccflags-y += -mstrict-align endif ifeq ($(NV_BUILD_TYPE),debug) - EXTRA_CFLAGS += -g - EXTRA_CFLAGS += $(call cc-option,-gsplit-dwarf,) + ccflags-y += -g + ccflags-y += $(call cc-option,-gsplit-dwarf,) endif -EXTRA_CFLAGS += -ffreestanding +ccflags-y += -ffreestanding ifeq ($(ARCH),arm64) - EXTRA_CFLAGS += -mgeneral-regs-only -march=armv8-a - EXTRA_CFLAGS += $(call cc-option,-mno-outline-atomics,) + ccflags-y += -mgeneral-regs-only -march=armv8-a + ccflags-y += $(call cc-option,-mno-outline-atomics,) endif ifeq ($(ARCH),x86_64) - EXTRA_CFLAGS += -mno-red-zone -mcmodel=kernel + ccflags-y += -mno-red-zone -mcmodel=kernel endif ifeq ($(ARCH),powerpc) - EXTRA_CFLAGS += -mlittle-endian -mno-strict-align -mno-altivec + ccflags-y += -mlittle-endian -mno-strict-align -mno-altivec endif -EXTRA_CFLAGS += -DNV_UVM_ENABLE -EXTRA_CFLAGS += $(call cc-option,-Werror=undef,) -EXTRA_CFLAGS += -DNV_SPECTRE_V2=$(NV_SPECTRE_V2) -EXTRA_CFLAGS += -DNV_KERNEL_INTERFACE_LAYER +ccflags-y += -DNV_UVM_ENABLE +ccflags-y += $(call cc-option,-Werror=undef,) +ccflags-y += -DNV_SPECTRE_V2=$(NV_SPECTRE_V2) +ccflags-y += -DNV_KERNEL_INTERFACE_LAYER # # Detect SGI UV systems and apply system-specific optimizations. # ifneq ($(wildcard /proc/sgi_uv),) - EXTRA_CFLAGS += -DNV_CONFIG_X86_UV + ccflags-y += -DNV_CONFIG_X86_UV endif ifdef VGX_FORCE_VFIO_PCI_CORE - EXTRA_CFLAGS += -DNV_VGPU_FORCE_VFIO_PCI_CORE + ccflags-y += -DNV_VGPU_FORCE_VFIO_PCI_CORE endif # @@ -165,9 +158,11 @@ NV_CFLAGS_FROM_CONFTEST := $(shell $(NV_CONFTEST_CMD) build_cflags) -NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(EXTRA_CFLAGS) -fno-pie +NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(ccflags-y) -fno-pie +NV_CONFTEST_CFLAGS += $(filter -std=%,$(KBUILD_CFLAGS)) NV_CONFTEST_CFLAGS += $(call cc-disable-warning,pointer-sign) NV_CONFTEST_CFLAGS += $(call cc-option,-fshort-wchar,) +NV_CONFTEST_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types,) NV_CONFTEST_COMPILE_TEST_HEADERS := $(obj)/conftest/macros.h NV_CONFTEST_COMPILE_TEST_HEADERS += $(obj)/conftest/functions.h diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/common/inc/nv-mm.h nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/common/inc/nv-mm.h --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/common/inc/nv-mm.h 2025-03-26 06:23:00.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/common/inc/nv-mm.h 2025-06-14 15:47:28.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2016-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -292,9 +292,21 @@ #endif } +#define NV_CAN_CALL_VMA_START_WRITE 1 + +#if !NV_CAN_CALL_VMA_START_WRITE +/* + * Commit 45ad9f5290dc updated vma_start_write() to call __vma_start_write(). + */ +void nv_vma_start_write(struct vm_area_struct *); +#endif + static inline void nv_vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags) { -#if defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS) +#if !NV_CAN_CALL_VMA_START_WRITE + nv_vma_start_write(vma); + ACCESS_PRIVATE(vma, __vm_flags) |= flags; +#elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS) vm_flags_set(vma, flags); #else vma->vm_flags |= flags; @@ -303,7 +315,10 @@ static inline void nv_vm_flags_clear(struct vm_area_struct *vma, vm_flags_t flags) { -#if defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS) +#if !NV_CAN_CALL_VMA_START_WRITE + nv_vma_start_write(vma); + ACCESS_PRIVATE(vma, __vm_flags) &= ~flags; +#elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS) vm_flags_clear(vma, flags); #else vma->vm_flags &= ~flags; diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/common/inc/nv-timer.h nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/common/inc/nv-timer.h --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/common/inc/nv-timer.h 2025-03-26 06:22:56.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/common/inc/nv-timer.h 2025-06-14 15:47:24.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2017 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2017-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -63,4 +63,13 @@ #endif } +static inline void nv_timer_delete_sync(struct timer_list *timer) +{ +#if !defined(NV_BSD) && NV_IS_EXPORT_SYMBOL_PRESENT_timer_delete_sync + timer_delete_sync(timer); +#else + del_timer_sync(timer); +#endif +} + #endif // __NV_TIMER_H__ diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/conftest.sh nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/conftest.sh --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/conftest.sh 2025-03-26 05:51:40.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/conftest.sh 2025-06-14 15:31:09.000000000 +0000 @@ -4013,33 +4013,6 @@ fi ;; - dma_buf_has_dynamic_attachment) - # - # Determine if the function dma_buf_attachment_is_dynamic() - # is present. - # - # Added by commit: 15fd552d186c - # ("dma-buf: change DMA-buf locking convention v3") in v5.5 (2018-07-03) - # - echo "$CONFTEST_PREAMBLE - #include - bool conftest_dma_buf_attachment_is_dynamic(void) { - return dma_buf_attachment_is_dynamic(NULL); - }" > conftest$$.c - - $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 - rm -f conftest$$.c - - if [ -f conftest$$.o ]; then - echo "#define NV_DMA_BUF_HAS_DYNAMIC_ATTACHMENT" | append_conftest "functions" - rm -f conftest$$.o - return - else - echo "#undef NV_DMA_BUF_HAS_DYNAMIC_ATTACHMENT" | append_conftest "functions" - return - fi - ;; - dma_buf_attachment_has_peer2peer) # # Determine if peer2peer is present in struct dma_buf_attachment. @@ -6687,6 +6660,22 @@ compile_check_conftest "$CODE" "NV_DRM_UNLOCKED_IOCTL_FLAG_PRESENT" "" "types" ;; + page_pgmap) + # + # Determine if the page_pgmap() function is present. + # + # Added by commit 82ba975e4c43 ("mm: allow compound zone device + # pages") in v6.14 + # + CODE=" + #include + int conftest_page_pgmap(void) { + return page_pgmap(); + }" + + compile_check_conftest "$CODE" "NV_PAGE_PGMAP_PRESENT" "" "functions" + ;; + folio_test_swapcache) # # Determine if the folio_test_swapcache() function is present. @@ -6744,6 +6733,33 @@ compile_check_conftest "$CODE" "NV_DRM_DRIVER_HAS_DATE" "" "types" ;; + drm_connector_helper_funcs_mode_valid_has_const_mode_arg) + # + # Determine if the 'mode' pointer argument is const in + # drm_connector_helper_funcs::mode_valid. + # + # The 'mode' pointer argument in + # drm_connector_helper_funcs::mode_valid was made const by commit + # 26d6fd81916e ("drm/connector: make mode_valid take a const struct + # drm_display_mode") in linux-next, expected in v6.15. + # + CODE=" + #if defined(NV_DRM_DRM_ATOMIC_HELPER_H_PRESENT) + #include + #endif + + static int conftest_drm_connector_mode_valid(struct drm_connector *connector, + const struct drm_display_mode *mode) { + return 0; + } + + const struct drm_connector_helper_funcs conftest_drm_connector_helper_funcs = { + .mode_valid = conftest_drm_connector_mode_valid, + };" + + compile_check_conftest "$CODE" "NV_DRM_CONNECTOR_HELPER_FUNCS_MODE_VALID_HAS_CONST_MODE_ARG" "" "types" + ;; + # When adding a new conftest entry, please use the correct format for # specifying the relevant upstream Linux kernel commit. # diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-caps.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-caps.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-caps.c 2025-03-26 06:22:56.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-caps.c 2025-06-14 15:47:23.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -562,6 +562,9 @@ void NV_API_CALL nv_cap_close_fd(int fd) { + struct file *file; + NvBool is_nv_cap_fd; + if (fd == -1) { return; @@ -578,6 +581,30 @@ { task_unlock(current); return; + } + + file = fget(fd); + if (file == NULL) + { + task_unlock(current); + return; + } + + /* Make sure the fd belongs to the nv-cap-drv */ + is_nv_cap_fd = (file->f_op == &g_nv_cap_drv_fops); + + fput(file); + + /* + * In some cases, we may be in shutdown path and execute + * in context of unrelated process. In that case we should + * not access any 'current' state, but instead let kernel + * clean up capability files on its own. + */ + if (!is_nv_cap_fd) + { + task_unlock(current); + return; } /* diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-dmabuf.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-dmabuf.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-dmabuf.c 2025-03-26 06:22:54.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-dmabuf.c 2025-06-14 15:47:22.000000000 +0000 @@ -780,10 +780,9 @@ // On non-coherent platforms, importers must be able to handle peer // MMIO resources not backed by struct page. // -#if defined(NV_DMA_BUF_HAS_DYNAMIC_ATTACHMENT) && \ - defined(NV_DMA_BUF_ATTACHMENT_HAS_PEER2PEER) +#if defined(NV_DMA_BUF_ATTACHMENT_HAS_PEER2PEER) if (!priv->nv->coherent && - dma_buf_attachment_is_dynamic(attachment) && + (attachment->importer_ops != NULL) && !attachment->peer2peer) { nv_printf(NV_DBG_ERRORS, diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-mmap.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-mmap.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-mmap.c 2025-03-26 06:22:55.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-mmap.c 2025-06-14 15:47:22.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 1999-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 1999-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -804,3 +804,75 @@ nvl->safe_to_mmap = safe_to_mmap; } + +#if !NV_CAN_CALL_VMA_START_WRITE +static NvBool nv_vma_enter_locked(struct vm_area_struct *vma, NvBool detaching) +{ + NvU32 tgt_refcnt = VMA_LOCK_OFFSET; + NvBool interrupted = NV_FALSE; + if (!detaching) + { + tgt_refcnt++; + } + if (!refcount_add_not_zero(VMA_LOCK_OFFSET, &vma->vm_refcnt)) + { + return NV_FALSE; + } + + rwsem_acquire(&vma->vmlock_dep_map, 0, 0, _RET_IP_); + prepare_to_rcuwait(&vma->vm_mm->vma_writer_wait); + + for (;;) + { + set_current_state(TASK_UNINTERRUPTIBLE); + if (refcount_read(&vma->vm_refcnt) == tgt_refcnt) + break; + + if (signal_pending_state(TASK_UNINTERRUPTIBLE, current)) + { + interrupted = NV_TRUE; + break; + } + + schedule(); + } + + // This is an open-coded version of finish_rcuwait(). + rcu_assign_pointer(vma->vm_mm->vma_writer_wait.task, NULL); + __set_current_state(TASK_RUNNING); + + if (interrupted) + { + // Clean up on error: release refcount and dep_map + refcount_sub_and_test(VMA_LOCK_OFFSET, &vma->vm_refcnt); + rwsem_release(&vma->vmlock_dep_map, _RET_IP_); + return NV_FALSE; + } + + lock_acquired(&vma->vmlock_dep_map, _RET_IP_); + return NV_TRUE; +} + +/* + * Helper function to handle VMA locking and refcount management. + */ +void nv_vma_start_write(struct vm_area_struct *vma) +{ + NvU32 mm_lock_seq; + NvBool locked; + if (__is_vma_write_locked(vma, &mm_lock_seq)) + return; + + locked = nv_vma_enter_locked(vma, NV_FALSE); + + WRITE_ONCE(vma->vm_lock_seq, mm_lock_seq); + if (locked) + { + NvBool detached; + detached = refcount_sub_and_test(VMA_LOCK_OFFSET, &vma->vm_refcnt); + rwsem_release(&vma->vmlock_dep_map, _RET_IP_); + WARN_ON_ONCE(detached); + } +} +EXPORT_SYMBOL(nv_vma_start_write); +#endif // !NV_CAN_CALL_VMA_START_WRITE diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-nano-timer.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-nano-timer.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv-nano-timer.c 2025-03-26 06:22:54.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv-nano-timer.c 2025-06-14 15:47:22.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -154,8 +154,13 @@ nv_nstimer->nv_nano_timer_callback = nvidia_nano_timer_callback; #if NV_NANO_TIMER_USE_HRTIMER +#if NV_IS_EXPORT_SYMBOL_PRESENT_hrtimer_setup + hrtimer_setup(&nv_nstimer->hr_timer, &nv_nano_timer_callback_typed_data, + CLOCK_MONOTONIC, HRTIMER_MODE_REL); +#else hrtimer_init(&nv_nstimer->hr_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); nv_nstimer->hr_timer.function = nv_nano_timer_callback_typed_data; +#endif // NV_IS_EXPORT_SYMBOL_PRESENT_hrtimer_setup #else #if defined(NV_TIMER_SETUP_PRESENT) timer_setup(&nv_nstimer->jiffy_timer, nv_jiffy_timer_callback_typed_data, 0); @@ -213,7 +218,7 @@ #if NV_NANO_TIMER_USE_HRTIMER hrtimer_cancel(&nv_nstimer->hr_timer); #else - del_timer_sync(&nv_nstimer->jiffy_timer); + nv_timer_delete_sync(&nv_nstimer->jiffy_timer); #endif } diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nv.c 2025-03-26 06:22:54.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nv.c 2025-06-14 15:47:22.000000000 +0000 @@ -3753,7 +3753,7 @@ nv_printf(NV_DBG_INFO, "NVRM: stopping rc timer\n"); nv->rc_timer_enabled = 0; - del_timer_sync(&nvl->rc_timer.kernel_timer); + nv_timer_delete_sync(&nvl->rc_timer.kernel_timer); nv_printf(NV_DBG_INFO, "NVRM: rc timer stopped\n"); return 0; @@ -3797,7 +3797,7 @@ NV_SPIN_UNLOCK_IRQRESTORE(&nvl->snapshot_timer_lock, flags); if (timer_active) - del_timer_sync(&nvl->snapshot_timer.kernel_timer); + nv_timer_delete_sync(&nvl->snapshot_timer.kernel_timer); } void NV_API_CALL nv_flush_snapshot_timer(void) diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nvidia.Kbuild nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nvidia.Kbuild --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia/nvidia.Kbuild 2025-03-26 06:22:54.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia/nvidia.Kbuild 2025-06-14 15:47:21.000000000 +0000 @@ -186,7 +186,6 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_ops_has_kmap_atomic NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_ops_has_map NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_ops_has_map_atomic -NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_has_dynamic_attachment NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_attachment_has_peer2peer NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_set_mask_and_coherent NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_clk_bulk_get_all @@ -231,6 +230,11 @@ NV_CONFTEST_SYMBOL_COMPILE_TESTS += follow_pte_arg_vma NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_follow_pfnmap_start NV_CONFTEST_SYMBOL_COMPILE_TESTS += ecc_digits_from_bytes +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_timer_delete_sync +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_hrtimer_setup +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_gpl___vma_start_write +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_gpl_iommu_dev_enable_feature +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_gpl_iommu_dev_disable_feature NV_CONFTEST_TYPE_COMPILE_TESTS += dma_ops NV_CONFTEST_TYPE_COMPILE_TESTS += swiotlb_dma_ops diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-drm/nvidia-drm-connector.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-drm/nvidia-drm-connector.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-drm/nvidia-drm-connector.c 2025-03-26 06:16:31.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-drm/nvidia-drm-connector.c 2025-06-14 15:40:03.000000000 +0000 @@ -314,7 +314,11 @@ } static int nv_drm_connector_mode_valid(struct drm_connector *connector, +#if defined(NV_DRM_CONNECTOR_HELPER_FUNCS_MODE_VALID_HAS_CONST_MODE_ARG) + const struct drm_display_mode *mode) +#else struct drm_display_mode *mode) +#endif { struct drm_device *dev = connector->dev; struct nv_drm_device *nv_dev = to_nv_device(dev); diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-drm/nvidia-drm.Kbuild nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-drm/nvidia-drm.Kbuild --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-drm/nvidia-drm.Kbuild 2025-03-26 05:52:36.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-drm/nvidia-drm.Kbuild 2025-06-14 15:31:13.000000000 +0000 @@ -56,6 +56,7 @@ NV_CONFTEST_GENERIC_COMPILE_TESTS += drm_alpha_blending_available NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_fd_to_handle NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_handle_to_fd +NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_gpl___vma_start_write NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_dev_unref NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_reinit_primary_mode_group @@ -137,3 +138,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_output_poll_changed NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_date NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations_fop_unsigned_offset_present +NV_CONFTEST_TYPE_COMPILE_TESTS += drm_connector_helper_funcs_mode_valid_has_const_mode_arg diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-modeset/nvidia-modeset-linux.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-modeset/nvidia-modeset-linux.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-modeset/nvidia-modeset-linux.c 2025-03-26 06:14:50.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-modeset/nvidia-modeset-linux.c 2025-06-14 15:41:39.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2015-21 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2015-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -652,7 +652,11 @@ * pending timers and than waiting for workqueue callbacks. */ if (timer->kernel_timer_created) { +#if !defined(NV_BSD) && NV_IS_EXPORT_SYMBOL_PRESENT_timer_delete_sync + timer_delete_sync(&timer->kernel_timer); +#else del_timer_sync(&timer->kernel_timer); +#endif } /* @@ -1743,7 +1747,11 @@ * completion, and we wait for queue completion with * nv_kthread_q_stop below. */ +#if !defined(NV_BSD) && NV_IS_EXPORT_SYMBOL_PRESENT_timer_delete_sync + if (timer_delete_sync(&timer->kernel_timer) == 1) { +#else if (del_timer_sync(&timer->kernel_timer) == 1) { +#endif /* We've deactivated timer so we need to clean after it */ list_del(&timer->timers_list); diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-modeset/nvidia-modeset.Kbuild nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-modeset/nvidia-modeset.Kbuild --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-modeset/nvidia-modeset.Kbuild 2025-03-26 05:52:36.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-modeset/nvidia-modeset.Kbuild 2025-06-14 15:31:14.000000000 +0000 @@ -91,3 +91,4 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += ktime_get_raw_ts64 NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_video_backlight_use_native NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_video_register_backlight +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_timer_delete_sync diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/nvidia-uvm.Kbuild nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/nvidia-uvm.Kbuild --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/nvidia-uvm.Kbuild 2025-03-26 06:22:54.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/nvidia-uvm.Kbuild 2025-06-14 15:47:21.000000000 +0000 @@ -87,6 +87,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_sva_bind_device_has_drvdata_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += vm_fault_to_errno NV_CONFTEST_FUNCTION_COMPILE_TESTS += folio_test_swapcache +NV_CONFTEST_FUNCTION_COMPILE_TESTS += page_pgmap NV_CONFTEST_TYPE_COMPILE_TESTS += backing_dev_info NV_CONFTEST_TYPE_COMPILE_TESTS += mm_context_t @@ -116,3 +117,5 @@ NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_int_active_memcg NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_migrate_vma_setup +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present___iowrite64_lo_hi +NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_make_device_exclusive diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_ats_sva.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_ats_sva.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_ats_sva.c 2025-03-26 06:23:01.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_ats_sva.c 2025-06-14 15:47:30.000000000 +0000 @@ -139,7 +139,11 @@ static void smmu_vcmdq_write64(void __iomem *smmu_cmdqv_base, int reg, NvU64 val) { +#if NV_IS_EXPORT_SYMBOL_PRESENT___iowrite64_lo_hi + __iowrite64_lo_hi(val, SMMU_VCMDQ_BASE_ADDR(smmu_cmdqv_base, VCMDQ) + reg); +#else iowrite64(val, SMMU_VCMDQ_BASE_ADDR(smmu_cmdqv_base, VCMDQ) + reg); +#endif } // Fix for Bug 4130089: [GH180][r535] WAR for kernel not issuing SMMU @@ -304,12 +308,13 @@ NV_STATUS uvm_ats_sva_add_gpu(uvm_parent_gpu_t *parent_gpu) { +#if NV_IS_EXPORT_SYMBOL_GPL_iommu_dev_enable_feature int ret; ret = iommu_dev_enable_feature(&parent_gpu->pci_dev->dev, IOMMU_DEV_FEAT_SVA); if (ret) return errno_to_nv_status(ret); - +#endif if (UVM_ATS_SMMU_WAR_REQUIRED()) return uvm_ats_smmu_war_init(parent_gpu); else @@ -321,7 +326,9 @@ if (UVM_ATS_SMMU_WAR_REQUIRED()) uvm_ats_smmu_war_deinit(parent_gpu); +#if NV_IS_EXPORT_SYMBOL_GPL_iommu_dev_disable_feature iommu_dev_disable_feature(&parent_gpu->pci_dev->dev, IOMMU_DEV_FEAT_SVA); +#endif } NV_STATUS uvm_ats_sva_bind_gpu(uvm_gpu_va_space_t *gpu_va_space) diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_hmm.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_hmm.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_hmm.c 2025-03-26 06:23:12.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_hmm.c 2025-06-14 15:47:41.000000000 +0000 @@ -1864,7 +1864,7 @@ dpage = pfn_to_page(pfn); UVM_ASSERT(is_device_private_page(dpage)); - UVM_ASSERT(dpage->pgmap->owner == &g_uvm_global); + UVM_ASSERT(page_pgmap(dpage)->owner == &g_uvm_global); hmm_mark_gpu_chunk_referenced(va_block, gpu, gpu_chunk); UVM_ASSERT(!page_count(dpage)); @@ -2281,6 +2281,39 @@ } } +static int hmm_make_device_exclusive_range(struct mm_struct *mm, + unsigned long start, + unsigned long end, + struct page **pages) +{ +#if NV_IS_EXPORT_SYMBOL_PRESENT_make_device_exclusive + unsigned long addr; + int npages = 0; + + for (addr = start; addr < end; addr += PAGE_SIZE) { + struct folio *folio; + struct page *page; + + page = make_device_exclusive(mm, addr, &g_uvm_global, &folio); + if (IS_ERR(page)) { + while (npages) { + page = pages[--npages]; + unlock_page(page); + put_page(page); + } + npages = PTR_ERR(page); + break; + } + + pages[npages++] = page; + } + + return npages; +#else + return make_device_exclusive_range(mm, start, end, pages, &g_uvm_global); +#endif +} + static NV_STATUS hmm_block_atomic_fault_locked(uvm_processor_id_t processor_id, uvm_va_block_t *va_block, uvm_va_block_retry_t *va_block_retry, @@ -2336,11 +2369,10 @@ uvm_mutex_unlock(&va_block->lock); - npages = make_device_exclusive_range(service_context->block_context.mm, + npages = hmm_make_device_exclusive_range(service_context->block_context.mm, uvm_va_block_cpu_page_address(va_block, region.first), uvm_va_block_cpu_page_address(va_block, region.outer - 1) + PAGE_SIZE, - pages + region.first, - &g_uvm_global); + pages + region.first); uvm_mutex_lock(&va_block->lock); diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_linux.h nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_linux.h --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_linux.h 2025-03-26 06:23:02.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_linux.h 2025-06-14 15:47:30.000000000 +0000 @@ -590,4 +590,9 @@ #include #define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x))) #endif + +#ifndef NV_PAGE_PGMAP_PRESENT +#define page_pgmap(page) (page)->pgmap +#endif + #endif // _UVM_LINUX_H diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_pmm_gpu.c nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_pmm_gpu.c --- nvidia-open-gpu-kernel-modules-535.247.01/kernel-open/nvidia-uvm/uvm_pmm_gpu.c 2025-03-26 06:23:11.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/kernel-open/nvidia-uvm/uvm_pmm_gpu.c 2025-06-14 15:47:40.000000000 +0000 @@ -3314,7 +3314,7 @@ static uvm_pmm_gpu_t *devmem_page_to_pmm(struct page *page) { - return container_of(page->pgmap, uvm_pmm_gpu_t, devmem.pagemap); + return container_of(page_pgmap(page), uvm_pmm_gpu_t, devmem.pagemap); } static uvm_gpu_chunk_t *devmem_page_to_chunk_locked(struct page *page) diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/common/inc/nvBldVer.h nvidia-open-gpu-kernel-modules-535.261.03/src/common/inc/nvBldVer.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/common/inc/nvBldVer.h 2025-03-26 06:11:42.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/common/inc/nvBldVer.h 2025-06-14 15:37:54.000000000 +0000 @@ -36,25 +36,25 @@ // and then checked back in. You cannot make changes to these sections without // corresponding changes to the buildmeister script #ifndef NV_BUILD_BRANCH - #define NV_BUILD_BRANCH r539_28 + #define NV_BUILD_BRANCH r539_41 #endif #ifndef NV_PUBLIC_BRANCH - #define NV_PUBLIC_BRANCH r539_28 + #define NV_PUBLIC_BRANCH r539_41 #endif #if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS) -#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r535/r539_28-859" -#define NV_BUILD_CHANGELIST_NUM (35750789) +#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r535/r539_41-927" +#define NV_BUILD_CHANGELIST_NUM (36124219) #define NV_BUILD_TYPE "Official" -#define NV_BUILD_NAME "rel/gpu_drv/r535/r539_28-859" -#define NV_LAST_OFFICIAL_CHANGELIST_NUM (35750789) +#define NV_BUILD_NAME "rel/gpu_drv/r535/r539_41-927" +#define NV_LAST_OFFICIAL_CHANGELIST_NUM (36124219) #else /* Windows builds */ -#define NV_BUILD_BRANCH_VERSION "r539_28-1" -#define NV_BUILD_CHANGELIST_NUM (35750715) +#define NV_BUILD_BRANCH_VERSION "r539_41-1" +#define NV_BUILD_CHANGELIST_NUM (36117060) #define NV_BUILD_TYPE "Official" -#define NV_BUILD_NAME "539.29" -#define NV_LAST_OFFICIAL_CHANGELIST_NUM (35750715) +#define NV_BUILD_NAME "539.42" +#define NV_LAST_OFFICIAL_CHANGELIST_NUM (36117060) #define NV_BUILD_BRANCH_BASE_VERSION R535 #endif // End buildmeister python edited section diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/common/inc/nvUnixVersion.h nvidia-open-gpu-kernel-modules-535.261.03/src/common/inc/nvUnixVersion.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/common/inc/nvUnixVersion.h 2025-03-26 06:11:42.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/common/inc/nvUnixVersion.h 2025-06-14 15:37:54.000000000 +0000 @@ -4,7 +4,7 @@ #if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS) || defined(NV_VMWARE) || defined(NV_QNX) || defined(NV_INTEGRITY) || \ (defined(RMCFG_FEATURE_PLATFORM_GSP) && RMCFG_FEATURE_PLATFORM_GSP == 1) -#define NV_VERSION_STRING "535.247.01" +#define NV_VERSION_STRING "535.261.03" #else diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/common/nvswitch/kernel/ls10/minion_ls10.c nvidia-open-gpu-kernel-modules-535.261.03/src/common/nvswitch/kernel/ls10/minion_ls10.c --- nvidia-open-gpu-kernel-modules-535.247.01/src/common/nvswitch/kernel/ls10/minion_ls10.c 2025-03-26 06:12:10.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/common/nvswitch/kernel/ls10/minion_ls10.c 2025-06-14 15:38:21.000000000 +0000 @@ -934,7 +934,6 @@ if (tempStatus != NVL_SUCCESS) { NVSWITCH_PRINT(device, ERROR, "Link %d Inband Buffer transfer for RX_BUFFER_CLEAR\n", linkId); - return; } if (device->link[linkId].inbandData.message != NULL) { diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/arch/nvalloc/common/inc/nvcst.h nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/arch/nvalloc/common/inc/nvcst.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/arch/nvalloc/common/inc/nvcst.h 2025-03-26 06:12:13.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/arch/nvalloc/common/inc/nvcst.h 2025-06-14 15:38:23.000000000 +0000 @@ -65,7 +65,6 @@ CHIPSET_SETUP_FUNC(Intel_4381_setupFunc) CHIPSET_SETUP_FUNC(Intel_7A82_setupFunc) CHIPSET_SETUP_FUNC(Intel_7A04_setupFunc) -CHIPSET_SETUP_FUNC(Intel_1B81_setupFunc) CHIPSET_SETUP_FUNC(SiS_656_setupFunc) CHIPSET_SETUP_FUNC(ATI_RS400_setupFunc) CHIPSET_SETUP_FUNC(ATI_RS480_setupFunc) @@ -187,8 +186,8 @@ {PCI_VENDOR_ID_INTEL, 0x4385, CS_INTEL_4381, "Intel-RocketLake", Intel_4381_setupFunc}, {PCI_VENDOR_ID_INTEL, 0x7A82, CS_INTEL_7A82, "Intel-AlderLake", Intel_7A82_setupFunc}, {PCI_VENDOR_ID_INTEL, 0x7A84, CS_INTEL_7A82, "Intel-AlderLake", Intel_7A82_setupFunc}, - {PCI_VENDOR_ID_INTEL, 0x1B81, CS_INTEL_1B81, "Intel-SapphireRapids", Intel_1B81_setupFunc}, - {PCI_VENDOR_ID_INTEL, 0x7A8A, CS_INTEL_1B81, "Intel-SapphireRapids", Intel_1B81_setupFunc}, + {PCI_VENDOR_ID_INTEL, 0x1B81, CS_INTEL_1B81, "Intel-SapphireRapids", NULL}, + {PCI_VENDOR_ID_INTEL, 0x7A8A, CS_INTEL_1B81, "Intel-SapphireRapids", NULL}, {PCI_VENDOR_ID_INTEL, 0x18DC, CS_INTEL_18DC, "Intel-IceLake", NULL}, {PCI_VENDOR_ID_INTEL, 0x7A04, CS_INTEL_7A04, "Intel-RaptorLake", Intel_7A04_setupFunc}, {PCI_VENDOR_ID_INTEL, 0x5795, CS_INTEL_5795, "Intel-GraniteRapids", NULL}, diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/arch/nvalloc/common/inc/nvpcie.h nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/arch/nvalloc/common/inc/nvpcie.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/arch/nvalloc/common/inc/nvpcie.h 2025-03-26 06:12:13.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/arch/nvalloc/common/inc/nvpcie.h 2025-06-14 15:38:23.000000000 +0000 @@ -224,6 +224,20 @@ #define NV_PCI_VIRTUAL_P2P_APPROVAL_SIGNATURE 0x00503250 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_0 0x000000D4 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_0_ID 7:0 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_0_NEXT 15:8 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_0_LENGTH 23:16 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_0_SIG_LO 31:24 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_1 0x000000D8 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_1_SIG_HI 15:0 +#define NV_PCI_VIRTUAL_CONFIG_BITS_CAP_1_VALUE 31:16 + +#define NV_PCI_VIRTUAL_CONFIG_BITS_SIGNATURE 0x00535442 //"BTS" + +// Allocation of _VALUE bits +#define NV_PCI_VIRTUAL_CONFIG_BITS_PCI_EGRESS_POISON_ENABLE 0:0 + // Chipset-specific definitions. // Intel SantaRosa definitions #define INTEL_2A00_CONFIG_SPACE_BASE 0x60 diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/arch/nvalloc/common/inc/oob/smbpbi_priv.h nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/arch/nvalloc/common/inc/oob/smbpbi_priv.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/arch/nvalloc/common/inc/oob/smbpbi_priv.h 2025-03-26 06:12:13.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/arch/nvalloc/common/inc/oob/smbpbi_priv.h 2025-06-14 15:38:24.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2010-2017 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2010-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -47,33 +47,13 @@ #define NV_MSGBOX_CMD_ERR_MORE_PROCESSING_REQUIRED 0x000000F0 // -// Alternative encodings of the command word -// These are distinguished by a non-zero value in the 29:29 bit, -// previously known as _RSVD. +// Alternative encodings of the command word. +// These were distinguished by a non-zero value in the 29:29 bit. +// Bit 29 is now reserved and must be 0 i.e. only standard requests will be processed +// and debug requests would fail. // #define NV_MSGBOX_CMD_ENCODING 29:29 #define NV_MSGBOX_CMD_ENCODING_STANDARD 0x00000000 -#define NV_MSGBOX_CMD_ENCODING_DEBUG 0x00000001 - -// Debug command structure -#define NV_MSGBOX_DEBUG_CMD_OPCODE 1:0 -#define NV_MSGBOX_DEBUG_CMD_OPCODE_READ_PRIV 0x00000000 - -#define NV_MSGBOX_DEBUG_CMD_ARG 23:2 - -/* Utility command constructor macros */ - -#define NV_MSGBOX_DEBUG_CMD(opcode, arg) \ - ( \ - DRF_DEF(_MSGBOX, _DEBUG_CMD, _OPCODE, opcode) | \ - DRF_NUM(_MSGBOX, _DEBUG_CMD, _ARG, (arg)) | \ - DRF_DEF(_MSGBOX, _CMD, _STATUS, _NULL) | \ - DRF_DEF(_MSGBOX, _CMD, _ENCODING, _DEBUG) | \ - DRF_DEF(_MSGBOX, _CMD, _INTR, _PENDING) \ - ) - -#define NV_MSGBOX_DEBUG_CMD_READ_PRIV(offset) \ - NV_MSGBOX_DEBUG_CMD(_READ_PRIV, (offset) >> 2) #endif // _SMBPBI_PRIV_H_ diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/generated/g_gpu_access_nvoc.h nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/generated/g_gpu_access_nvoc.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/generated/g_gpu_access_nvoc.h 2025-03-26 06:16:47.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/generated/g_gpu_access_nvoc.h 2025-06-14 15:42:31.000000000 +0000 @@ -216,6 +216,14 @@ // Get the address of a register given the Aperture and offset. #define REG_GET_ADDR(ap, offset) ioaprtGetRegAddr(ap, offset) +// +// These UNCHECKED macros are provided for extenuating circumstances to avoid the 0xbadf +// sanity checking done by the usual register read utilities and must not be used generally +// +// +#define GPU_REG_RD08_UNCHECKED(g,a) osDevReadReg008(g, gpuGetDeviceMapping(g, DEVICE_INDEX_GPU, 0), a) +#define GPU_REG_RD32_UNCHECKED(g,a) osDevReadReg032(g, gpuGetDeviceMapping(g, DEVICE_INDEX_GPU, 0), a) + // GPU macros defined in terms of DEV_ macros #define GPU_REG_RD08(g,a) REG_INST_RD08(g,GPU,0,a) #define GPU_REG_RD16(g,a) REG_INST_RD16(g,GPU,0,a) diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/generated/g_gpu_nvoc.h nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/generated/g_gpu_nvoc.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/generated/g_gpu_nvoc.h 2025-03-26 06:16:49.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/generated/g_gpu_nvoc.h 2025-06-14 15:42:33.000000000 +0000 @@ -7,7 +7,7 @@ #endif /* - * SPDX-FileCopyrightText: Copyright (c) 2004-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2004-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -1016,6 +1016,7 @@ NvBool gpuLinkTerminationEnabled; NvBool gspRmInitialized; _GPU_PCIE_PEER_CLIQUE pciePeerClique; + NvU16 virtualConfigBits; NvU32 i2cPortForExtdev; GPUIDINFO idInfo; _GPU_CHIP_INFO chipInfo; diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/generated/rmconfig.h nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/generated/rmconfig.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/generated/rmconfig.h 2025-03-26 06:11:41.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/generated/rmconfig.h 2025-06-14 15:37:54.000000000 +0000 @@ -294,6 +294,7 @@ #define RMCFG_FEATURE_FEATURE_GH180 1 // RMconfig to encapsulate GH180 features #define RMCFG_FEATURE_MULTICAST_FABRIC 1 // Support for MULTICAST_FABRIC #define RMCFG_FEATURE_NVLINK_ERROR_THRESHOLD 1 // Support for NVLINK_ERROR_THRESHOLD +#define RMCFG_FEATURE_TPC_REPAIR 1 // Support for TPC swapping in-field #define RMCFG_FEATURE_FABRIC_LINEAR_ADDRESSING 1 // Unicast fabric memory management diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h 2025-03-26 06:12:20.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h 2025-06-14 15:38:30.000000000 +0000 @@ -174,6 +174,7 @@ BUSINFO chipsetIDInfo; ACPI_METHOD_DATA acpiMethodData; NvU32 hypervisorType; + NvU16 virtualConfigBits; NvBool bIsPassthru; NvU64 sysTimerOffsetNs; GSP_VF_INFO gspVFInfo; diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/kernel/vgpu/nv/rpc.c nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/kernel/vgpu/nv/rpc.c --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/kernel/vgpu/nv/rpc.c 2025-03-26 06:12:32.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/kernel/vgpu/nv/rpc.c 2025-06-14 15:38:40.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2008-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2008-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -1337,6 +1337,7 @@ rpcInfo->upstreamAddressValid = pGpu->gpuClData.upstreamPort.addr.valid; rpcInfo->hypervisorType = hypervisorGetHypervisorType(pHypervisor); + rpcInfo->virtualConfigBits = pGpu->virtualConfigBits; rpcInfo->bIsPassthru = pGpu->bIsPassthru; // Fill in VF related GPU flags @@ -1457,6 +1458,8 @@ if (IS_GSP_CLIENT(pGpu)) { rpc_dump_protobuf_component_v18_12 *rpc_params = &rpc_message->dump_protobuf_component_v18_12; + const NvU32 fixed_param_size = sizeof(rpc_message_header_v) + sizeof(*rpc_params); + NV_ASSERT_OR_RETURN(fixed_param_size <= pRpc->maxRpcSize, NV_ERR_INVALID_STATE); status = rpcWriteCommonHeader(pGpu, pRpc, NV_VGPU_MSG_FUNCTION_DUMP_PROTOBUF_COMPONENT, sizeof(*rpc_params)); @@ -1468,7 +1471,7 @@ rpc_params->countOnly = ((pPrbEnc->flags & PRB_COUNT_ONLY) != 0); rpc_params->bugCheckCode = pNvDumpState->bugCheckCode; rpc_params->internalCode = pNvDumpState->internalCode; - rpc_params->bufferSize = NV_MIN(pRpc->maxRpcSize, prbEncBufLeft(pPrbEnc)); + rpc_params->bufferSize = NV_MIN(pRpc->maxRpcSize - fixed_param_size, prbEncBufLeft(pPrbEnc)); status = _issueRpcAndWait(pGpu, pRpc); diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/gpu/arch/hopper/kern_gpu_gh100.c nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/gpu/arch/hopper/kern_gpu_gh100.c --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/gpu/arch/hopper/kern_gpu_gh100.c 2025-03-26 06:12:33.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/gpu/arch/hopper/kern_gpu_gh100.c 2025-06-14 15:38:42.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -22,6 +22,7 @@ */ #include "gpu/gpu.h" +#include "gpu/gpu_access.h" #include "gpu/gpu_child_class_defs.h" #include "os/os.h" #include "nverror.h" @@ -95,7 +96,7 @@ NvU32 *pData ) { - *pData = GPU_REG_RD32(pGpu, DEVICE_BASE(NV_EP_PCFGM) + index); + *pData = GPU_REG_RD32_UNCHECKED(pGpu, DEVICE_BASE(NV_EP_PCFGM) + index); return NV_OK; } diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/gpu/fsp/kern_fsp.c nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/gpu/fsp/kern_fsp.c --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/gpu/fsp/kern_fsp.c 2025-03-26 06:12:41.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/gpu/fsp/kern_fsp.c 2025-06-14 15:38:49.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -229,8 +229,30 @@ return (cmdqHead == cmdqTail); } +/* + * @brief GpuWaitConditionFunc for MBOX receiver ready + * + * @param[in] pGpu GPU object pointer + * @param[in] pCondData KernelFsp object pointer + * + * @returns NvBool NV_TRUE if command and message fsp + * queues are empty + */ +static NvBool +_kfspWaitForQueuesEmpty +( + OBJGPU *pGpu, + void *pCondData +) +{ + KernelFsp *pKernelFsp = (KernelFsp*) pCondData; + + return kfspIsQueueEmpty(pGpu, pKernelFsp) && + kfspIsMsgQueueEmpty(pGpu, pKernelFsp); +} + /*! - * @brief Wait for FSP RM command queue to be empty + * @brief Wait for FSP RM queues to be empty * * @param[in] pGpu OBJGPU pointer * @param[in] pKernelFsp KernelFsp pointer @@ -251,40 +273,11 @@ GPU_TIMEOUT_FLAGS_OSTIMER | GPU_TIMEOUT_FLAGS_BYPASS_THREAD_STATE); - while (!kfspIsQueueEmpty(pGpu, pKernelFsp)) + status = gpuTimeoutCondWait(pGpu, _kfspWaitForQueuesEmpty, pKernelFsp, &timeout); + if (status != NV_OK) { - // - // For now we assume that any response from FSP before RM message - // send is complete indicates an error and we should abort. - // - // Ongoing dicussion on usefullness of this check. Bug to be filed. - // - if (!kfspIsMsgQueueEmpty(pGpu, pKernelFsp)) - { - kfspReadMessage(pGpu, pKernelFsp, NULL, 0); - NV_PRINTF(LEVEL_ERROR, - "Received error message from FSP while waiting for CMDQ to be empty.\n"); - status = NV_ERR_GENERIC; - break; - } - - osSpinLoop(); - - status = gpuCheckTimeout(pGpu, &timeout); - if (status != NV_OK) - { - if ((status == NV_ERR_TIMEOUT) && - kfspIsQueueEmpty(pGpu, pKernelFsp)) - { - status = NV_OK; - } - else - { - NV_PRINTF(LEVEL_ERROR, - "Timed out waiting for FSP command queue to be empty.\n"); - } - break; - } + NV_PRINTF(LEVEL_ERROR, + "Timed out waiting for FSP queues to be empty.\n"); } return status; diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/gpu/mig_mgr/gpu_instance_subscription.c nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/gpu/mig_mgr/gpu_instance_subscription.c --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/gpu/mig_mgr/gpu_instance_subscription.c 2025-03-26 06:12:49.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/gpu/mig_mgr/gpu_instance_subscription.c 2025-06-14 15:38:57.000000000 +0000 @@ -421,7 +421,7 @@ .inst.request.requestFlags = pParams->flags }; - if (!hypervisorIsVgxHyper()) + if (!gpuIsSriovEnabled(pGpu)) { request.inst.request.requestFlags = FLD_SET_DRF(C637_CTRL, _DMA_EXEC_PARTITIONS_CREATE_REQUEST, _WITH_PART_ID, _FALSE, request.inst.request.requestFlags); } diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/platform/chipset/chipset_info.c nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/platform/chipset/chipset_info.c --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/platform/chipset/chipset_info.c 2025-03-26 06:12:59.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/platform/chipset/chipset_info.c 2025-06-14 15:39:06.000000000 +0000 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2004-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2004-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a @@ -902,17 +902,6 @@ return NV_OK; } - -static NV_STATUS -Intel_1B81_setupFunc -( - OBJCL *pCl -) -{ - pCl->setProperty(pCl, PDB_PROP_CL_RELAXED_ORDERING_NOT_CAPABLE, NV_TRUE); - - return NV_OK; -} static NV_STATUS Nvidia_T210_setupFunc diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/platform/chipset/chipset_pcie.c nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/platform/chipset/chipset_pcie.c --- nvidia-open-gpu-kernel-modules-535.247.01/src/nvidia/src/kernel/platform/chipset/chipset_pcie.c 2025-03-26 06:12:59.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/src/nvidia/src/kernel/platform/chipset/chipset_pcie.c 2025-06-14 15:39:06.000000000 +0000 @@ -73,6 +73,7 @@ static void objClGpuUnmapEnhCfgSpace(OBJGPU *); static NV_STATUS objClGpuIs3DController(OBJGPU *); static void objClLoadPcieVirtualP2PApproval(OBJGPU *); +static void objClLoadPcieVirtualConfigBits(OBJGPU *); static void objClCheckForExternalGpu(OBJGPU *, OBJCL *); static void _objClAdjustTcVcMap(OBJGPU *, OBJCL *, PORTDATA *); static void _objClGetDownstreamAtomicsEnabledMask(void *, NvU32, NvU32 *); @@ -953,6 +954,9 @@ // Load PCI Express virtual P2P approval config objClLoadPcieVirtualP2PApproval(pGpu); + // Load additional configuraiton bits from virtualized cfg space + objClLoadPcieVirtualConfigBits(pGpu); + // // Disable NOSNOOP bit for Passthrough. // @@ -4329,6 +4333,57 @@ gpuGetInstance(pGpu), pGpu->pciePeerClique.id); } +static void +objClLoadPcieVirtualConfigBits(OBJGPU *pGpu) +{ + void *handle; + NvU32 data32; + NvU8 cap; + NvU8 bus = gpuGetBus(pGpu); + NvU8 device = gpuGetDevice(pGpu); + NvU32 domain = gpuGetDomain(pGpu); + NvU32 offset = 0; + NvU32 sig = 0; + + if (!IS_PASSTHRU(pGpu)) + { + NV_PRINTF(LEVEL_INFO, + "Skipping non-pass-through GPU%u\n", gpuGetInstance(pGpu)); + return; + } + + handle = osPciInitHandle(domain, bus, device, 0, NULL, NULL); + + // + // Walk the list and find enable bits + // + cap = osPciReadByte(handle, PCI_CAPABILITY_LIST); + while ((cap != 0) && (sig != NV_PCI_VIRTUAL_CONFIG_BITS_SIGNATURE)) + { + offset = cap; + data32 = osPciReadDword(handle, offset); + cap = (NvU8)((data32 >> 8) & 0xFF); + + if ((data32 & CAP_ID_MASK) != CAP_ID_VENDOR_SPECIFIC) + continue; + + sig = DRF_VAL(_PCI, _VIRTUAL_CONFIG_BITS_CAP_0, _SIG_LO, data32); + data32 = osPciReadDword(handle, offset + 4); + sig |= (DRF_VAL(_PCI, _VIRTUAL_CONFIG_BITS_CAP_1, _SIG_HI, data32) << 8); + } + + if (sig == NV_PCI_VIRTUAL_CONFIG_BITS_SIGNATURE) + { + // data32 now contains the second dword of the capability structure. + pGpu->virtualConfigBits = + (NvU16) DRF_VAL(_PCI, _VIRTUAL_CONFIG_BITS_CAP_1, _VALUE, data32); + + NV_PRINTF(LEVEL_INFO, + "Hypervisor has specified config bits %u for GPU%u\n", + pGpu->virtualConfigBits, gpuGetInstance(pGpu)); + } +} + /*! * @brief Traverse bus topology till Gpu's root port. * If any of the intermediate bridge has TB3 supported vendorId and hotplug diff -Nru nvidia-open-gpu-kernel-modules-535.247.01/version.mk nvidia-open-gpu-kernel-modules-535.261.03/version.mk --- nvidia-open-gpu-kernel-modules-535.247.01/version.mk 2025-03-26 13:46:48.000000000 +0000 +++ nvidia-open-gpu-kernel-modules-535.261.03/version.mk 2025-06-14 16:21:12.000000000 +0000 @@ -1,4 +1,4 @@ -NVIDIA_VERSION = 535.247.01 +NVIDIA_VERSION = 535.261.03 # This file. VERSION_MK_FILE := $(lastword $(MAKEFILE_LIST))