commit 1285a7846f3f3e0cabd157e4c2935599d1faf252
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Fri May 3 16:02:01 2019 +0100
Fix the i686 trash
kernel-5.1.patch => kernel-5.1_pt1.patch | 44 --------------------------------
kernel-5.1_pt2.patch | 44 ++++++++++++++++++++++++++++++++
nvidia-390xx-kmod.spec | 6 ++++-
3 files changed, 49 insertions(+), 45 deletions(-)
---
diff --git a/kernel-5.1.patch b/kernel-5.1_pt1.patch
similarity index 72%
rename from kernel-5.1.patch
rename to kernel-5.1_pt1.patch
index d1f6a63..31c2db7 100644
--- a/kernel-5.1.patch
+++ b/kernel-5.1_pt1.patch
@@ -116,47 +116,3 @@
{
return list->prev == head;
}
---- a/kernel/nvidia-uvm/uvm8.c
-+++ b/kernel/nvidia-uvm/uvm8.c
-@@ -172,7 +172,11 @@ static int uvm_vm_fault_sigbus(struct vm
- return VM_FAULT_SIGBUS;
- }
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
- static int uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
-+#else
-+static vm_fault_t uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
-+#endif
- {
- #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
- return uvm_vm_fault_sigbus(vmf->vma, vmf);
-@@ -507,7 +511,11 @@ convert_error:
- }
- }
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
- static int uvm_vm_fault_wrapper(struct vm_fault *vmf)
-+#else
-+static vm_fault_t uvm_vm_fault_wrapper(struct vm_fault *vmf)
-+#endif
- {
- #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
- return uvm_vm_fault(vmf->vma, vmf);
---- a/kernel/nvidia-uvm/uvm8_range_tree.c
-+++ b/kernel/nvidia-uvm/uvm8_range_tree.c
-@@ -31,9 +31,15 @@ static uvm_range_tree_node_t *get_range_node(struct rb_node *rb_node)
-
- uvm_range_tree_node_t *uvm_range_tree_prev(uvm_range_tree_t *tree, uvm_range_tree_node_t
*node)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
- if (list_is_first(&node->list, &tree->head))
- return NULL;
- return list_prev_entry(node, list);
-+#else
-+ if (nv_list_is_first(&node->list, &tree->head))
-+ return NULL;
-+ return list_prev_entry(node, list);
-+#endif
- }
-
- uvm_range_tree_node_t *uvm_range_tree_next(uvm_range_tree_t *tree, uvm_range_tree_node_t
*node)
diff --git a/kernel-5.1_pt2.patch b/kernel-5.1_pt2.patch
new file mode 100644
index 0000000..f3d9ea5
--- /dev/null
+++ b/kernel-5.1_pt2.patch
@@ -0,0 +1,44 @@
+--- a/kernel/nvidia-uvm/uvm8.c
++++ b/kernel/nvidia-uvm/uvm8.c
+@@ -172,7 +172,11 @@ static int uvm_vm_fault_sigbus(struct vm
+ return VM_FAULT_SIGBUS;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
+ static int uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
++#else
++static vm_fault_t uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
++#endif
+ {
+ #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
+ return uvm_vm_fault_sigbus(vmf->vma, vmf);
+@@ -507,7 +511,11 @@ convert_error:
+ }
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
+ static int uvm_vm_fault_wrapper(struct vm_fault *vmf)
++#else
++static vm_fault_t uvm_vm_fault_wrapper(struct vm_fault *vmf)
++#endif
+ {
+ #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
+ return uvm_vm_fault(vmf->vma, vmf);
+--- a/kernel/nvidia-uvm/uvm8_range_tree.c
++++ b/kernel/nvidia-uvm/uvm8_range_tree.c
+@@ -31,9 +31,15 @@ static uvm_range_tree_node_t *get_range_node(struct rb_node *rb_node)
+
+ uvm_range_tree_node_t *uvm_range_tree_prev(uvm_range_tree_t *tree, uvm_range_tree_node_t
*node)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
+ if (list_is_first(&node->list, &tree->head))
+ return NULL;
+ return list_prev_entry(node, list);
++#else
++ if (nv_list_is_first(&node->list, &tree->head))
++ return NULL;
++ return list_prev_entry(node, list);
++#endif
+ }
+
+ uvm_range_tree_node_t *uvm_range_tree_next(uvm_range_tree_t *tree, uvm_range_tree_node_t
*node)
diff --git a/nvidia-390xx-kmod.spec b/nvidia-390xx-kmod.spec
index aa59a3d..a54c072 100644
--- a/nvidia-390xx-kmod.spec
+++ b/nvidia-390xx-kmod.spec
@@ -19,7 +19,8 @@ URL:
http://www.nvidia.com/
Source11: nvidia-390xx-kmodtool-excludekernel-filterfile
Patch0: nv-linux-arm.patch
Patch1: nv-linux-arm2.patch
-Patch2: kernel-5.1.patch
+Patch2: kernel-5.1_pt1.patch
+Patch3: kernel-5.1_pt2.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64 armv7hl
@@ -46,6 +47,9 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%ifarch x86_64
+%patch3 -p1
+%endif
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}