diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2024-01-08 15:50:15 -0500 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2024-01-08 16:08:06 -0500 |
commit | 0cb6966bc9c75c16bf3a1fb7e36e28ce1e1a453a (patch) | |
tree | f097521c15a5ff4fc1c01911f56dab9af4f3e0a2 /x11-drivers | |
parent | dev-qt/qtbase: shorten intrin test a bit (diff) | |
download | gentoo-0cb6966bc9c75c16bf3a1fb7e36e28ce1e1a453a.tar.gz gentoo-0cb6966bc9c75c16bf3a1fb7e36e28ce1e1a453a.tar.bz2 gentoo-0cb6966bc9c75c16bf3a1fb7e36e28ce1e1a453a.zip |
x11-drivers/nvidia-drivers: fix with linux-6.7 and some configs
Looked fine for me but turns out the issue is conditional to kernel
configs and it was not enabling USE_LKCA with mines. Also needed
USE=kernel-open to run into this.
An NVIDIA representative has offered a fix, so may as well use it
this time around.
525 and older branches did not use this function.
Should be harmless for older kernels, but have not really tested
so only applying if >6.7 as a precaution, esp. for stable 535.
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'x11-drivers')
4 files changed, 33 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-535.43.22-kernel-6.7.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-535.43.22-kernel-6.7.patch new file mode 100644 index 000000000000..08833de8344a --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-535.43.22-kernel-6.7.patch @@ -0,0 +1,24 @@ +Typically opt not to patch for kernel support downstream, but in this +case it's only conditionally broken depending on kernel crypto configs +and USE=kernel-open, then an (official) NVIDIA representative has +responded with a fix in [1] which should be safe. + +[1] https://github.com/NVIDIA/open-gpu-kernel-modules/issues/574#issuecomment-1809283181 +--- a/kernel/nvidia/libspdm_shash.c ++++ b/kernel/nvidia/libspdm_shash.c +@@ -89,4 +89,4 @@ + struct crypto_shash *dst_tfm = dst->tfm; +- char *src_ipad = crypto_tfm_ctx_aligned(&src_tfm->base); +- char *dst_ipad = crypto_tfm_ctx_aligned(&dst_tfm->base); ++ char *src_ipad = crypto_tfm_ctx_align(&src_tfm->base, crypto_tfm_alg_alignmask(&src_tfm->base) + 1); ++ char *dst_ipad = crypto_tfm_ctx_align(&dst_tfm->base, crypto_tfm_alg_alignmask(&dst_tfm->base) + 1); + int ss = crypto_shash_statesize(dst_tfm); +--- a/kernel-module-source/kernel-open/nvidia/libspdm_shash.c ++++ b/kernel-module-source/kernel-open/nvidia/libspdm_shash.c +@@ -89,4 +89,4 @@ + struct crypto_shash *dst_tfm = dst->tfm; +- char *src_ipad = crypto_tfm_ctx_aligned(&src_tfm->base); +- char *dst_ipad = crypto_tfm_ctx_aligned(&dst_tfm->base); ++ char *src_ipad = crypto_tfm_ctx_align(&src_tfm->base, crypto_tfm_alg_alignmask(&src_tfm->base) + 1); ++ char *dst_ipad = crypto_tfm_ctx_align(&dst_tfm->base, crypto_tfm_alg_alignmask(&dst_tfm->base) + 1); + int ss = crypto_shash_statesize(dst_tfm); diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild index 4e12ff078da1..8bc1465f4494 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild @@ -137,6 +137,9 @@ src_prepare() { default + kernel_is -ge 6 7 && + eapply "${FILESDIR}"/nvidia-drivers-535.43.22-kernel-6.7.patch + # prevent detection of incomplete kernel DRM support (bug #603818) sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ -i kernel{,-module-source/kernel-open}/conftest.sh || die diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild index ae62cbc6f0ea..4932e930c654 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild @@ -140,6 +140,9 @@ src_prepare() { default + kernel_is -ge 6 7 && + eapply "${FILESDIR}"/nvidia-drivers-535.43.22-kernel-6.7.patch + # prevent detection of incomplete kernel DRM support (bug #603818) sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ -i kernel{,-module-source/kernel-open}/conftest.sh || die diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild index bf4959d91524..e74a99ad11e1 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild @@ -134,6 +134,9 @@ src_prepare() { default + kernel_is -ge 6 7 && + eapply "${FILESDIR}"/nvidia-drivers-535.43.22-kernel-6.7.patch + # prevent detection of incomplete kernel DRM support (bug #603818) sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ -i kernel{,-module-source/kernel-open}/conftest.sh || die |