summaryrefslogtreecommitdiffstats
path: root/mpss-modules-4.4.patch
blob: 79c02e33d85ad8491b4999d276982f5972f6c454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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);