On 03/11/2023 22.39, Adam Majer wrote:
You need to specify ibt=off to kernel at boot time for the older nvidia modules to work. Since the kernel has this protection enabled by default, it will have to be disabled until such time as nvidia bothers to update/recompile these older drivers like they did the recent ones.

Thanks for your test.

Since that protection can be disabled with ibt=off, it should be possible to test for the status (not available/enabled/disabled) at module load time and fail the load process with an informative error message instead of calling into the incompatible code from the blob.

The EoL driver series (e.g. anything predating the 470 series) will not see any further updates from NVIDIA. And people still really want to use these old drivers for ancient hardware.

...

Maybe that was really simple. Could you try the attached patch?
(apply it to the source in /usr/src/nvidia-tesla-470-* and rebuild the dkms module)
Or you could simply install the -dkms package from
https://people.debian.org/~anbe/1052069/

The module should continue to work on 6.1
The module should continue to work on 6.5 booted with ibt=off
The module should fail to load with an error message describing the issue on 6.5 with ibt enabled, but without a kernel BUG.


Andreas
From 17b722086d1cbc19ec6ea811a334ff9d90ad90e6 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Sat, 4 Nov 2023 00:44:56 +0100
Subject: [PATCH] refuse to load module if IBT is enabled

---
 nvidia-modeset/nvidia-modeset-linux.c | 7 +++++++
 nvidia/nv.c                           | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/nvidia-modeset/nvidia-modeset-linux.c b/nvidia-modeset/nvidia-modeset-linux.c
index 04a8ac4..95e668e 100644
--- a/nvidia-modeset/nvidia-modeset-linux.c
+++ b/nvidia-modeset/nvidia-modeset-linux.c
@@ -1651,6 +1651,13 @@ static int __init nvkms_init(void)
 {
     int ret;
 
+#ifdef CONFIG_X86_KERNEL_IBT
+    if (cpu_feature_enabled(X86_FEATURE_IBT)) {
+        printk(KERN_ERR NVKMS_LOG_PREFIX "This module is incompatible with IBT. Try booting with ibt=off.");
+        return -EINVAL;
+    }
+#endif
+
     atomic_set(&nvkms_alloc_called_count, 0);
 
     ret = nvkms_alloc_rm();
diff --git a/nvidia/nv.c b/nvidia/nv.c
index 42778da..a005d69 100644
--- a/nvidia/nv.c
+++ b/nvidia/nv.c
@@ -739,6 +739,13 @@ int __init nvidia_init_module(void)
     nvidia_stack_t *sp = NULL;
     NvU32 allow_no_gpu_init = 0;
 
+#ifdef CONFIG_X86_KERNEL_IBT
+    if (cpu_feature_enabled(X86_FEATURE_IBT)) {
+        printk(KERN_ERR "NVRM: This module is incompatible with IBT. Try booting with ibt=off.");
+        return -EINVAL;
+    }
+#endif
+
     nv_memdbg_init();
 
     rc = nv_procfs_init();
-- 
2.20.1

Reply via email to