Skip to content

Commit

Permalink
530.41.03
Browse files Browse the repository at this point in the history
  • Loading branch information
aritger committed Mar 23, 2023
1 parent 4397463 commit 6dd092d
Show file tree
Hide file tree
Showing 63 changed files with 847 additions and 148 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Changelog

## Release 530 Entries


### [530.41.03] 2023-03-23

### [530.30.02] 2023-02-28

#### Fixed

- Add support for resizable BAR on Linux when NVreg_EnableResizableBar=1 module param is set. [#3](https://github.com/NVIDIA/open-gpu-kernel-modules/pull/3) by @sjkelly

#### Added

- Support for power management features like Suspend, Hibernate and Resume.

## Release 525 Entries

### [525.89.02] 2023-02-08
Expand Down
19 changes: 15 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 530.30.02.
version 530.41.03.


## 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
530.30.02 driver release. This can be achieved by installing
530.41.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.,

Expand Down Expand Up @@ -167,15 +167,15 @@ for the target kernel.
## Compatible GPUs

The open-gpu-kernel-modules can be used on any Turing or later GPU
(see the table below). However, in the 530.30.02 release,
(see the table below). However, in the 530.41.03 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/530.30.02/README/kernel_open.html
https://us.download.nvidia.com/XFree86/Linux-x86_64/530.41.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
Expand Down Expand Up @@ -720,9 +720,13 @@ Subsystem Device ID.
| NVIDIA A10 | 2236 10DE 1482 |
| NVIDIA A10G | 2237 10DE 152F |
| NVIDIA A10M | 2238 10DE 1677 |
| NVIDIA H800 PCIe | 2322 10DE 17A4 |
| NVIDIA H800 | 2324 10DE 17A6 |
| NVIDIA H800 | 2324 10DE 17A8 |
| NVIDIA H100 80GB HBM3 | 2330 10DE 16C0 |
| NVIDIA H100 80GB HBM3 | 2330 10DE 16C1 |
| NVIDIA H100 PCIe | 2331 10DE 1626 |
| NVIDIA H100 | 2339 10DE 17FC |
| NVIDIA GeForce RTX 3060 Ti | 2414 |
| NVIDIA GeForce RTX 3080 Ti Laptop GPU | 2420 |
| NVIDIA RTX A5500 Laptop GPU | 2438 |
Expand Down Expand Up @@ -809,11 +813,18 @@ Subsystem Device ID.
| NVIDIA RTX 6000 Ada Generation | 26B1 10DE 16A1 |
| NVIDIA RTX 6000 Ada Generation | 26B1 17AA 16A1 |
| NVIDIA L40 | 26B5 10DE 169D |
| NVIDIA L40 | 26B5 10DE 17DA |
| NVIDIA GeForce RTX 4080 | 2704 |
| NVIDIA GeForce RTX 4090 Laptop GPU | 2717 |
| NVIDIA GeForce RTX 4090 Laptop GPU | 2757 |
| NVIDIA GeForce RTX 4070 Ti | 2782 |
| NVIDIA GeForce RTX 4080 Laptop GPU | 27A0 |
| NVIDIA RTX 4000 SFF Ada Generation | 27B0 1028 16FA |
| NVIDIA RTX 4000 SFF Ada Generation | 27B0 103C 16FA |
| NVIDIA RTX 4000 SFF Ada Generation | 27B0 10DE 16FA |
| NVIDIA RTX 4000 SFF Ada Generation | 27B0 17AA 16FA |
| NVIDIA L4 | 27B8 10DE 16CA |
| NVIDIA L4 | 27B8 10DE 16EE |
| NVIDIA GeForce RTX 4080 Laptop GPU | 27E0 |
| NVIDIA GeForce RTX 4070 Laptop GPU | 2820 |
| NVIDIA GeForce RTX 4070 Laptop GPU | 2860 |
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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=\"530.30.02\"
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"530.41.03\"

ifneq ($(SYSSRCHOST1X),)
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
Expand Down
18 changes: 18 additions & 0 deletions kernel-open/common/inc/nv-mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,22 @@ static inline struct rw_semaphore *nv_mmap_get_lock(struct mm_struct *mm)
#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)
vm_flags_set(vma, flags);
#else
vma->vm_flags |= flags;
#endif
}

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)
vm_flags_clear(vma, flags);
#else
vma->vm_flags &= ~flags;
#endif
}

#endif // __NV_MM_H__
19 changes: 19 additions & 0 deletions kernel-open/conftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5680,6 +5680,25 @@ compile_test() {
compile_check_conftest "$CODE" "NV_IOMMU_SVA_BIND_DEVICE_HAS_DRVDATA_ARG" "" "types"
;;

vm_area_struct_has_const_vm_flags)
#
# Determine if the 'vm_area_struct' structure has
# const 'vm_flags'.
#
# A union of '__vm_flags' and 'const vm_flags' was added
# by commit bc292ab00f6c ("mm: introduce vma->vm_flags
# wrapper functions") in mm-stable branch (2023-02-09)
# of the akpm/mm maintainer tree.
#
CODE="
#include <linux/mm_types.h>
int conftest_vm_area_struct_has_const_vm_flags(void) {
return offsetof(struct vm_area_struct, __vm_flags);
}"

compile_check_conftest "$CODE" "NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS" "" "types"
;;

# When adding a new conftest entry, please use the correct format for
# specifying the relevant upstream Linux kernel commit.
#
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static struct sg_table *__nv_drm_gem_nvkms_memory_prime_get_sg_table(
nv_dev,
"Cannot create sg_table for NvKmsKapiMemory 0x%p",
nv_gem->pMemory);
return NULL;
return ERR_PTR(-ENOMEM);
}

sg_table = nv_drm_prime_pages_to_sg(nv_dev->dev,
Expand Down
6 changes: 3 additions & 3 deletions kernel-open/nvidia-drm/nvidia-drm-gem-user-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ static int __nv_drm_gem_user_memory_mmap(struct nv_drm_gem_object *nv_gem,
return -EINVAL;
}

vma->vm_flags &= ~VM_PFNMAP;
vma->vm_flags &= ~VM_IO;
vma->vm_flags |= VM_MIXEDMAP;
nv_vm_flags_clear(vma, VM_PFNMAP);
nv_vm_flags_clear(vma, VM_IO);
nv_vm_flags_set(vma, VM_MIXEDMAP);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/nvidia-drm/nvidia-drm-gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ int nv_drm_mmap(struct file *file, struct vm_area_struct *vma)
ret = -EINVAL;
goto done;
}
vma->vm_flags &= ~VM_MAYWRITE;
nv_vm_flags_clear(vma, VM_MAYWRITE);
}
#endif

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 @@ -129,3 +129,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_file_get_master
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_modeset_lock_all_end
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_connector_lookup
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_connector_put
NV_CONFTEST_TYPE_COMPILE_TESTS += vm_area_struct_has_const_vm_flags
9 changes: 9 additions & 0 deletions kernel-open/nvidia-modeset/nvidia-modeset-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ module_param_named(config_file, nvkms_conf, charp, 0400);

static atomic_t nvkms_alloc_called_count;

static bool force_api_to_hw_head_identity_mapping = false;
module_param_named(force_api_to_hw_head_identity_mapping,
force_api_to_hw_head_identity_mapping, bool, 0400);

NvBool nvkms_force_api_to_hw_head_identity_mappings(void)
{
return force_api_to_hw_head_identity_mapping;
}

NvBool nvkms_output_rounding_fix(void)
{
return output_rounding_fix;
Expand Down
1 change: 1 addition & 0 deletions kernel-open/nvidia-modeset/nvidia-modeset-os-interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef struct {
} read_minval;
} NvKmsSyncPtOpParams;

NvBool nvkms_force_api_to_hw_head_identity_mappings(void);
NvBool nvkms_output_rounding_fix(void);

void nvkms_call_rm (void *ops);
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 @@ -103,5 +103,6 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += timespec64
NV_CONFTEST_TYPE_COMPILE_TESTS += mm_has_mmap_lock
NV_CONFTEST_TYPE_COMPILE_TESTS += migrate_vma_added_flags
NV_CONFTEST_TYPE_COMPILE_TESTS += migrate_device_range
NV_CONFTEST_TYPE_COMPILE_TESTS += vm_area_struct_has_const_vm_flags

NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_int_active_memcg
2 changes: 1 addition & 1 deletion kernel-open/nvidia-uvm/uvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static int uvm_mmap(struct file *filp, struct vm_area_struct *vma)
// of removing CPU mappings in the parent on fork()+exec(). Users can call
// madvise(MDV_DOFORK) if the child process requires access to the
// allocation.
vma->vm_flags |= VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTCOPY;
nv_vm_flags_set(vma, VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTCOPY);

vma->vm_ops = &uvm_vm_ops_managed;

Expand Down
12 changes: 6 additions & 6 deletions kernel-open/nvidia/nv-mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ static int nvidia_mmap_numa(
}

// Needed for the linux kernel for mapping compound pages
vma->vm_flags |= VM_MIXEDMAP;
nv_vm_flags_set(vma, VM_MIXEDMAP);

for (i = 0, addr = mmap_context->page_array[0]; i < pages;
addr = mmap_context->page_array[++i], start += PAGE_SIZE)
Expand Down Expand Up @@ -603,7 +603,7 @@ int nvidia_mmap_helper(
}
up(&nvl->mmap_lock);

vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND;
nv_vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND);
}
else
{
Expand Down Expand Up @@ -670,15 +670,15 @@ int nvidia_mmap_helper(

NV_PRINT_AT(NV_DBG_MEMINFO, at);

vma->vm_flags |= (VM_IO | VM_LOCKED | VM_RESERVED);
vma->vm_flags |= (VM_DONTEXPAND | VM_DONTDUMP);
nv_vm_flags_set(vma, VM_IO | VM_LOCKED | VM_RESERVED);
nv_vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP);
}

if ((prot & NV_PROTECT_WRITEABLE) == 0)
{
vma->vm_page_prot = NV_PGPROT_READ_ONLY(vma->vm_page_prot);
vma->vm_flags &= ~VM_WRITE;
vma->vm_flags &= ~VM_MAYWRITE;
nv_vm_flags_clear(vma, VM_WRITE);
nv_vm_flags_clear(vma, VM_MAYWRITE);
}

vma->vm_ops = &nv_vm_ops;
Expand Down
24 changes: 20 additions & 4 deletions kernel-open/nvidia/nv.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ NvBool nv_ats_supported = NVCPU_IS_PPC64LE
/* nvos_ functions.. do not take a state device parameter */
static int nvos_count_devices(void);

static nv_alloc_t *nvos_create_alloc(struct device *, int);
static nv_alloc_t *nvos_create_alloc(struct device *, NvU64);
static int nvos_free_alloc(nv_alloc_t *);

/***
Expand Down Expand Up @@ -280,11 +280,11 @@ void nv_sev_init(
static
nv_alloc_t *nvos_create_alloc(
struct device *dev,
int num_pages
NvU64 num_pages
)
{
nv_alloc_t *at;
unsigned int pt_size;
NvU64 pt_size;
unsigned int i;

NV_KZALLOC(at, sizeof(nv_alloc_t));
Expand All @@ -296,6 +296,23 @@ nv_alloc_t *nvos_create_alloc(

at->dev = dev;
pt_size = num_pages * sizeof(nvidia_pte_t *);
//
// Check for multiplication overflow and check whether num_pages value can fit in at->num_pages.
//
if ((num_pages != 0) && ((pt_size / num_pages) != sizeof(nvidia_pte_t*)))
{
nv_printf(NV_DBG_ERRORS, "NVRM: Invalid page table allocation - Number of pages exceeds max value.\n");
NV_KFREE(at, sizeof(nv_alloc_t));
return NULL;
}

at->num_pages = num_pages;
if (at->num_pages != num_pages)
{
nv_printf(NV_DBG_ERRORS, "NVRM: Invalid page table allocation - requested size overflows.\n");
NV_KFREE(at, sizeof(nv_alloc_t));
return NULL;
}

if (os_alloc_mem((void **)&at->page_table, pt_size) != NV_OK)
{
Expand All @@ -305,7 +322,6 @@ nv_alloc_t *nvos_create_alloc(
}

memset(at->page_table, 0, pt_size);
at->num_pages = num_pages;
NV_ATOMIC_SET(at->usage_count, 0);

for (i = 0; i < at->num_pages; i++)
Expand Down
1 change: 1 addition & 0 deletions kernel-open/nvidia/nvidia.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += remove_memory_has_nid_arg
NV_CONFTEST_TYPE_COMPILE_TESTS += add_memory_driver_managed_has_mhp_flags_arg
NV_CONFTEST_TYPE_COMPILE_TESTS += num_registered_fb
NV_CONFTEST_TYPE_COMPILE_TESTS += pci_driver_has_driver_managed_dma
NV_CONFTEST_TYPE_COMPILE_TESTS += vm_area_struct_has_const_vm_flags

NV_CONFTEST_GENERIC_COMPILE_TESTS += dom0_kernel_present
NV_CONFTEST_GENERIC_COMPILE_TESTS += nvidia_vgpu_kvm_build
Expand Down
4 changes: 4 additions & 0 deletions src/common/displayport/inc/dp_connector.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ namespace DisplayPort

virtual NvBool isDSCSupported() = 0;

virtual NvBool isDSCDecompressionSupported() = 0;

virtual NvBool isDSCPassThroughSupported() = 0;

virtual DscCaps getDscCaps() = 0;

//
Expand Down
1 change: 1 addition & 0 deletions src/common/displayport/inc/dp_deviceimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ namespace DisplayPort
bool getFECSupport();
NvBool isDSCPassThroughSupported();
NvBool isDSCSupported();
NvBool isDSCDecompressionSupported();
NvBool isDSCPossible();
bool isFECSupported();
bool readAndParseDSCCaps();
Expand Down
4 changes: 3 additions & 1 deletion src/common/displayport/src/dp_connectorimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5546,7 +5546,8 @@ void ConnectorImpl::notifyLongPulse(bool statusConnected)

if (existingDev && existingDev->isFakedMuxDevice() && !bIsMuxOnDgpu)
{
DP_LOG((" NotifyLongPulse ignored as mux is not pointing to dGPU and there is a faked device"));
DP_LOG((" NotifyLongPulse ignored as mux is not pointing to dGPU and there is a faked device. Marking detect complete"));
sink->notifyDetectComplete();
return;
}

Expand Down Expand Up @@ -6520,6 +6521,7 @@ void ConnectorImpl::createFakeMuxDevice(const NvU8 *buffer, NvU32 bufferSize)

// Initialize DSC state
newDev->dscCaps.bDSCSupported = true;
newDev->dscCaps.bDSCDecompressionSupported = true;
newDev->parseDscCaps(buffer, bufferSize);
dpMemCopy(newDev->rawDscCaps, buffer, DP_MIN(bufferSize, 16));
newDev->bDSCPossible = true;
Expand Down
Loading

0 comments on commit 6dd092d

Please sign in to comment.