5.16 workaround (#79)

* 5.16 fix

* 5.16-fix
pull/81/head
ptr1337 3 years ago committed by GitHub
parent f1ce2cbdc5
commit d66325a425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -286,6 +286,7 @@ source=($_source_name
'455-crashfix.diff' # 455 drivers fix - https://forums.developer.nvidia.com/t/455-23-04-page-allocation-failure-in-kernel-module-at-random-points/155250/79
'kernel-5.12.patch' # 5.12 workaround
'kernel-5.14.patch' # 5.14 workaround
'kernel-5.16.patch' # 5.16 workaround
)
msg2 "Selected driver integrity check behavior (md5sum or SKIP): $_md5sum" # If the driver is "known", return md5sum. If it isn't, return SKIP
@ -322,7 +323,8 @@ md5sums=("$_md5sum"
'8764cc714e61363cc8f818315957ad17'
'08bec554de265ce5fdcfdbd55fb608fc'
'3980770412a1d4d7bd3a16c9042200df'
'f5fd091893f513d2371654e83049f099')
'f5fd091893f513d2371654e83049f099'
'd684ca11fdc9894c14ead69cb35a5946')
if [ "$_autoaddpatch" = "true" ]; then
# Auto-add *.patch files from $startdir to source=()
@ -649,6 +651,12 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf
_whitelist514=( 465* 470.4* 470.5* )
fi
# 5.16
if (( $(vercmp "$_kernel" "5.16") >= 0 )); then
_kernel516="1"
_whitelist516=( 470.8* 495*)
fi
# Loop patches (linux-4.15.patch, lol.patch, ...)
for _p in $(printf -- '%s\n' ${source[@]} | grep .patch); do # https://stackoverflow.com/a/21058239/1821548
# Patch version (4.15, "", ...)
@ -706,6 +714,10 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf
_whitelist=(${_whitelist514[@]})
fi
if [ "$_patch" = "5.16" ]; then
_whitelist=(${_whitelist516[@]})
fi
patchy=0
if (( $(vercmp "$_kernel" "$_patch") >= 0 )); then
for yup in "${_whitelist[@]}"; do
@ -1005,6 +1017,19 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf
fi
fi
if [ "$_kernel516" = "1" ]; then
patchy=0
for yup in "${_whitelist516[@]}"; do
[[ $pkgver = $yup ]] && patchy=1
done
if [ "$patchy" = "1" ]; then
msg2 "Applying kernel-5.16.patch for dkms..."
patch -Np1 -i "$srcdir"/kernel-5.16.patch
else
msg2 "Skipping kernel-5.16.patch as it doesn't apply to this driver version..."
fi
fi
# Legacy quirks
if [ "$_oldstuff" = "1" ]; then
msg2 "Applying 01-ipmi-vm.diff for dkms..."

@ -0,0 +1,13 @@
--- a/kernel-dkms/nvidia-uvm/uvm_migrate_pageable.c 2021-10-22 08:48:04.000000000 +0200
+++ b/kernel-dkms/nvidia-uvm/uvm_migrate_pageable_b.c 2021-11-29 17:50:22.467621809 +0100
@@ -336,6 +336,10 @@
return dst_page;
}
+#ifndef MIGRATE_PFN_LOCKED
+#define MIGRATE_PFN_LOCKED 0
+#endif
+
static NV_STATUS migrate_vma_populate_anon_pages(struct vm_area_struct *vma,
unsigned long *dst,
unsigned long start,
Loading…
Cancel
Save