diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2021-03-19 14:06:51 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-04-03 13:22:18 +0300 |
commit | c1cc1570bc8d94f288060f262f11be8f7672578c (patch) | |
tree | bc35d0fb0fbd327de71f24247429da77af53966c /arch/powerpc/include/asm/uaccess.h | |
parent | fb05121fd6a20f0830ff2a4420c51af6ca4ac6e7 (diff) | |
download | linux-c1cc1570bc8d94f288060f262f11be8f7672578c.tar.xz |
powerpc/uaccess: Also perform 64 bits copies in unsafe_copy_from_user() on ppc32
Similarly to commit 5cf773fc8f37 ("powerpc/uaccess: Also perform
64 bits copies in unsafe_copy_to_user() on ppc32")
ppc32 has an efficiant 64 bits unsafe_get_user(), so also use it in
order to unroll loops more.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/308e65d9237a14e8c0e3b22919fcf0b5e5592608.1616151715.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/include/asm/uaccess.h')
-rw-r--r-- | arch/powerpc/include/asm/uaccess.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 77d837b16e4d..a4e791bcd3fe 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -432,9 +432,9 @@ do { \ size_t _len = (l); \ int _i; \ \ - for (_i = 0; _i < (_len & ~(sizeof(long) - 1)); _i += sizeof(long)) \ - unsafe_get_user(*(long *)(_dst + _i), (long __user *)(_src + _i), e); \ - if (IS_ENABLED(CONFIG_PPC64) && (_len & 4)) { \ + for (_i = 0; _i < (_len & ~(sizeof(u64) - 1)); _i += sizeof(u64)) \ + unsafe_get_user(*(u64 *)(_dst + _i), (u64 __user *)(_src + _i), e); \ + if (_len & 4) { \ unsafe_get_user(*(u32 *)(_dst + _i), (u32 __user *)(_src + _i), e); \ _i += 4; \ } \ |