Skip to content

Commit

Permalink
535.230.02
Browse files Browse the repository at this point in the history
  • Loading branch information
niv committed Jan 16, 2025
1 parent 8845de1 commit 855c3c9
Show file tree
Hide file tree
Showing 42 changed files with 473 additions and 95 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.216.03.
version 535.230.02.


## How to Build
Expand All @@ -17,7 +17,7 @@ as root:

Note that the kernel modules built here must be used with GSP
firmware and user-space NVIDIA GPU driver components from a corresponding
535.216.03 driver release. This can be achieved by installing
535.230.02 driver release. This can be achieved by installing
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
option. E.g.,

Expand Down Expand Up @@ -180,15 +180,15 @@ software applications.
## Compatible GPUs

The open-gpu-kernel-modules can be used on any Turing or later GPU
(see the table below). However, in the 535.216.03 release,
(see the table below). However, in the 535.230.02 release,
GeForce and Workstation support is still considered alpha-quality.

To enable use of the open kernel modules on GeForce and Workstation GPUs,
set the "NVreg_OpenRmEnableUnsupportedGpus" nvidia.ko kernel module
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.216.03/README/kernel_open.html
https://us.download.nvidia.com/XFree86/Linux-x86_64/535.230.02/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
Expand Down
16 changes: 15 additions & 1 deletion kernel-open/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ ifeq ($(NV_UNDEF_BEHAVIOR_SANITIZER),1)
UBSAN_SANITIZE := y
endif

#
# Command to create a symbolic link, explicitly resolving the symlink target
# to an absolute path to abstract away the difference between Linux < 6.13,
# where the CWD is the Linux kernel source tree for Kbuild extmod builds, and
# Linux >= 6.13, where the CWD is the external module source tree.
#
# This is used to create the nv*-kernel.o -> nv*-kernel.o_binary symlinks for
# kernel modules which use precompiled binary object files.
#

quiet_cmd_symlink = SYMLINK $@
cmd_symlink = ln -sf $(abspath $<) $@


$(foreach _module, $(NV_KERNEL_MODULES), \
$(eval include $(src)/$(_module)/$(_module).Kbuild))

Expand All @@ -72,7 +86,7 @@ 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.216.03\"
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"535.230.02\"

ifneq ($(SYSSRCHOST1X),)
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
Expand Down
31 changes: 29 additions & 2 deletions kernel-open/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ else
endif
endif

# If CC hasn't been set explicitly, check the value of CONFIG_CC_VERSION_TEXT.
# Look for the compiler specified there, and use it by default, if found.
ifeq ($(origin CC),default)
cc_version_text=$(firstword $(shell . $(KERNEL_OUTPUT)/.config; \
echo "$$CONFIG_CC_VERSION_TEXT"))

ifneq ($(cc_version_text),)
ifeq ($(shell command -v $(cc_version_text)),)
$(warning WARNING: Unable to locate the compiler $(cc_version_text) \
from CONFIG_CC_VERSION_TEXT in the kernel configuration.)
else
CC=$(cc_version_text)
endif
endif
endif

CC ?= cc
LD ?= ld
OBJDUMP ?= objdump
Expand All @@ -64,6 +80,16 @@ else
)
endif

KERNEL_ARCH = $(ARCH)

ifneq ($(filter $(ARCH),i386 x86_64),)
KERNEL_ARCH = x86
else
ifeq ($(filter $(ARCH),arm64 powerpc),)
$(error Unsupported architecture $(ARCH))
endif
endif

NV_KERNEL_MODULES ?= $(wildcard nvidia nvidia-uvm nvidia-vgpu-vfio nvidia-modeset nvidia-drm nvidia-peermem)
NV_KERNEL_MODULES := $(filter-out $(NV_EXCLUDE_KERNEL_MODULES), \
$(NV_KERNEL_MODULES))
Expand Down Expand Up @@ -103,8 +129,9 @@ else
# module symbols on which the Linux kernel's module resolution is dependent
# and hence must be used whenever present.

LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
$(KERNEL_SOURCES)/arch/$(ARCH)/kernel/module.lds \
LD_SCRIPT ?= $(KERNEL_SOURCES)/scripts/module-common.lds \
$(KERNEL_SOURCES)/arch/$(KERNEL_ARCH)/kernel/module.lds \
$(KERNEL_OUTPUT)/arch/$(KERNEL_ARCH)/module.lds \
$(KERNEL_OUTPUT)/scripts/module.lds
NV_MODULE_COMMON_SCRIPTS := $(foreach s, $(wildcard $(LD_SCRIPT)), -T $(s))

Expand Down
32 changes: 32 additions & 0 deletions kernel-open/conftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,22 @@ compile_test() {
fi
;;

file_operations_fop_unsigned_offset_present)
#
# Determine if the FOP_UNSIGNED_OFFSET define is present.
#
# Added by commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
# fop_flags") in v6.12.
#
CODE="
#include <linux/fs.h>
int conftest_file_operations_fop_unsigned_offset_present(void) {
return FOP_UNSIGNED_OFFSET;
}"

compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT" "" "types"
;;

mm_context_t)
#
# Determine if the 'mm_context_t' data type is present
Expand Down Expand Up @@ -6514,6 +6530,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DRM_UNLOCKED_IOCTL_FLAG_PRESENT" "" "types"
;;

folio_test_swapcache)
#
# Determine if the folio_test_swapcache() function is present.
#
# folio_test_swapcache() was exported by commit d389a4a811551 ("mm:
# Add folio flag manipulation functions") in v5.16.
#
CODE="
#include <linux/page-flags.h>
void conftest_folio_test_swapcache(void) {
folio_test_swapcache();
}"

compile_check_conftest "$CODE" "NV_FOLIO_TEST_SWAPCACHE_PRESENT" "" "functions"
;;

# When adding a new conftest entry, please use the correct format for
# specifying the relevant upstream Linux kernel commit.
#
Expand Down
4 changes: 4 additions & 0 deletions kernel-open/nvidia-drm/nvidia-drm-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,10 @@ static const struct file_operations nv_drm_fops = {
.read = drm_read,

.llseek = noop_llseek,

#if defined(NV_FILE_OPERATIONS_FOP_UNSIGNED_OFFSET_PRESENT)
.fop_flags = FOP_UNSIGNED_OFFSET,
#endif
};

static const struct drm_ioctl_desc nv_drm_ioctls[] = {
Expand Down
1 change: 1 addition & 0 deletions kernel-open/nvidia-drm/nvidia-drm.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += vm_area_struct_has_const_vm_flags
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_dumb_destroy
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_unlocked_ioctl_flag_present
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_output_poll_changed
NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations_fop_unsigned_offset_present
3 changes: 0 additions & 3 deletions kernel-open/nvidia-modeset/nvidia-modeset.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ NV_KERNEL_MODULE_TARGETS += $(NVIDIA_MODESET_KO)
NVIDIA_MODESET_BINARY_OBJECT := $(src)/nvidia-modeset/nv-modeset-kernel.o_binary
NVIDIA_MODESET_BINARY_OBJECT_O := nvidia-modeset/nv-modeset-kernel.o

quiet_cmd_symlink = SYMLINK $@
cmd_symlink = ln -sf $< $@

targets += $(NVIDIA_MODESET_BINARY_OBJECT_O)

$(obj)/$(NVIDIA_MODESET_BINARY_OBJECT_O): $(NVIDIA_MODESET_BINARY_OBJECT) FORCE
Expand Down
1 change: 1 addition & 0 deletions kernel-open/nvidia-uvm/nvidia-uvm.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += mmget_not_zero
NV_CONFTEST_FUNCTION_COMPILE_TESTS += mmgrab
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_TYPE_COMPILE_TESTS += backing_dev_info
NV_CONFTEST_TYPE_COMPILE_TESTS += mm_context_t
Expand Down
3 changes: 3 additions & 0 deletions kernel-open/nvidia-uvm/uvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ static void uvm_vm_open_semaphore_pool(struct vm_area_struct *vma)
// Semaphore pool vmas do not have vma wrappers, but some functions will
// assume vm_private_data is a wrapper.
vma->vm_private_data = NULL;
#if defined(VM_WIPEONFORK)
nv_vm_flags_set(vma, VM_WIPEONFORK);
#endif

if (is_fork) {
// If we forked, leave the parent vma alone.
Expand Down
20 changes: 19 additions & 1 deletion kernel-open/nvidia-uvm/uvm_hmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ module_param(uvm_disable_hmm, bool, 0444);
#include "uvm_va_policy.h"
#include "uvm_tools.h"

// The function nv_PageSwapCache() wraps the check for page swap cache flag in
// order to support a wide variety of kernel versions.
// The function PageSwapCache() is removed after 32f51ead3d77 ("mm: remove
// PageSwapCache") in v6.12-rc1.
// The function folio_test_swapcache() was added in Linux 5.16 (d389a4a811551
// "mm: Add folio flag manipulation functions")
// Systems with HMM patches backported to 5.14 are possible, but those systems
// do not include folio_test_swapcache()
// TODO: Bug 4050579: Remove this when migration of swap cached pages is updated
static __always_inline bool nv_PageSwapCache(struct page *page)
{
#if defined(NV_FOLIO_TEST_SWAPCACHE_PRESENT)
return folio_test_swapcache(page_folio(page));
#else
return PageSwapCache(page);
#endif
}

static NV_STATUS gpu_chunk_add(uvm_va_block_t *va_block,
uvm_page_index_t page_index,
struct page *page);
Expand Down Expand Up @@ -2554,7 +2572,7 @@ static NV_STATUS dmamap_src_sysmem_pages(uvm_va_block_t *va_block,
continue;
}

if (PageSwapCache(src_page)) {
if (nv_PageSwapCache(src_page)) {
// TODO: Bug 4050579: Remove this when swap cached pages can be
// migrated.
if (service_context) {
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/nvidia-uvm/uvm_kvmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
typedef struct
{
size_t alloc_size;
uint8_t ptr[0];
uint8_t ptr[];
} uvm_vmalloc_hdr_t;

typedef struct
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/nvidia-uvm/uvm_mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct uvm_page_directory_struct
// pointers to child directories on the host.
// this array is variable length, so it needs to be last to allow it to
// take up extra space
uvm_page_directory_t *entries[0];
uvm_page_directory_t *entries[];
};

enum
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/nvidia-uvm/uvm_pmm_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ struct uvm_pmm_gpu_chunk_suballoc_struct
// Array of all child subchunks
// TODO: Bug 1765461: Can the array be inlined? It could save the parent
// pointer.
uvm_gpu_chunk_t *subchunks[0];
uvm_gpu_chunk_t *subchunks[];
};

typedef enum
Expand Down
3 changes: 0 additions & 3 deletions kernel-open/nvidia/nvidia.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ NVIDIA_KO = nvidia/nvidia.ko
NVIDIA_BINARY_OBJECT := $(src)/nvidia/nv-kernel.o_binary
NVIDIA_BINARY_OBJECT_O := nvidia/nv-kernel.o

quiet_cmd_symlink = SYMLINK $@
cmd_symlink = ln -sf $< $@

targets += $(NVIDIA_BINARY_OBJECT_O)

$(obj)/$(NVIDIA_BINARY_OBJECT_O): $(NVIDIA_BINARY_OBJECT) FORCE
Expand Down
20 changes: 10 additions & 10 deletions src/common/inc/nvBldVer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 r538_95
#define NV_BUILD_BRANCH r539_11
#endif
#ifndef NV_PUBLIC_BRANCH
#define NV_PUBLIC_BRANCH r538_95
#define NV_PUBLIC_BRANCH r539_11
#endif

#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r535/r538_95-688"
#define NV_BUILD_CHANGELIST_NUM (35042711)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r535/r539_11-770"
#define NV_BUILD_CHANGELIST_NUM (35309837)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "rel/gpu_drv/r535/r538_95-688"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (35042711)
#define NV_BUILD_NAME "rel/gpu_drv/r535/r539_11-770"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (35309837)

#else /* Windows builds */
#define NV_BUILD_BRANCH_VERSION "r538_95-1"
#define NV_BUILD_CHANGELIST_NUM (34853858)
#define NV_BUILD_BRANCH_VERSION "r539_11-2"
#define NV_BUILD_CHANGELIST_NUM (35309837)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "538.96"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (34853858)
#define NV_BUILD_NAME "539.14"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (35309837)
#define NV_BUILD_BRANCH_BASE_VERSION R535
#endif
// End buildmeister python edited section
Expand Down
2 changes: 1 addition & 1 deletion src/common/inc/nvUnixVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.216.03"
#define NV_VERSION_STRING "535.230.02"

#else

Expand Down
5 changes: 3 additions & 2 deletions src/common/inc/nvlog_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ struct _NVLOG_BUFFER

#define NVLOG_MAX_BUFFERS_v11 16
#define NVLOG_MAX_BUFFERS_v12 256
#define NVLOG_MAX_BUFFERS_v13 3840

#if NVOS_IS_UNIX
#define NVLOG_MAX_BUFFERS NVLOG_MAX_BUFFERS_v12
#define NVLOG_LOGGER_VERSION 12 // v1.2
#define NVLOG_MAX_BUFFERS NVLOG_MAX_BUFFERS_v13
#define NVLOG_LOGGER_VERSION 13 // v1.3
#else
#define NVLOG_MAX_BUFFERS NVLOG_MAX_BUFFERS_v11
#define NVLOG_LOGGER_VERSION 11 // v1.1
Expand Down
4 changes: 2 additions & 2 deletions src/common/nvswitch/kernel/smbpbi_nvswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ nvswitch_smbpbi_post_init

if (status == NVL_SUCCESS)
{
#if defined(DEBUG) || defined(DEVELOP) || defined(NV_MODS)
#if defined(DEBUG) || defined(DEVELOP)
nvswitch_lib_smbpbi_log_sxid(device, NVSWITCH_ERR_NO_ERROR,
"NVSWITCH SMBPBI server is online.");
#endif // defined(DEBUG) || defined(DEVELOP) || defined(NV_MODS)
#endif // defined(DEBUG) || defined(DEVELOP)

NVSWITCH_PRINT(device, INFO, "%s: SMBPBI POST INIT completed\n", __FUNCTION__);
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/sdk/nvidia/inc/ctrl/ctrl0000/ctrl0000nvd.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ typedef struct NV0000_CTRL_NVD_GET_TIMESTAMP_PARAMS {
#define NV0000_CTRL_NVD_SIGNATURE_SIZE (4)

/* Maximum number of buffers */
#define NV0000_CTRL_NVD_MAX_BUFFERS (256)
#define NV0000_CTRL_NVD_MAX_BUFFERS (3840)

#define NV0000_CTRL_NVD_GET_NVLOG_INFO_PARAMS_MESSAGE_ID (0x4U)

Expand Down
29 changes: 29 additions & 0 deletions src/common/sdk/nvidia/inc/ctrl/ctrl208f/ctrl208fgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,33 @@ typedef struct NV208F_CTRL_GR_ECC_INJECTION_SUPPORTED_PARAMS {
NV_DECLARE_ALIGNED(NV2080_CTRL_GR_ROUTE_INFO grRouteInfo, 8);
} NV208F_CTRL_GR_ECC_INJECTION_SUPPORTED_PARAMS;

/*
* NV208F_CTRL_CMD_GR_ECC_SET_TRANSIENT_CLEARING_POLICY
*
* Control command to determine whether or not the actions to clear potential transient
* errors in the SM should be taken
*
* Parameters:
*
* policy
* NV208F_CTRL_GR_ECC_TRANSIENT_CLEARING_DISABLED
* Don't attempt to clear a transient error in the SM
* NV208F_CTRL_GR_ECC_TRANSIENT_CLEARING_ENABLED
* Attempt to clear a transient error in the SM
*
* Possible status values returned are:
* NV_OK
* NV_ERR_INVALID_ARGUMENT
*/
#define NV208F_CTRL_GR_ECC_TRANSIENT_CLEARING_DISABLED (0x00000000)
#define NV208F_CTRL_GR_ECC_TRANSIENT_CLEARING_ENABLED (0x00000001)

#define NV208F_CTRL_CMD_GR_ECC_SET_TRANSIENT_CLEARING_POLICY (0x208f1205) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_DIAG_GR_INTERFACE_ID << 8) | NV208F_CTRL_GR_ECC_SET_TRANSIENT_CLEARING_POLICY_PARAMS_MESSAGE_ID" */

#define NV208F_CTRL_GR_ECC_SET_TRANSIENT_CLEARING_POLICY_PARAMS_MESSAGE_ID (0x5U)

typedef struct NV208F_CTRL_GR_ECC_SET_TRANSIENT_CLEARING_POLICY_PARAMS {
NvU32 policy;
} NV208F_CTRL_GR_ECC_SET_TRANSIENT_CLEARING_POLICY_PARAMS;

/* _ctrl208fgr_h_ */
Loading

0 comments on commit 855c3c9

Please sign in to comment.