Skip to content

Commit 9756a4d

Browse files
committed
535.309.01
1 parent ef65a13 commit 9756a4d

42 files changed

Lines changed: 551 additions & 250 deletions

Some content is hidden

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

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.288.01.
4+
version 535.309.01.
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.288.01 driver release. This can be achieved by installing
20+
535.309.01 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.288.01 release,
183+
(see the table below). However, in the 535.309.01 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.288.01/README/kernel_open.html
191+
https://us.download.nvidia.com/XFree86/Linux-x86_64/535.309.01/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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ccflags-y += -I$(src)/common/inc
7979
ccflags-y += -I$(src)
8080
ccflags-y += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
8181
ccflags-y += -D__KERNEL__ -DMODULE -DNVRM
82-
ccflags-y += -DNV_VERSION_STRING=\"535.288.01\"
82+
ccflags-y += -DNV_VERSION_STRING=\"535.309.01\"
8383

8484
ifneq ($(SYSSRCHOST1X),)
8585
ccflags-y += -I$(SYSSRCHOST1X)
@@ -163,6 +163,7 @@ NV_CONFTEST_CFLAGS += $(filter -std=%,$(KBUILD_CFLAGS))
163163
NV_CONFTEST_CFLAGS += $(call cc-disable-warning,pointer-sign)
164164
NV_CONFTEST_CFLAGS += $(call cc-option,-fshort-wchar,)
165165
NV_CONFTEST_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types,)
166+
NV_CONFTEST_CFLAGS += $(call cc-option,-fms-extensions,)
166167

167168
NV_CONFTEST_COMPILE_TEST_HEADERS := $(obj)/conftest/macros.h
168169
NV_CONFTEST_COMPILE_TEST_HEADERS += $(obj)/conftest/functions.h
@@ -228,6 +229,7 @@ $(obj)/conftest/patches.h: $(NV_CONFTEST_SCRIPT)
228229
NV_HEADER_PRESENCE_TESTS = \
229230
asm/system.h \
230231
drm/drmP.h \
232+
drm/drm_print.h \
231233
drm/drm_auth.h \
232234
drm/drm_gem.h \
233235
drm/drm_crtc.h \

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,27 @@ static inline void nv_nvlfp_put_sp(nv_linux_file_private_t *nvlfp, nvidia_entry_
17301730
#define NV_ATOMIC_DEC(data) atomic_dec(&(data))
17311731
#define NV_ATOMIC_DEC_AND_TEST(data) atomic_dec_and_test(&(data))
17321732

1733+
#if defined(smp_store_release)
1734+
#define nv_smp_store_release(p, v) smp_store_release(p, v);
1735+
#else
1736+
#define nv_smp_store_release(p, v) \
1737+
do { \
1738+
smp_mb(); \
1739+
ACCESS_ONCE(*p) = (v); \
1740+
} while (0)
1741+
#endif
1742+
1743+
#if defined(smp_load_acquire)
1744+
#define nv_smp_load_acquire(p) smp_load_acquire(p)
1745+
#else
1746+
#define nv_smp_load_acquire(p) \
1747+
({ \
1748+
typeof(*p) ___p1 = ACCESS_ONCE(*p); \
1749+
smp_mb(); \
1750+
___p1; \
1751+
})
1752+
#endif
1753+
17331754
static inline struct kmem_cache *nv_kmem_cache_create(const char *name, unsigned int size,
17341755
unsigned int align)
17351756
{

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

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,43 @@ static inline struct rw_semaphore *nv_mmap_get_lock(struct mm_struct *mm)
299299
* Commit 45ad9f5290dc updated vma_start_write() to call __vma_start_write().
300300
*/
301301
void nv_vma_start_write(struct vm_area_struct *);
302+
303+
static inline void nv_vma_flags_set_word(struct vm_area_struct *vma, unsigned long flags)
304+
{
305+
nv_vma_start_write(vma);
306+
#if defined(NV_VMA_FLAGS_SET_WORD_PRESENT)
307+
vma_flags_set_word(&vma->flags, flags);
308+
#else
309+
ACCESS_PRIVATE(vma, __vm_flags) |= flags;
310+
#endif
311+
}
312+
313+
static inline void nv_vma_flags_clear_word(struct vm_area_struct *vma, unsigned long flags)
314+
{
315+
nv_vma_start_write(vma);
316+
#if defined(NV_VMA_FLAGS_SET_WORD_PRESENT)
317+
vma_flags_clear_word(&vma->flags, flags);
318+
#else
319+
ACCESS_PRIVATE(vma, __vm_flags) &= ~flags;
302320
#endif
321+
}
322+
323+
static inline int nv_is_vma_write_locked(struct vm_area_struct *vma, unsigned int *mm_lock_seq)
324+
{
325+
#if defined(NV_IS_VMA_WRITE_LOCKED_HAS_MM_LOCK_SEQ_ARG)
326+
return __is_vma_write_locked(vma, mm_lock_seq);
327+
#else
328+
*mm_lock_seq = __vma_raw_mm_seqnum(vma);
329+
return __is_vma_write_locked(vma);
330+
#endif
331+
}
332+
#endif // !NV_CAN_CALL_VMA_START_WRITE
303333

304334
static inline void nv_vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)
305335
{
306336
#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)
337+
nv_vma_flags_set_word(vma, flags);
338+
#elif defined(NV_VM_FLAGS_SET_PRESENT)
310339
vm_flags_set(vma, flags);
311340
#else
312341
vma->vm_flags |= flags;
@@ -316,9 +345,8 @@ static inline void nv_vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)
316345
static inline void nv_vm_flags_clear(struct vm_area_struct *vma, vm_flags_t flags)
317346
{
318347
#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)
348+
nv_vma_flags_clear_word(vma, flags);
349+
#elif defined(NV_VM_FLAGS_SET_PRESENT)
322350
vm_flags_clear(vma, flags);
323351
#else
324352
vma->vm_flags &= ~flags;

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@
3636
#define NV_MAX_ISR_DELAY_MS (NV_MAX_ISR_DELAY_US / 1000)
3737
#define NV_NSECS_TO_JIFFIES(nsec) ((nsec) * HZ / 1000000000)
3838

39+
/*
40+
* in_hardirq() was added in v5.11-rc1 (2020-12-15) to replace in_irq().
41+
* Fall back to in_irq() for older kernels that don't have in_hardirq().
42+
*/
43+
static inline NvBool nv_in_hardirq(void)
44+
{
45+
#if defined(in_hardirq)
46+
return in_hardirq();
47+
#else
48+
return in_irq();
49+
#endif
50+
}
51+
3952
#if !defined(NV_TIMESPEC64_PRESENT)
4053
struct timespec64 {
4154
__s64 tv_sec;
@@ -142,7 +155,7 @@ static inline NV_STATUS nv_sleep_us(unsigned int us)
142155
ktime_get_raw_ts64(&tm1);
143156
#endif
144157

145-
if (in_irq() && (us > NV_MAX_ISR_DELAY_US))
158+
if (nv_in_hardirq() && (us > NV_MAX_ISR_DELAY_US))
146159
return NV_ERR_GENERIC;
147160

148161
mdelay_safe_msec = us / 1000;
@@ -187,7 +200,7 @@ static inline NV_STATUS nv_sleep_ms(unsigned int ms)
187200
tm_start = tm_aux;
188201
#endif
189202

190-
if (in_irq() && (ms > NV_MAX_ISR_DELAY_MS))
203+
if (nv_in_hardirq() && (ms > NV_MAX_ISR_DELAY_MS))
191204
{
192205
return NV_ERR_GENERIC;
193206
}

kernel-open/common/inc/nv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ typedef struct nv_alloc_mapping_context_s {
305305
NvU64 access_size;
306306
NvU64 remap_prot_extra;
307307
NvU32 prot;
308-
NvBool valid;
308+
NvU32 valid;
309309
NvU32 caching;
310310
} nv_alloc_mapping_context_t;
311311

0 commit comments

Comments
 (0)