diff options
Diffstat (limited to 'testing/zfs-src/4900-ppc-get-user-workaround.patch')
-rw-r--r-- | testing/zfs-src/4900-ppc-get-user-workaround.patch | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/testing/zfs-src/4900-ppc-get-user-workaround.patch b/testing/zfs-src/4900-ppc-get-user-workaround.patch deleted file mode 100644 index aa7c0c703b2..00000000000 --- a/testing/zfs-src/4900-ppc-get-user-workaround.patch +++ /dev/null @@ -1,60 +0,0 @@ -Description: PPC get_user workaround - Linux 5.12 PPC 5.12 get_user() and __copy_from_user_inatomic() - inline helpers very indirecly include a reference to the GPL'd - array mmu_feature_keys[] and fails to build. Workaround this by - using copy_from_user() and throwing EFAULT for any calls to - __copy_from_user_inatomic(). This is a workaround until a fix - for Linux commit 7613f5a66becfd0e43a0f34de8518695888f5458 - "powerpc/64s/kuap: Use mmu_has_feature()" is fully addressed. -Author: Colin Ian King <colin.king@canonical.com> -Origin: ubuntu -Forwarded: no -Last-Update: 2021-04-28 - -Index: zfs-linux-2.0.3/module/os/linux/zfs/zfs_uio.c -=================================================================== ---- zfs-linux-2.0.3.orig/module/os/linux/zfs/zfs_uio.c -+++ zfs-linux-2.0.3/module/os/linux/zfs/zfs_uio.c -@@ -47,6 +47,7 @@ - #include <sys/strings.h> - #include <linux/kmap_compat.h> - #include <linux/uaccess.h> -+#include <linux/printk.h> - - /* - * Move "n" bytes at byte address "p"; "rw" indicates the direction -@@ -79,11 +80,16 @@ uiomove_iov(void *p, size_t n, enum uio_ - (iov->iov_base + skip), cnt)) { - return (EFAULT); - } -+#if defined(__PPC64__) -+ printk_ratelimited(KERN_ERR "uiomove_iov(): __copy_from_user_inatomic() not available to ZFS\n"); -+ return (EFAULT); -+#else - pagefault_disable(); - b_left = - __copy_from_user_inatomic(p, - (iov->iov_base + skip), cnt); - pagefault_enable(); -+#endif - } else { - b_left = - copy_from_user(p, -@@ -248,7 +254,7 @@ uio_prefaultpages(ssize_t n, struct uio - /* touch each page in this segment. */ - p = iov->iov_base + skip; - while (cnt) { -- if (get_user(tmp, (uint8_t *)p)) -+ if (copy_from_user(&tmp, p, 1)) - return (EFAULT); - ulong_t incr = MIN(cnt, PAGESIZE); - p += incr; -@@ -256,7 +262,7 @@ uio_prefaultpages(ssize_t n, struct uio - } - /* touch the last byte in case it straddles a page. */ - p--; -- if (get_user(tmp, (uint8_t *)p)) -+ if (copy_from_user(&tmp, p, 1)) - return (EFAULT); - } - } |