diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2021-03-19 12:06:52 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-04-03 12:22:19 +0200 |
commit | 7c11f8893a76ac4e86c07f4b57371d5fa593627f (patch) | |
tree | b256156cad71c8d33765dd476af0a4e9ed91f1e2 /arch/powerpc/kernel/signal.h | |
parent | powerpc/uaccess: Also perform 64 bits copies in unsafe_copy_from_user() on ppc32 (diff) | |
download | linux-7c11f8893a76ac4e86c07f4b57371d5fa593627f.tar.xz linux-7c11f8893a76ac4e86c07f4b57371d5fa593627f.zip |
powerpc/signal: Add unsafe_copy_ck{fpr/vsx}_from_user
Add unsafe_copy_ckfpr_from_user() and unsafe_copy_ckvsx_from_user()
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1040687aa27553d19f749f7fb48f0c07af98ee2d.1616151715.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel/signal.h')
-rw-r--r-- | arch/powerpc/kernel/signal.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h index 1393876f3814..a5152ff3c52f 100644 --- a/arch/powerpc/kernel/signal.h +++ b/arch/powerpc/kernel/signal.h @@ -100,6 +100,26 @@ unsigned long copy_ckfpr_from_user(struct task_struct *task, void __user *from); unsafe_put_user(__t->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET], \ &buf[i], label);\ } while (0) + +#define unsafe_copy_ckfpr_from_user(task, from, label) do { \ + struct task_struct *__t = task; \ + u64 __user *buf = (u64 __user *)from; \ + int i; \ + \ + for (i = 0; i < ELF_NFPREG - 1 ; i++) \ + unsafe_get_user(__t->thread.TS_CKFPR(i), &buf[i], label);\ + unsafe_get_user(__t->thread.ckfp_state.fpscr, &buf[i], failed); \ +} while (0) + +#define unsafe_copy_ckvsx_from_user(task, from, label) do { \ + struct task_struct *__t = task; \ + u64 __user *buf = (u64 __user *)from; \ + int i; \ + \ + for (i = 0; i < ELF_NVSRHALFREG ; i++) \ + unsafe_get_user(__t->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET], \ + &buf[i], label); \ +} while (0) #endif #elif defined(CONFIG_PPC_FPU_REGS) |