nvidia-kernel-patches/nvidia-580.76.05-kernel7.patch

147 lines
5.7 KiB
Diff

diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/common/inc/nv-mm.h ./kernel-open/common/inc/nv-mm.h
--- /tmp/nv-pristine/kernel-open/common/inc/nv-mm.h 2025-08-07 16:13:32.000000000 -0400
+++ ./kernel-open/common/inc/nv-mm.h 2026-08-10 18:38:01.233430548 -0400
@@ -202,11 +202,11 @@
{
#if !NV_CAN_CALL_VMA_START_WRITE
nv_vma_start_write(vma);
- ACCESS_PRIVATE(vma, __vm_flags) |= flags;
+ vma_flags_set_word(&vma->flags, flags);
#elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)
vm_flags_set(vma, flags);
#else
- vma->vm_flags |= flags;
+ vm_flags_set(vma, flags);
#endif
}
@@ -214,11 +214,11 @@
{
#if !NV_CAN_CALL_VMA_START_WRITE
nv_vma_start_write(vma);
- ACCESS_PRIVATE(vma, __vm_flags) &= ~flags;
+ vma_flags_clear_word(&vma->flags, flags);
#elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)
vm_flags_clear(vma, flags);
#else
- vma->vm_flags &= ~flags;
+ vm_flags_clear(vma, flags);
#endif
}
diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/common/inc/nv-time.h ./kernel-open/common/inc/nv-time.h
--- /tmp/nv-pristine/kernel-open/common/inc/nv-time.h 2025-08-07 16:13:29.000000000 -0400
+++ ./kernel-open/common/inc/nv-time.h 2026-08-10 18:36:21.200197921 -0400
@@ -82,7 +82,7 @@
ktime_get_raw_ts64(&tm1);
#endif
- if (in_irq() && (us > NV_MAX_ISR_DELAY_US))
+ if (in_hardirq() && (us > NV_MAX_ISR_DELAY_US))
return NV_ERR_GENERIC;
mdelay_safe_msec = us / 1000;
@@ -127,7 +127,7 @@
tm_start = tm_aux;
#endif
- if (in_irq() && (ms > NV_MAX_ISR_DELAY_MS))
+ if (in_hardirq() && (ms > NV_MAX_ISR_DELAY_MS))
{
return NV_ERR_GENERIC;
}
diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/conftest.sh ./kernel-open/conftest.sh
--- /tmp/nv-pristine/kernel-open/conftest.sh 2025-08-07 15:51:13.000000000 -0400
+++ ./kernel-open/conftest.sh 2026-08-10 18:38:01.205430483 -0400
@@ -164,7 +164,7 @@
MACH_CFLAGS="$MACH_CFLAGS -I$SOURCE_ARCH_HEADERS/asm/mach-default"
CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -include $AUTOCONF_FILE"
- CFLAGS="$CFLAGS -I$SOURCE_HEADERS"
+ CFLAGS="$CFLAGS -I$SOURCE_HEADERS -std=gnu11 -fms-extensions -Wno-error=implicit-function-declaration -Wno-error=int-conversion -Wno-error=incompatible-pointer-types"
CFLAGS="$CFLAGS -I$SOURCE_HEADERS/uapi"
CFLAGS="$CFLAGS -I$SOURCE_HEADERS/xen"
CFLAGS="$CFLAGS -I$OUTPUT_HEADERS/generated/uapi"
diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/nvidia/nv-dma.c ./kernel-open/nvidia/nv-dma.c
--- /tmp/nv-pristine/kernel-open/nvidia/nv-dma.c 2025-08-07 16:13:19.000000000 -0400
+++ ./kernel-open/nvidia/nv-dma.c 2026-08-10 18:36:21.214197952 -0400
@@ -718,7 +718,7 @@
#endif
}
- return (ops->map_resource != NULL);
+ return (ops->map_phys != NULL);
}
/* DMA-map a peer device's C2C aperture for peer access. */
diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/nvidia/nv-pci.c ./kernel-open/nvidia/nv-pci.c
--- /tmp/nv-pristine/kernel-open/nvidia/nv-pci.c 2025-08-07 16:13:18.000000000 -0400
+++ ./kernel-open/nvidia/nv-pci.c 2026-08-10 18:37:07.883305841 -0400
@@ -229,7 +229,7 @@
resize:
/* Attempt to resize BAR1 to the largest supported size */
- r = pci_resize_resource(pci_dev, NV_GPU_BAR1, requested_size);
+ r = pci_resize_resource(pci_dev, NV_GPU_BAR1, requested_size, 0);
if (r) {
if (r == -ENOSPC)
diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/nvidia/os-interface.c ./kernel-open/nvidia/os-interface.c
--- /tmp/nv-pristine/kernel-open/nvidia/os-interface.c 2025-08-07 16:13:20.000000000 -0400
+++ ./kernel-open/nvidia/os-interface.c 2026-08-10 18:36:21.201197924 -0400
@@ -371,7 +371,7 @@
NvBool NV_API_CALL os_is_isr(void)
{
- return (in_irq());
+ return (in_hardirq());
}
// return TRUE if the caller is the super-user
diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/nvidia-uvm/uvm_hmm.c ./kernel-open/nvidia-uvm/uvm_hmm.c
--- /tmp/nv-pristine/kernel-open/nvidia-uvm/uvm_hmm.c 2025-08-07 16:13:56.000000000 -0400
+++ ./kernel-open/nvidia-uvm/uvm_hmm.c 2026-08-10 18:37:52.543410234 -0400
@@ -2004,7 +2004,7 @@
hmm_mark_gpu_chunk_referenced(va_block, gpu, gpu_chunk);
UVM_ASSERT(!page_count(dpage));
- zone_device_page_init(dpage);
+ zone_device_page_init(dpage, page_pgmap(dpage), 0);
dpage->zone_device_data = gpu_chunk;
atomic64_inc(&va_block->hmm.va_space->hmm.allocated_page_count);
diff -ruN '--exclude=*.log' '--exclude=*.orig' '--exclude=conftest*.c' /tmp/nv-pristine/kernel-open/nvidia-uvm/uvm_pmm_gpu.c ./kernel-open/nvidia-uvm/uvm_pmm_gpu.c
--- /tmp/nv-pristine/kernel-open/nvidia-uvm/uvm_pmm_gpu.c 2025-08-07 16:13:54.000000000 -0400
+++ ./kernel-open/nvidia-uvm/uvm_pmm_gpu.c 2026-08-10 18:37:52.540410227 -0400
@@ -3168,9 +3168,14 @@
UVM_ENTRY_RET(devmem_fault(vmf));
}
+static void devmem_folio_free(struct folio *folio)
+{
+ devmem_page_free(&folio->page);
+}
+
static const struct dev_pagemap_ops uvm_pmm_devmem_ops =
{
- .page_free = devmem_page_free,
+ .folio_free = devmem_folio_free,
.migrate_to_ram = devmem_fault_entry,
};
@@ -3325,9 +3330,14 @@
nv_kref_put(&p2p_mem->refcount, device_p2p_page_free_wake);
}
+static void device_p2p_folio_free(struct folio *folio)
+{
+ device_p2p_page_free(&folio->page);
+}
+
static const struct dev_pagemap_ops uvm_device_p2p_pgmap_ops =
{
- .page_free = device_p2p_page_free,
+ .folio_free = device_p2p_folio_free,
};
void uvm_pmm_gpu_device_p2p_init(uvm_gpu_t *gpu)