From 5ffda78c4cb69418175a310dd35918ace2d4694e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Fri, 13 Jun 2025 13:18:10 +0200 Subject: [PATCH 1/3] xf86-video-nvidia: add patch to fix build on 6.15 Signed-off-by: Matthias Reichl --- ...d-nv_vm_flags_-calling-GPL-only-code.patch | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 packages/x11/driver/xf86-video-nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch diff --git a/packages/x11/driver/xf86-video-nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch b/packages/x11/driver/xf86-video-nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch new file mode 100644 index 0000000000..62d46455a8 --- /dev/null +++ b/packages/x11/driver/xf86-video-nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch @@ -0,0 +1,75 @@ +--- a/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c ++++ b/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c +@@ -44,6 +44,13 @@ + #include + #endif + ++#include ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + static inline + void __nv_drm_gem_user_memory_free(struct nv_drm_gem_object *nv_gem) + { +--- a/kernel/nvidia-drm/nvidia-drm-gem.c ++++ b/kernel/nvidia-drm/nvidia-drm-gem.c +@@ -51,6 +51,13 @@ + + #include "nv-mm.h" + ++#include ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + void nv_drm_gem_free(struct drm_gem_object *gem) + { + struct nv_drm_gem_object *nv_gem = to_nv_gem_object(gem); +--- a/kernel/nvidia-uvm/uvm.c ++++ b/kernel/nvidia-uvm/uvm.c +@@ -21,6 +21,8 @@ + + *******************************************************************************/ + ++#include ++ + #include "uvm_api.h" + #include "uvm_global.h" + #include "uvm_gpu_replayable_faults.h" +@@ -40,6 +42,11 @@ + + #define NVIDIA_UVM_DEVICE_NAME "nvidia-uvm" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + static dev_t g_uvm_base_dev; + static struct cdev g_uvm_cdev; + static const struct file_operations uvm_fops; +--- a/kernel/nvidia/nv-mmap.c ++++ b/kernel/nvidia/nv-mmap.c +@@ -23,10 +23,17 @@ + + #define __NO_VERSION__ + ++#include ++ + #include "os-interface.h" + #include "nv-linux.h" + #include "nv_speculation_barrier.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + /* + * The 'struct vm_operations' open() callback is called by the Linux + * kernel when the parent VMA is split or copied, close() when the From cf024857ec7a52e9ca9e6b8ca7fca54ba3514e5e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Fri, 13 Jun 2025 13:18:10 +0200 Subject: [PATCH 2/3] nvidia: add patch to fix build on 6.15 Signed-off-by: Matthias Reichl --- ...d-nv_vm_flags_-calling-GPL-only-code.patch | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 packages/graphics/nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch diff --git a/packages/graphics/nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch b/packages/graphics/nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch new file mode 100644 index 0000000000..62d46455a8 --- /dev/null +++ b/packages/graphics/nvidia/patches/001-Workaround-nv_vm_flags_-calling-GPL-only-code.patch @@ -0,0 +1,75 @@ +--- a/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c ++++ b/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c +@@ -44,6 +44,13 @@ + #include + #endif + ++#include ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + static inline + void __nv_drm_gem_user_memory_free(struct nv_drm_gem_object *nv_gem) + { +--- a/kernel/nvidia-drm/nvidia-drm-gem.c ++++ b/kernel/nvidia-drm/nvidia-drm-gem.c +@@ -51,6 +51,13 @@ + + #include "nv-mm.h" + ++#include ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + void nv_drm_gem_free(struct drm_gem_object *gem) + { + struct nv_drm_gem_object *nv_gem = to_nv_gem_object(gem); +--- a/kernel/nvidia-uvm/uvm.c ++++ b/kernel/nvidia-uvm/uvm.c +@@ -21,6 +21,8 @@ + + *******************************************************************************/ + ++#include ++ + #include "uvm_api.h" + #include "uvm_global.h" + #include "uvm_gpu_replayable_faults.h" +@@ -40,6 +42,11 @@ + + #define NVIDIA_UVM_DEVICE_NAME "nvidia-uvm" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + static dev_t g_uvm_base_dev; + static struct cdev g_uvm_cdev; + static const struct file_operations uvm_fops; +--- a/kernel/nvidia/nv-mmap.c ++++ b/kernel/nvidia/nv-mmap.c +@@ -23,10 +23,17 @@ + + #define __NO_VERSION__ + ++#include ++ + #include "os-interface.h" + #include "nv-linux.h" + #include "nv_speculation_barrier.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) ++#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f)) ++#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f)) ++#endif ++ + /* + * The 'struct vm_operations' open() callback is called by the Linux + * kernel when the parent VMA is split or copied, close() when the From 577d9b55b05644802dea087c50fe2b1e241c6659 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Fri, 13 Jun 2025 13:29:35 +0200 Subject: [PATCH 3/3] linux (Generic): disable CONFIG_OBJTOOL_WERROR The update to 6.15 sneaked in the non-default OBJTOOL_WERROR config which breaks nvidia builds. Stick to linux defconfig to fix that. Signed-off-by: Matthias Reichl --- projects/Generic/linux/linux.x86_64.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf index 1f65944b29..8b3750b046 100644 --- a/projects/Generic/linux/linux.x86_64.conf +++ b/projects/Generic/linux/linux.x86_64.conf @@ -7399,7 +7399,7 @@ CONFIG_SECTION_MISMATCH_WARN_ONLY=y CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_FRAME_POINTER=y CONFIG_OBJTOOL=y -CONFIG_OBJTOOL_WERROR=y +# CONFIG_OBJTOOL_WERROR is not set CONFIG_STACK_VALIDATION=y # CONFIG_VMLINUX_MAP is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set