diff options
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0094-Adjust-to-another-change-in-the-user-page-API.patch')
| -rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0094-Adjust-to-another-change-in-the-user-page-API.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0094-Adjust-to-another-change-in-the-user-page-API.patch b/recipes-kernel/cryptodev/sdk_patches/0094-Adjust-to-another-change-in-the-user-page-API.patch new file mode 100644 index 000000000..9483d0c64 --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0094-Adjust-to-another-change-in-the-user-page-API.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | From b7783948df06674da12352ff4f55c6e7c4213026 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Michael Weiser <michael.weiser@gmx.de> | ||
| 3 | Date: Fri, 11 Nov 2016 18:09:32 +0100 | ||
| 4 | Subject: [PATCH 094/104] Adjust to another change in the user page API | ||
| 5 | |||
| 6 | 4.9.0 will replace the write and force flags of get_user_pages_remote() | ||
| 7 | with a gup_flags parameter[1]. Distinguish the two APIs based on kernel | ||
| 8 | version we're compiling for. | ||
| 9 | |||
| 10 | [1] https://github.com/torvalds/linux/commit/9beae1ea89305a9667ceaab6d0bf46a045ad71e7 | ||
| 11 | --- | ||
| 12 | zc.c | 8 +++++++- | ||
| 13 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/zc.c b/zc.c | ||
| 16 | index a97b49f..e766ee3 100644 | ||
| 17 | --- a/zc.c | ||
| 18 | +++ b/zc.c | ||
| 19 | @@ -65,7 +65,13 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, | ||
| 20 | ret = get_user_pages( | ||
| 21 | #endif | ||
| 22 | task, mm, | ||
| 23 | - (unsigned long)addr, pgcount, write, 0, pg, NULL); | ||
| 24 | + (unsigned long)addr, pgcount, | ||
| 25 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) | ||
| 26 | + write ? FOLL_WRITE : 0, | ||
| 27 | +#else | ||
| 28 | + write, 0, | ||
| 29 | +#endif | ||
| 30 | + pg, NULL); | ||
| 31 | up_read(&mm->mmap_sem); | ||
| 32 | if (ret != pgcount) | ||
| 33 | return -EINVAL; | ||
| 34 | -- | ||
| 35 | 2.10.2 | ||
| 36 | |||
