Skip to content

Commit 9c67f19

Browse files
committed
535.261.03
1 parent f468568 commit 9c67f19

37 files changed

+425
-177
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NVIDIA Linux Open GPU Kernel Module Source
22

33
This is the source release of the NVIDIA Linux open GPU kernel modules,
4-
version 535.247.01.
4+
version 535.261.03.
55

66

77
## How to Build
@@ -17,7 +17,7 @@ as root:
1717

1818
Note that the kernel modules built here must be used with GSP
1919
firmware and user-space NVIDIA GPU driver components from a corresponding
20-
535.247.01 driver release. This can be achieved by installing
20+
535.261.03 driver release. This can be achieved by installing
2121
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
2222
option. E.g.,
2323

@@ -180,15 +180,15 @@ software applications.
180180
## Compatible GPUs
181181

182182
The open-gpu-kernel-modules can be used on any Turing or later GPU
183-
(see the table below). However, in the 535.247.01 release,
183+
(see the table below). However, in the 535.261.03 release,
184184
GeForce and Workstation support is still considered alpha-quality.
185185

186186
To enable use of the open kernel modules on GeForce and Workstation GPUs,
187187
set the "NVreg_OpenRmEnableUnsupportedGpus" nvidia.ko kernel module
188188
parameter to 1. For more details, see the NVIDIA GPU driver end user
189189
README here:
190190

191-
https://us.download.nvidia.com/XFree86/Linux-x86_64/535.247.01/README/kernel_open.html
191+
https://us.download.nvidia.com/XFree86/Linux-x86_64/535.261.03/README/kernel_open.html
192192

193193
In the below table, if three IDs are listed, the first is the PCI Device
194194
ID, the second is the PCI Subsystem Vendor ID, and the third is the PCI

kernel-open/Kbuild

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -75,70 +75,63 @@ $(foreach _module, $(NV_KERNEL_MODULES), \
7575
$(eval include $(src)/$(_module)/$(_module).Kbuild))
7676

7777

78-
#
79-
# Define CFLAGS that apply to all the NVIDIA kernel modules. EXTRA_CFLAGS
80-
# is deprecated since 2.6.24 in favor of ccflags-y, but we need to support
81-
# older kernels which do not have ccflags-y. Newer kernels append
82-
# $(EXTRA_CFLAGS) to ccflags-y for compatibility.
83-
#
84-
85-
EXTRA_CFLAGS += -I$(src)/common/inc
86-
EXTRA_CFLAGS += -I$(src)
87-
EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
88-
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
89-
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"535.247.01\"
78+
ccflags-y += -I$(src)/common/inc
79+
ccflags-y += -I$(src)
80+
ccflags-y += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
81+
ccflags-y += -D__KERNEL__ -DMODULE -DNVRM
82+
ccflags-y += -DNV_VERSION_STRING=\"535.261.03\"
9083

9184
ifneq ($(SYSSRCHOST1X),)
92-
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
85+
ccflags-y += -I$(SYSSRCHOST1X)
9386
endif
9487

95-
EXTRA_CFLAGS += -Wno-unused-function
88+
ccflags-y += -Wno-unused-function
9689

9790
ifneq ($(NV_BUILD_TYPE),debug)
98-
EXTRA_CFLAGS += -Wuninitialized
91+
ccflags-y += -Wuninitialized
9992
endif
10093

101-
EXTRA_CFLAGS += -fno-strict-aliasing
94+
ccflags-y += -fno-strict-aliasing
10295

10396
ifeq ($(ARCH),arm64)
104-
EXTRA_CFLAGS += -mstrict-align
97+
ccflags-y += -mstrict-align
10598
endif
10699

107100
ifeq ($(NV_BUILD_TYPE),debug)
108-
EXTRA_CFLAGS += -g
109-
EXTRA_CFLAGS += $(call cc-option,-gsplit-dwarf,)
101+
ccflags-y += -g
102+
ccflags-y += $(call cc-option,-gsplit-dwarf,)
110103
endif
111104

112-
EXTRA_CFLAGS += -ffreestanding
105+
ccflags-y += -ffreestanding
113106

114107
ifeq ($(ARCH),arm64)
115-
EXTRA_CFLAGS += -mgeneral-regs-only -march=armv8-a
116-
EXTRA_CFLAGS += $(call cc-option,-mno-outline-atomics,)
108+
ccflags-y += -mgeneral-regs-only -march=armv8-a
109+
ccflags-y += $(call cc-option,-mno-outline-atomics,)
117110
endif
118111

119112
ifeq ($(ARCH),x86_64)
120-
EXTRA_CFLAGS += -mno-red-zone -mcmodel=kernel
113+
ccflags-y += -mno-red-zone -mcmodel=kernel
121114
endif
122115

123116
ifeq ($(ARCH),powerpc)
124-
EXTRA_CFLAGS += -mlittle-endian -mno-strict-align -mno-altivec
117+
ccflags-y += -mlittle-endian -mno-strict-align -mno-altivec
125118
endif
126119

127-
EXTRA_CFLAGS += -DNV_UVM_ENABLE
128-
EXTRA_CFLAGS += $(call cc-option,-Werror=undef,)
129-
EXTRA_CFLAGS += -DNV_SPECTRE_V2=$(NV_SPECTRE_V2)
130-
EXTRA_CFLAGS += -DNV_KERNEL_INTERFACE_LAYER
120+
ccflags-y += -DNV_UVM_ENABLE
121+
ccflags-y += $(call cc-option,-Werror=undef,)
122+
ccflags-y += -DNV_SPECTRE_V2=$(NV_SPECTRE_V2)
123+
ccflags-y += -DNV_KERNEL_INTERFACE_LAYER
131124

132125
#
133126
# Detect SGI UV systems and apply system-specific optimizations.
134127
#
135128

136129
ifneq ($(wildcard /proc/sgi_uv),)
137-
EXTRA_CFLAGS += -DNV_CONFIG_X86_UV
130+
ccflags-y += -DNV_CONFIG_X86_UV
138131
endif
139132

140133
ifdef VGX_FORCE_VFIO_PCI_CORE
141-
EXTRA_CFLAGS += -DNV_VGPU_FORCE_VFIO_PCI_CORE
134+
ccflags-y += -DNV_VGPU_FORCE_VFIO_PCI_CORE
142135
endif
143136

144137
#
@@ -165,9 +158,11 @@ NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST_SCRIPT) \
165158

166159
NV_CFLAGS_FROM_CONFTEST := $(shell $(NV_CONFTEST_CMD) build_cflags)
167160

168-
NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(EXTRA_CFLAGS) -fno-pie
161+
NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(ccflags-y) -fno-pie
162+
NV_CONFTEST_CFLAGS += $(filter -std=%,$(KBUILD_CFLAGS))
169163
NV_CONFTEST_CFLAGS += $(call cc-disable-warning,pointer-sign)
170164
NV_CONFTEST_CFLAGS += $(call cc-option,-fshort-wchar,)
165+
NV_CONFTEST_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types,)
171166

172167
NV_CONFTEST_COMPILE_TEST_HEADERS := $(obj)/conftest/macros.h
173168
NV_CONFTEST_COMPILE_TEST_HEADERS += $(obj)/conftest/functions.h

kernel-open/common/inc/nv-mm.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 2016-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: MIT
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -292,9 +292,21 @@ static inline struct rw_semaphore *nv_mmap_get_lock(struct mm_struct *mm)
292292
#endif
293293
}
294294

295+
#define NV_CAN_CALL_VMA_START_WRITE 1
296+
297+
#if !NV_CAN_CALL_VMA_START_WRITE
298+
/*
299+
* Commit 45ad9f5290dc updated vma_start_write() to call __vma_start_write().
300+
*/
301+
void nv_vma_start_write(struct vm_area_struct *);
302+
#endif
303+
295304
static inline void nv_vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)
296305
{
297-
#if defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)
306+
#if !NV_CAN_CALL_VMA_START_WRITE
307+
nv_vma_start_write(vma);
308+
ACCESS_PRIVATE(vma, __vm_flags) |= flags;
309+
#elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)
298310
vm_flags_set(vma, flags);
299311
#else
300312
vma->vm_flags |= flags;
@@ -303,7 +315,10 @@ static inline void nv_vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)
303315

304316
static inline void nv_vm_flags_clear(struct vm_area_struct *vma, vm_flags_t flags)
305317
{
306-
#if defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)
318+
#if !NV_CAN_CALL_VMA_START_WRITE
319+
nv_vma_start_write(vma);
320+
ACCESS_PRIVATE(vma, __vm_flags) &= ~flags;
321+
#elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)
307322
vm_flags_clear(vma, flags);
308323
#else
309324
vma->vm_flags &= ~flags;

kernel-open/common/inc/nv-timer.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2017 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 2017-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: MIT
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -63,4 +63,13 @@ static inline void nv_timer_setup(struct nv_timer *nv_timer,
6363
#endif
6464
}
6565

66+
static inline void nv_timer_delete_sync(struct timer_list *timer)
67+
{
68+
#if !defined(NV_BSD) && NV_IS_EXPORT_SYMBOL_PRESENT_timer_delete_sync
69+
timer_delete_sync(timer);
70+
#else
71+
del_timer_sync(timer);
72+
#endif
73+
}
74+
6675
#endif // __NV_TIMER_H__

kernel-open/conftest.sh

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4013,33 +4013,6 @@ compile_test() {
40134013
fi
40144014
;;
40154015

4016-
dma_buf_has_dynamic_attachment)
4017-
#
4018-
# Determine if the function dma_buf_attachment_is_dynamic()
4019-
# is present.
4020-
#
4021-
# Added by commit: 15fd552d186c
4022-
# ("dma-buf: change DMA-buf locking convention v3") in v5.5 (2018-07-03)
4023-
#
4024-
echo "$CONFTEST_PREAMBLE
4025-
#include <linux/dma-buf.h>
4026-
bool conftest_dma_buf_attachment_is_dynamic(void) {
4027-
return dma_buf_attachment_is_dynamic(NULL);
4028-
}" > conftest$$.c
4029-
4030-
$CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
4031-
rm -f conftest$$.c
4032-
4033-
if [ -f conftest$$.o ]; then
4034-
echo "#define NV_DMA_BUF_HAS_DYNAMIC_ATTACHMENT" | append_conftest "functions"
4035-
rm -f conftest$$.o
4036-
return
4037-
else
4038-
echo "#undef NV_DMA_BUF_HAS_DYNAMIC_ATTACHMENT" | append_conftest "functions"
4039-
return
4040-
fi
4041-
;;
4042-
40434016
dma_buf_attachment_has_peer2peer)
40444017
#
40454018
# Determine if peer2peer is present in struct dma_buf_attachment.
@@ -6687,6 +6660,22 @@ compile_test() {
66876660
compile_check_conftest "$CODE" "NV_DRM_UNLOCKED_IOCTL_FLAG_PRESENT" "" "types"
66886661
;;
66896662

6663+
page_pgmap)
6664+
#
6665+
# Determine if the page_pgmap() function is present.
6666+
#
6667+
# Added by commit 82ba975e4c43 ("mm: allow compound zone device
6668+
# pages") in v6.14
6669+
#
6670+
CODE="
6671+
#include <linux/mmzone.h>
6672+
int conftest_page_pgmap(void) {
6673+
return page_pgmap();
6674+
}"
6675+
6676+
compile_check_conftest "$CODE" "NV_PAGE_PGMAP_PRESENT" "" "functions"
6677+
;;
6678+
66906679
folio_test_swapcache)
66916680
#
66926681
# Determine if the folio_test_swapcache() function is present.
@@ -6744,6 +6733,33 @@ compile_test() {
67446733
compile_check_conftest "$CODE" "NV_DRM_DRIVER_HAS_DATE" "" "types"
67456734
;;
67466735

6736+
drm_connector_helper_funcs_mode_valid_has_const_mode_arg)
6737+
#
6738+
# Determine if the 'mode' pointer argument is const in
6739+
# drm_connector_helper_funcs::mode_valid.
6740+
#
6741+
# The 'mode' pointer argument in
6742+
# drm_connector_helper_funcs::mode_valid was made const by commit
6743+
# 26d6fd81916e ("drm/connector: make mode_valid take a const struct
6744+
# drm_display_mode") in linux-next, expected in v6.15.
6745+
#
6746+
CODE="
6747+
#if defined(NV_DRM_DRM_ATOMIC_HELPER_H_PRESENT)
6748+
#include <drm/drm_atomic_helper.h>
6749+
#endif
6750+
6751+
static int conftest_drm_connector_mode_valid(struct drm_connector *connector,
6752+
const struct drm_display_mode *mode) {
6753+
return 0;
6754+
}
6755+
6756+
const struct drm_connector_helper_funcs conftest_drm_connector_helper_funcs = {
6757+
.mode_valid = conftest_drm_connector_mode_valid,
6758+
};"
6759+
6760+
compile_check_conftest "$CODE" "NV_DRM_CONNECTOR_HELPER_FUNCS_MODE_VALID_HAS_CONST_MODE_ARG" "" "types"
6761+
;;
6762+
67476763
# When adding a new conftest entry, please use the correct format for
67486764
# specifying the relevant upstream Linux kernel commit.
67496765
#

kernel-open/nvidia-drm/nvidia-drm-connector.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,11 @@ static int nv_drm_connector_get_modes(struct drm_connector *connector)
314314
}
315315

316316
static int nv_drm_connector_mode_valid(struct drm_connector *connector,
317+
#if defined(NV_DRM_CONNECTOR_HELPER_FUNCS_MODE_VALID_HAS_CONST_MODE_ARG)
318+
const struct drm_display_mode *mode)
319+
#else
317320
struct drm_display_mode *mode)
321+
#endif
318322
{
319323
struct drm_device *dev = connector->dev;
320324
struct nv_drm_device *nv_dev = to_nv_device(dev);

kernel-open/nvidia-drm/nvidia-drm.Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_gpl_refcount_dec_and_test
5656
NV_CONFTEST_GENERIC_COMPILE_TESTS += drm_alpha_blending_available
5757
NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_fd_to_handle
5858
NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_handle_to_fd
59+
NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_gpl___vma_start_write
5960

6061
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_dev_unref
6162
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_reinit_primary_mode_group
@@ -137,3 +138,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_unlocked_ioctl_flag_present
137138
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_output_poll_changed
138139
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_date
139140
NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations_fop_unsigned_offset_present
141+
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_connector_helper_funcs_mode_valid_has_const_mode_arg

kernel-open/nvidia-modeset/nvidia-modeset-linux.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2015-21 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 2015-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: MIT
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -652,7 +652,11 @@ static void nvkms_kthread_q_callback(void *arg)
652652
* pending timers and than waiting for workqueue callbacks.
653653
*/
654654
if (timer->kernel_timer_created) {
655+
#if !defined(NV_BSD) && NV_IS_EXPORT_SYMBOL_PRESENT_timer_delete_sync
656+
timer_delete_sync(&timer->kernel_timer);
657+
#else
655658
del_timer_sync(&timer->kernel_timer);
659+
#endif
656660
}
657661

658662
/*
@@ -1743,7 +1747,11 @@ static void __exit nvkms_exit(void)
17431747
* completion, and we wait for queue completion with
17441748
* nv_kthread_q_stop below.
17451749
*/
1750+
#if !defined(NV_BSD) && NV_IS_EXPORT_SYMBOL_PRESENT_timer_delete_sync
1751+
if (timer_delete_sync(&timer->kernel_timer) == 1) {
1752+
#else
17461753
if (del_timer_sync(&timer->kernel_timer) == 1) {
1754+
#endif
17471755
/* We've deactivated timer so we need to clean after it */
17481756
list_del(&timer->timers_list);
17491757

kernel-open/nvidia-modeset/nvidia-modeset.Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += ktime_get_real_ts64
9191
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ktime_get_raw_ts64
9292
NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_video_backlight_use_native
9393
NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_video_register_backlight
94+
NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_timer_delete_sync

kernel-open/nvidia-uvm/nvidia-uvm.Kbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += mmgrab
8787
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_sva_bind_device_has_drvdata_arg
8888
NV_CONFTEST_FUNCTION_COMPILE_TESTS += vm_fault_to_errno
8989
NV_CONFTEST_FUNCTION_COMPILE_TESTS += folio_test_swapcache
90+
NV_CONFTEST_FUNCTION_COMPILE_TESTS += page_pgmap
9091

9192
NV_CONFTEST_TYPE_COMPILE_TESTS += backing_dev_info
9293
NV_CONFTEST_TYPE_COMPILE_TESTS += mm_context_t
@@ -116,3 +117,5 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += mmu_interval_notifier
116117

117118
NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_int_active_memcg
118119
NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_migrate_vma_setup
120+
NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present___iowrite64_lo_hi
121+
NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_make_device_exclusive

0 commit comments

Comments
 (0)