From 856bf072ed0fe839360e7eec28feaa2bddcf40a8 Mon Sep 17 00:00:00 2001 From: Aaron Taylor Date: Wed, 28 Apr 2021 17:05:17 -0700 Subject: [PATCH] Updated host/tools_support.c for new get_user_pages() function. At some point the function prototype changed from this: long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, int write, int force, struct page **pages, struct vm_area_struct **vmas); into this: long get_user_pages(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas); With the individual 'write' and 'force' flags transforming into gup_flags per this patch: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20161013002020.3062-7-lstoakes@gmail.com/ --- host/tools_support.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/tools_support.c b/host/tools_support.c index 49d37d4..38d6c21 100644 --- a/host/tools_support.c +++ b/host/tools_support.c @@ -89,8 +89,8 @@ mic_pin_user_pages (void *data, struct page **pages, uint32_t len, int32_t *nf_p // pin the user pages; use semaphores on linux for doing the same down_read(¤t->mm->mmap_sem); - *nf_pages = (int32_t)get_user_pages(current, current->mm, (uint64_t)data, - nr_pages, PROT_WRITE, 1, pages, NULL); + *nf_pages = (int32_t)get_user_pages((uint64_t)data, nr_pages, + (FOLL_WRITE | FOLL_FORCE), pages, NULL); up_read(¤t->mm->mmap_sem); // compare if the no of final pages is equal to no of requested pages -- 2.20.1