If anyone wants to use the Nvidia 390 with a kernel to 6.8, they can use the
following, as I found it too.
There is my script at the bottom but because I'm not a 100% sure of the right
way to do this, I will also explain how I did it (Sorry my first time
commenting/posting here).
1. Kernel API changes 6.3 -> 6.8. The packaging carries patches to 6.2
and stops. Five things broke after that:
6.3 — vma->vm_flags write-protected, needs vm_flags_set()
6.4 — drm_driver.dumb_destroy removed
6.5 — get_user_pages_remote() lost its vmas arg
6.6 — drm_gem_prime_handle_to_fd unexported
6.8 — DRM_UNLOCKED removed
All five already exist in the AUR nvidia-390xx-utils package. They need
their paths rewritten from a/kernel/common/inc/... to a/common/inc/...
for the Debian tree, then adding to dkms.conf. All are
LINUX_VERSION_CODE guarded, so they're safe to keep on 5.15 — my 5.15
build still works with them applied.
2. objtool rejects NVIDIA's retpoline thunks. This is the part that
isn't written up anywhere as far as I can find. With the patches applied
it still fails, and there is no compiler error in make.log:
make[3]: *** [scripts/Makefile.build:243: .../nvidia/nv.o] Error 241
preceded by 15 of:
nv.o: warning: objtool: __x86_indirect_thunk_rax+0x0: indirect jump
found in MITIGATION_RETPOLINE build
The compile line ends in ; ./tools/objtool/objtool ... --module nv.o, so
the status make sees is objtool's, not gcc's.
kernel/Makefile:66 has SPECTRE_V2_RETPOLINE ?= 0 hardcoded. That feeds
-DNV_SPECTRE_V2=0, and common/inc/nv-retpoline.h:28 gates on #if
(NV_SPECTRE_V2 == 0) to define __x86_indirect_thunk_* locally — it did
that because in 2018 not every kernel exported them.
So 390 has always shipped duplicate thunks. It was invisible on 5.15
because objtool wasn't checking. 6.8.0-136 has the backported objtool
that does, and a retpoline thunk is a bare indirect jump, so objtool
flags exactly what it's built to flag.
Setting it to 1 fixes it, and has the side effect of making the driver
use the kernel's real retpolines instead of its own passthroughs.
sudo sed -i 's/^ SPECTRE_V2_RETPOLINE ?= 0/ SPECTRE_V2_RETPOLINE ?= 1/' \
/usr/src/nvidia-390.157/Makefile
Arch doesn't hit this because their 6.8 predates the objtool backport.
Tested:
GPU: GF117M [GeForce 820M] [10de:1140]
OS: Linux Mint 21.3 Xfce (jammy)
Kernel: 6.8.0-136-generic
Driver: 390.157-0ubuntu+klbkjammy1.1 (ppa:kelebek333/nvidia-legacy)
dkms status: nvidia/390.157, 6.8.0-136-generic, x86_64: installed
nvidia/390.157, 5.15.0-186-generic, x86_64: installed
nvidia-smi: GeForce 820M, P0
glxinfo: OpenGL renderer string: GeForce 820M/PCIe/SSE2
Scripts and the path-rewritten patches:
https://github.com/yepistream/nvidia-390-kernel-6.8/blob/master/README.md
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2028165
Title:
nvidia-dkms-* FTBS with linux 6.5
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/+bug/2028165/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs