Skip to content

Commit 855c3c9

Browse files
committed
535.230.02
1 parent 8845de1 commit 855c3c9

File tree

42 files changed

+473
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+473
-95
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.216.03.
4+
version 535.230.02.
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.216.03 driver release. This can be achieved by installing
20+
535.230.02 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.216.03 release,
183+
(see the table below). However, in the 535.230.02 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.216.03/README/kernel_open.html
191+
https://us.download.nvidia.com/XFree86/Linux-x86_64/535.230.02/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: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ ifeq ($(NV_UNDEF_BEHAVIOR_SANITIZER),1)
5757
UBSAN_SANITIZE := y
5858
endif
5959

60+
#
61+
# Command to create a symbolic link, explicitly resolving the symlink target
62+
# to an absolute path to abstract away the difference between Linux < 6.13,
63+
# where the CWD is the Linux kernel source tree for Kbuild extmod builds, and
64+
# Linux >= 6.13, where the CWD is the external module source tree.
65+
#
66+
# This is used to create the nv*-kernel.o -> nv*-kernel.o_binary symlinks for
67+
# kernel modules which use precompiled binary object files.
68+
#
69+
70+
quiet_cmd_symlink = SYMLINK $@
71+
cmd_symlink = ln -sf $(abspath $<) $@
72+
73+
6074
$(foreach _module, $(NV_KERNEL_MODULES), \
6175
$(eval include $(src)/$(_module)/$(_module).Kbuild))
6276

@@ -72,7 +86,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
7286
EXTRA_CFLAGS += -I$(src)
7387
EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
7488
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
75-
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"535.216.03\"
89+
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"535.230.02\"
7690

7791
ifneq ($(SYSSRCHOST1X),)
7892
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)

kernel-open/Makefile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ else
5252
endif
5353
endif
5454

55+
# If CC hasn't been set explicitly, check the value of CONFIG_CC_VERSION_TEXT.
56+
# Look for the compiler specified there, and use it by default, if found.
57+
ifeq ($(origin CC),default)
58+
cc_version_text=$(firstword $(shell . $(KERNEL_OUTPUT)/.config; \
59+
echo "$$CONFIG_CC_VERSION_TEXT"))
60+
61+
ifneq ($(cc_version_text),)
62+
ifeq ($(shell command -v $(cc_version_text)),)
63+
$(warning WARNING: Unable to locate the compiler $(cc_version_text) \
64+
from CONFIG_CC_VERSION_TEXT in the kernel configuration.)
65+
else
66+
CC=$(cc_version_text)
67+
endif
68+
endif
69+
endif
70+
5571
CC ?= cc
5672
LD ?= ld
5773
OBJDUMP ?= objdump
@@ -64,6 +80,16 @@ else
6480
)
6581
endif
6682

83+
KERNEL_ARCH = $(ARCH)
84+
85+
ifneq ($(filter $(ARCH),i386 x86_64),)
86+
KERNEL_ARCH = x86
87+
else
88+
ifeq ($(filter $(ARCH),arm64 powerpc),)
89+
$(error Unsupported architecture $(ARCH))
90+
endif
91+
endif
92+
6793
NV_KERNEL_MODULES ?= $(wildcard nvidia nvidia-uvm nvidia-vgpu-vfio nvidia-modeset nvidia-drm nvidia-peermem)
6894
NV_KERNEL_MODULES := $(filter-out $(NV_EXCLUDE_KERNEL_MODULES), \
6995
$(NV_KERNEL_MODULES))
@@ -103,8 +129,9 @@ else
103129
# module symbols on which the Linux kernel's module resolution is dependent
104130
# and hence must be used whenever present.
105131

106-
LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
107-
$(KERNEL_SOURCES)/arch/$(ARCH)/kernel/module.lds \
132+
LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
133+
$(KERNEL_SOURCES)/arch/$(KERNEL_ARCH)/kernel/module.lds \
134+
$(KERNEL_OUTPUT)/arch/$(KERNEL_ARCH)/module.lds \
108135
$(KERNEL_OUTPUT)/scripts/module.lds
109136
NV_MODULE_COMMON_SCRIPTS := $(foreach s, $(wildcard $(LD_SCRIPT)), -T $(s))
110137

kernel-open/conftest.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,22 @@ compile_test() {
24752475
fi
24762476
;;
24772477

2478+
file_operations_fop_unsigned_offset_present)
2479+
#
2480+
# Determine if the FOP_UNSIGNED_OFFSET define is present.
2481+
#
2482+
# Added by commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
2483+
# fop_flags") in v6.12.
2484+
#
2485+
CODE="
2486+
#include <linux/fs.h>
2487+
int conftest_file_operations_fop_unsigned_offset_present(void) {
2488+
return FOP_UNSIGNED_OFFSET;
2489+
}"
2490+
2491+
compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT" "" "types"
2492+
;;
2493+
24782494
mm_context_t)
24792495
#
24802496
# Determine if the 'mm_context_t' data type is present
@@ -6514,6 +6530,22 @@ compile_test() {
65146530
compile_check_conftest "$CODE" "NV_DRM_UNLOCKED_IOCTL_FLAG_PRESENT" "" "types"
65156531
;;
65166532

6533+
folio_test_swapcache)
6534+
#
6535+
# Determine if the folio_test_swapcache() function is present.
6536+
#
6537+
# folio_test_swapcache() was exported by commit d389a4a811551 ("mm:
6538+
# Add folio flag manipulation functions") in v5.16.
6539+
#
6540+
CODE="
6541+
#include <linux/page-flags.h>
6542+
void conftest_folio_test_swapcache(void) {
6543+
folio_test_swapcache();
6544+
}"
6545+
6546+
compile_check_conftest "$CODE" "NV_FOLIO_TEST_SWAPCACHE_PRESENT" "" "functions"
6547+
;;
6548+
65176549
# When adding a new conftest entry, please use the correct format for
65186550
# specifying the relevant upstream Linux kernel commit.
65196551
#

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,10 @@ static const struct file_operations nv_drm_fops = {
12851285
.read = drm_read,
12861286

12871287
.llseek = noop_llseek,
1288+
1289+
#if defined(NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT)
1290+
.fop_flags = FOP_UNSIGNED_OFFSET,
1291+
#endif
12881292
};
12891293

12901294
static const struct drm_ioctl_desc nv_drm_ioctls[] = {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += vm_area_struct_has_const_vm_flags
135135
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_dumb_destroy
136136
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_unlocked_ioctl_flag_present
137137
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_output_poll_changed
138+
NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations_fop_unsigned_offset_present

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ NV_KERNEL_MODULE_TARGETS += $(NVIDIA_MODESET_KO)
4040
NVIDIA_MODESET_BINARY_OBJECT := $(src)/nvidia-modeset/nv-modeset-kernel.o_binary
4141
NVIDIA_MODESET_BINARY_OBJECT_O := nvidia-modeset/nv-modeset-kernel.o
4242

43-
quiet_cmd_symlink = SYMLINK $@
44-
cmd_symlink = ln -sf $< $@
45-
4643
targets += $(NVIDIA_MODESET_BINARY_OBJECT_O)
4744

4845
$(obj)/$(NVIDIA_MODESET_BINARY_OBJECT_O): $(NVIDIA_MODESET_BINARY_OBJECT) FORCE

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += mmget_not_zero
8686
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
89+
NV_CONFTEST_FUNCTION_COMPILE_TESTS += folio_test_swapcache
8990

9091
NV_CONFTEST_TYPE_COMPILE_TESTS += backing_dev_info
9192
NV_CONFTEST_TYPE_COMPILE_TESTS += mm_context_t

kernel-open/nvidia-uvm/uvm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ static void uvm_vm_open_semaphore_pool(struct vm_area_struct *vma)
682682
// Semaphore pool vmas do not have vma wrappers, but some functions will
683683
// assume vm_private_data is a wrapper.
684684
vma->vm_private_data = NULL;
685+
#if defined(VM_WIPEONFORK)
686+
nv_vm_flags_set(vma, VM_WIPEONFORK);
687+
#endif
685688

686689
if (is_fork) {
687690
// If we forked, leave the parent vma alone.

kernel-open/nvidia-uvm/uvm_hmm.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@ module_param(uvm_disable_hmm, bool, 0444);
7171
#include "uvm_va_policy.h"
7272
#include "uvm_tools.h"
7373

74+
// The function nv_PageSwapCache() wraps the check for page swap cache flag in
75+
// order to support a wide variety of kernel versions.
76+
// The function PageSwapCache() is removed after 32f51ead3d77 ("mm: remove
77+
// PageSwapCache") in v6.12-rc1.
78+
// The function folio_test_swapcache() was added in Linux 5.16 (d389a4a811551
79+
// "mm: Add folio flag manipulation functions")
80+
// Systems with HMM patches backported to 5.14 are possible, but those systems
81+
// do not include folio_test_swapcache()
82+
// TODO: Bug 4050579: Remove this when migration of swap cached pages is updated
83+
static __always_inline bool nv_PageSwapCache(struct page *page)
84+
{
85+
#if defined(NV_FOLIO_TEST_SWAPCACHE_PRESENT)
86+
return folio_test_swapcache(page_folio(page));
87+
#else
88+
return PageSwapCache(page);
89+
#endif
90+
}
91+
7492
static NV_STATUS gpu_chunk_add(uvm_va_block_t *va_block,
7593
uvm_page_index_t page_index,
7694
struct page *page);
@@ -2554,7 +2572,7 @@ static NV_STATUS dmamap_src_sysmem_pages(uvm_va_block_t *va_block,
25542572
continue;
25552573
}
25562574

2557-
if (PageSwapCache(src_page)) {
2575+
if (nv_PageSwapCache(src_page)) {
25582576
// TODO: Bug 4050579: Remove this when swap cached pages can be
25592577
// migrated.
25602578
if (service_context) {

0 commit comments

Comments
 (0)