Since commit ("1bd79336a426 powerpc: Fix various
syscall/signal/swapcontext bugs"), getting save_general_regs() called
without FULL_REGS() is very unlikely and generates a warning.
The 32-bit version of save_general_regs() doesn't take care of it
at all and copies all registers anyway since that commit.
Moreover, commit 965dd3ad3076 ("powerpc/64/syscall: Remove
non-volatile GPR save optimisation") is another reason why it would
never happen.
So the same with 64-bit, don't worry about FULL_REGS() and copy
all registers all the time.
Signed-off-by: Christophe Leroy <redacted>
---
arch/powerpc/kernel/signal_32.c | 2 --
1 file changed, 2 deletions(-)
save_general_regs() which does special handling when i == PT_SOFTE.
Rewrite it to minimise the specific part, especially the __put_user()
and associated error handling is the same so make it common.
Signed-off-by: Christophe Leroy <redacted>
---
arch/powerpc/kernel/signal_32.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
@@ -103,19 +103,14 @@ static inline int save_general_regs(struct pt_regs *regs,{elf_greg_t64*gregs=(elf_greg_t64*)regs;inti;-/* Force usr to alway see softe as 1 (interrupts enabled) */-elf_greg_t64softe=0x1;WARN_ON(!FULL_REGS(regs));for(i=0;i<=PT_RESULT;i++){-if(i==PT_SOFTE){-if(__put_user((unsignedint)softe,&frame->mc_gregs[i]))-return-EFAULT;-else-continue;-}-if(__put_user((unsignedint)gregs[i],&frame->mc_gregs[i]))+/* Force usr to alway see softe as 1 (interrupts enabled) */+intval=(i==PT_SOFTE)?1:gregs[i];++if(__put_user(val,&frame->mc_gregs[i]))return-EFAULT;}return0;
Since commit ("1bd79336a426 powerpc: Fix various
syscall/signal/swapcontext bugs"), getting save_general_regs() called
without FULL_REGS() is very unlikely and generates a warning.
The 32-bit version of save_general_regs() doesn't take care of it
at all and copies all registers anyway since that commit.
[...]