Skip to content

Commit 7a6a5a1

Browse files
committed
550.135
1 parent 7d3cbfe commit 7a6a5a1

File tree

42 files changed

+331
-215
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

+331
-215
lines changed

README.md

Lines changed: 3 additions & 3 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 550.127.08.
4+
version 550.135.
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-
550.127.08 driver release. This can be achieved by installing
20+
550.135 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

@@ -188,7 +188,7 @@ encountered specific to them.
188188
For details on feature support and limitations, see the NVIDIA GPU driver
189189
end user README here:
190190

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

193193
For vGPU support, please refer to the README.vgpu packaged in the vGPU Host
194194
Package for more details.

kernel-open/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
7272
EXTRA_CFLAGS += -I$(src)
7373
EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
7474
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
75-
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"550.127.08\"
75+
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"550.135\"
7676

7777
ifneq ($(SYSSRCHOST1X),)
7878
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
@@ -65,6 +81,16 @@ else
6581
)
6682
endif
6783

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

109-
LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
110-
$(KERNEL_SOURCES)/arch/$(ARCH)/kernel/module.lds \
135+
LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
136+
$(KERNEL_SOURCES)/arch/$(KERNEL_ARCH)/kernel/module.lds \
137+
$(KERNEL_OUTPUT)/arch/$(KERNEL_ARCH)/module.lds \
111138
$(KERNEL_OUTPUT)/scripts/module.lds
112139
NV_MODULE_COMMON_SCRIPTS := $(foreach s, $(wildcard $(LD_SCRIPT)), -T $(s))
113140

kernel-open/conftest.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,6 +2523,22 @@ compile_test() {
25232523
fi
25242524
;;
25252525

2526+
file_operations_fop_unsigned_offset_present)
2527+
#
2528+
# Determine if the FOP_UNSIGNED_OFFSET define is present.
2529+
#
2530+
# Added by commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
2531+
# fop_flags") in v6.12.
2532+
#
2533+
CODE="
2534+
#include <linux/fs.h>
2535+
int conftest_file_operations_fop_unsigned_offset_present(void) {
2536+
return FOP_UNSIGNED_OFFSET;
2537+
}"
2538+
2539+
compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT" "" "types"
2540+
;;
2541+
25262542
mm_context_t)
25272543
#
25282544
# Determine if the 'mm_context_t' data type is present
@@ -6896,6 +6912,22 @@ compile_test() {
68966912
compile_check_conftest "$CODE" "NV_DRM_UNLOCKED_IOCTL_FLAG_PRESENT" "" "types"
68976913
;;
68986914

6915+
folio_test_swapcache)
6916+
#
6917+
# Determine if the folio_test_swapcache() function is present.
6918+
#
6919+
# folio_test_swapcache() was exported by commit d389a4a811551 ("mm:
6920+
# Add folio flag manipulation functions") in v5.16.
6921+
#
6922+
CODE="
6923+
#include <linux/page-flags.h>
6924+
void conftest_folio_test_swapcache(void) {
6925+
folio_test_swapcache();
6926+
}"
6927+
6928+
compile_check_conftest "$CODE" "NV_FOLIO_TEST_SWAPCACHE_PRESENT" "" "functions"
6929+
;;
6930+
68996931
# When adding a new conftest entry, please use the correct format for
69006932
# specifying the relevant upstream Linux kernel commit. Please
69016933
# avoid specifying -rc kernels, and only use SHAs that actually exist

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

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

15551555
.llseek = noop_llseek,
1556+
1557+
#if defined(NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT)
1558+
.fop_flags = FOP_UNSIGNED_OFFSET,
1559+
#endif
15561560
};
15571561

15581562
static const struct drm_ioctl_desc nv_drm_ioctls[] = {

kernel-open/nvidia-drm/nvidia-drm-sources.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_aperture_remove_conflicting_pci_framebuffe
131131
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_mode_create_dp_colorspace_property_has_supported_colorspaces_arg
132132
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_unlocked_ioctl_flag_present
133133
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_output_poll_changed
134+
NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations_fop_unsigned_offset_present

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ NVIDIA_UVM_SOURCES += nvidia-uvm/uvm_maxwell_sec2.c
88
NVIDIA_UVM_SOURCES += nvidia-uvm/uvm_hopper_sec2.c
99
NVIDIA_UVM_SOURCES += nvidia-uvm/uvm_common.c
1010
NVIDIA_UVM_SOURCES += nvidia-uvm/uvm_linux.c
11-
NVIDIA_UVM_SOURCES += nvidia-uvm/uvm_debug_optimized.c
1211
NVIDIA_UVM_SOURCES += nvidia-uvm/nvstatus.c
1312
NVIDIA_UVM_SOURCES += nvidia-uvm/nvCpuUuid.c
1413
NVIDIA_UVM_SOURCES += nvidia-uvm/nv-kthread-q.c

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

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@ NVIDIA_UVM_OBJECTS =
1313
include $(src)/nvidia-uvm/nvidia-uvm-sources.Kbuild
1414
NVIDIA_UVM_OBJECTS += $(patsubst %.c,%.o,$(NVIDIA_UVM_SOURCES))
1515

16-
# Some linux kernel functions rely on being built with optimizations on and
17-
# to work around this we put wrappers for them in a separate file that's built
18-
# with optimizations on in debug builds and skipped in other builds.
19-
# Notably gcc 4.4 supports per function optimization attributes that would be
20-
# easier to use, but is too recent to rely on for now.
21-
NVIDIA_UVM_DEBUG_OPTIMIZED_SOURCE := nvidia-uvm/uvm_debug_optimized.c
22-
NVIDIA_UVM_DEBUG_OPTIMIZED_OBJECT := $(patsubst %.c,%.o,$(NVIDIA_UVM_DEBUG_OPTIMIZED_SOURCE))
23-
24-
ifneq ($(UVM_BUILD_TYPE),debug)
25-
# Only build the wrappers on debug builds
26-
NVIDIA_UVM_OBJECTS := $(filter-out $(NVIDIA_UVM_DEBUG_OPTIMIZED_OBJECT), $(NVIDIA_UVM_OBJECTS))
27-
endif
28-
2916
obj-m += nvidia-uvm.o
3017
nvidia-uvm-y := $(NVIDIA_UVM_OBJECTS)
3118

@@ -36,15 +23,14 @@ NVIDIA_UVM_KO = nvidia-uvm/nvidia-uvm.ko
3623
#
3724

3825
ifeq ($(UVM_BUILD_TYPE),debug)
39-
NVIDIA_UVM_CFLAGS += -DDEBUG -O1 -g
40-
else
41-
ifeq ($(UVM_BUILD_TYPE),develop)
42-
# -DDEBUG is required, in order to allow pr_devel() print statements to
43-
# work:
44-
NVIDIA_UVM_CFLAGS += -DDEBUG
45-
NVIDIA_UVM_CFLAGS += -DNVIDIA_UVM_DEVELOP
46-
endif
47-
NVIDIA_UVM_CFLAGS += -O2
26+
NVIDIA_UVM_CFLAGS += -DDEBUG -g
27+
endif
28+
29+
ifeq ($(UVM_BUILD_TYPE),develop)
30+
# -DDEBUG is required, in order to allow pr_devel() print statements to
31+
# work:
32+
NVIDIA_UVM_CFLAGS += -DDEBUG
33+
NVIDIA_UVM_CFLAGS += -DNVIDIA_UVM_DEVELOP
4834
endif
4935

5036
NVIDIA_UVM_CFLAGS += -DNVIDIA_UVM_ENABLED
@@ -56,11 +42,6 @@ NVIDIA_UVM_CFLAGS += -I$(src)/nvidia-uvm
5642

5743
$(call ASSIGN_PER_OBJ_CFLAGS, $(NVIDIA_UVM_OBJECTS), $(NVIDIA_UVM_CFLAGS))
5844

59-
ifeq ($(UVM_BUILD_TYPE),debug)
60-
# Force optimizations on for the wrappers
61-
$(call ASSIGN_PER_OBJ_CFLAGS, $(NVIDIA_UVM_DEBUG_OPTIMIZED_OBJECT), $(NVIDIA_UVM_CFLAGS) -O2)
62-
endif
63-
6445
#
6546
# Register the conftests needed by nvidia-uvm.ko
6647
#
@@ -88,6 +69,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_sva_bind_device_has_drvdata_arg
8869
NV_CONFTEST_FUNCTION_COMPILE_TESTS += vm_fault_to_errno
8970
NV_CONFTEST_FUNCTION_COMPILE_TESTS += find_next_bit_wrap
9071
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_is_dma_domain
72+
NV_CONFTEST_FUNCTION_COMPILE_TESTS += folio_test_swapcache
9173

9274
NV_CONFTEST_TYPE_COMPILE_TESTS += backing_dev_info
9375
NV_CONFTEST_TYPE_COMPILE_TESTS += mm_context_t

kernel-open/nvidia-uvm/uvm.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ static NV_STATUS uvm_api_mm_initialize(UVM_MM_INITIALIZE_PARAMS *params, struct
127127
goto err;
128128
}
129129

130-
old_fd_type = nv_atomic_long_cmpxchg((atomic_long_t *)&filp->private_data,
131-
UVM_FD_UNINITIALIZED,
132-
UVM_FD_INITIALIZING);
130+
old_fd_type = atomic_long_cmpxchg((atomic_long_t *)&filp->private_data,
131+
UVM_FD_UNINITIALIZED,
132+
UVM_FD_INITIALIZING);
133133
old_fd_type &= UVM_FD_TYPE_MASK;
134134
if (old_fd_type != UVM_FD_UNINITIALIZED) {
135135
status = NV_ERR_IN_USE;
@@ -914,8 +914,9 @@ static NV_STATUS uvm_api_initialize(UVM_INITIALIZE_PARAMS *params, struct file *
914914
// attempt to be made. This is safe because other threads will have only had
915915
// a chance to observe UVM_FD_INITIALIZING and not UVM_FD_VA_SPACE in this
916916
// case.
917-
old_fd_type = nv_atomic_long_cmpxchg((atomic_long_t *)&filp->private_data,
918-
UVM_FD_UNINITIALIZED, UVM_FD_INITIALIZING);
917+
old_fd_type = atomic_long_cmpxchg((atomic_long_t *)&filp->private_data,
918+
UVM_FD_UNINITIALIZED,
919+
UVM_FD_INITIALIZING);
919920
old_fd_type &= UVM_FD_TYPE_MASK;
920921
if (old_fd_type == UVM_FD_UNINITIALIZED) {
921922
status = uvm_va_space_create(filp->f_mapping, &va_space, params->flags);

kernel-open/nvidia-uvm/uvm_api.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
{ \
4848
params_type params; \
4949
BUILD_BUG_ON(sizeof(params) > UVM_MAX_IOCTL_PARAM_STACK_SIZE); \
50-
if (nv_copy_from_user(&params, (void __user*)arg, sizeof(params))) \
50+
if (copy_from_user(&params, (void __user*)arg, sizeof(params))) \
5151
return -EFAULT; \
5252
\
5353
params.rmStatus = uvm_global_get_status(); \
@@ -60,7 +60,7 @@
6060
params.rmStatus = function_name(&params, filp); \
6161
} \
6262
\
63-
if (nv_copy_to_user((void __user*)arg, &params, sizeof(params))) \
63+
if (copy_to_user((void __user*)arg, &params, sizeof(params))) \
6464
return -EFAULT; \
6565
\
6666
return 0; \
@@ -84,7 +84,7 @@
8484
if (!params) \
8585
return -ENOMEM; \
8686
BUILD_BUG_ON(sizeof(*params) <= UVM_MAX_IOCTL_PARAM_STACK_SIZE); \
87-
if (nv_copy_from_user(params, (void __user*)arg, sizeof(*params))) { \
87+
if (copy_from_user(params, (void __user*)arg, sizeof(*params))) { \
8888
uvm_kvfree(params); \
8989
return -EFAULT; \
9090
} \
@@ -99,7 +99,7 @@
9999
params->rmStatus = function_name(params, filp); \
100100
} \
101101
\
102-
if (nv_copy_to_user((void __user*)arg, params, sizeof(*params))) \
102+
if (copy_to_user((void __user*)arg, params, sizeof(*params))) \
103103
ret = -EFAULT; \
104104
\
105105
uvm_kvfree(params); \

kernel-open/nvidia-uvm/uvm_debug_optimized.c

Lines changed: 0 additions & 53 deletions
This file was deleted.

kernel-open/nvidia-uvm/uvm_global.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ void uvm_global_set_fatal_error_impl(NV_STATUS error)
412412

413413
UVM_ASSERT(error != NV_OK);
414414

415-
previous_error = nv_atomic_cmpxchg(&g_uvm_global.fatal_error, NV_OK, error);
415+
previous_error = atomic_cmpxchg(&g_uvm_global.fatal_error, NV_OK, error);
416416

417417
if (previous_error == NV_OK) {
418418
UVM_ERR_PRINT("Encountered a global fatal error: %s\n", nvstatusToString(error));
@@ -430,7 +430,7 @@ NV_STATUS uvm_global_reset_fatal_error(void)
430430
return NV_ERR_INVALID_STATE;
431431
}
432432

433-
return nv_atomic_xchg(&g_uvm_global.fatal_error, NV_OK);
433+
return atomic_xchg(&g_uvm_global.fatal_error, NV_OK);
434434
}
435435

436436
void uvm_global_gpu_retain(const uvm_processor_mask_t *mask)

0 commit comments

Comments
 (0)