powerpc: Hard wire PT_SOFTE value to 1 in ptrace & signals
We have always had softe in pt_regs, and accessible via PT_SOFTE, even though it is not userspace state. The value userspace sees should always be 1, because we should never be in userspace with interrupts soft disabled. In a subsequent patch we will be changing the semantics of the kernel softe value, so hard wire the value to 1 to retain the existing semantics. As far as we know nothing ever looks at it, but better safe than sorry. Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> [mpe: Split out of larger patch, write change log] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
committed by
Michael Ellerman
parent
7a074fc083
commit
a8a4b03ab9
@@ -111,12 +111,20 @@ static inline int save_general_regs(struct pt_regs *regs,
|
||||
{
|
||||
elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
|
||||
int i;
|
||||
/* Force usr to alway see softe as 1 (interrupts enabled) */
|
||||
elf_greg_t64 softe = 0x1;
|
||||
|
||||
WARN_ON(!FULL_REGS(regs));
|
||||
|
||||
for (i = 0; i <= PT_RESULT; i ++) {
|
||||
if (i == 14 && !FULL_REGS(regs))
|
||||
i = 32;
|
||||
if ( i == PT_SOFTE) {
|
||||
if(__put_user((unsigned int)softe, &frame->mc_gregs[i]))
|
||||
return -EFAULT;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
if (__put_user((unsigned int)gregs[i], &frame->mc_gregs[i]))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user