summaryrefslogtreecommitdiffstats
path: root/mpss-modules-4.4.patch
diff options
context:
space:
mode:
Diffstat (limited to 'mpss-modules-4.4.patch')
-rw-r--r--mpss-modules-4.4.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/mpss-modules-4.4.patch b/mpss-modules-4.4.patch
new file mode 100644
index 0000000..79c02e3
--- /dev/null
+++ b/mpss-modules-4.4.patch
@@ -0,0 +1,39 @@
+diff -ur mpss-modules-3.8.6/host/tools_support.c mpss-modules-3.8.6.patched.4.4/host/tools_support.c
+--- mpss-modules-3.8.6/host/tools_support.c 2019-07-01 22:45:06.000000000 +0200
++++ mpss-modules-3.8.6.patched.4.4/host/tools_support.c 2021-01-20 23:36:28.705203711 +0100
+@@ -89,8 +89,13 @@
+
+ // pin the user pages; use semaphores on linux for doing the same
+ down_read(&current->mm->mmap_sem);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,168)
++ *nf_pages = (int32_t)get_user_pages(current, current->mm, (uint64_t)data,
++ nr_pages, FOLL_WRITE|FOLL_FORCE, pages, NULL);
++#else
+ *nf_pages = (int32_t)get_user_pages(current, current->mm, (uint64_t)data,
+ nr_pages, PROT_WRITE, 1, pages, NULL);
++#endif
+ up_read(&current->mm->mmap_sem);
+
+ // compare if the no of final pages is equal to no of requested pages
+diff -ur mpss-modules-3.8.6/micscif/micscif_api.c mpss-modules-3.8.6.patched.4.4/micscif/micscif_api.c
+--- mpss-modules-3.8.6/micscif/micscif_api.c 2019-07-01 22:45:06.000000000 +0200
++++ mpss-modules-3.8.6.patched.4.4/micscif/micscif_api.c 2021-01-20 23:36:28.702203741 +0100
+@@ -1980,14 +1980,17 @@
+ goto error_unmap;
+ }
+ }
+-
+ pinned_pages->nr_pages = get_user_pages(
+ current,
+ mm,
+ (uint64_t)addr,
+ nr_pages,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,168)
++ (prot & SCIF_PROT_WRITE) ? FOLL_WRITE : 0,
++#else
+ !!(prot & SCIF_PROT_WRITE),
+ 0,
++#endif
+ pinned_pages->pages,
+ pinned_pages->vma);
+ up_write(&mm->mmap_sem);