Commit feb9df34 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/64s: Always has full regs, so remove remnant checks

Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200507121332.2233629-1-mpe@ellerman.id.au
parent edbadaf0
...@@ -179,6 +179,20 @@ extern int ptrace_put_reg(struct task_struct *task, int regno, ...@@ -179,6 +179,20 @@ extern int ptrace_put_reg(struct task_struct *task, int regno,
#define current_pt_regs() \ #define current_pt_regs() \
((struct pt_regs *)((unsigned long)task_stack_page(current) + THREAD_SIZE) - 1) ((struct pt_regs *)((unsigned long)task_stack_page(current) + THREAD_SIZE) - 1)
#ifdef __powerpc64__
#ifdef CONFIG_PPC_BOOK3S
#define TRAP(regs) ((regs)->trap)
#define FULL_REGS(regs) true
#define SET_FULL_REGS(regs) do { } while (0)
#else
#define TRAP(regs) ((regs)->trap & ~0x1)
#define FULL_REGS(regs) (((regs)->trap & 1) == 0)
#define SET_FULL_REGS(regs) ((regs)->trap |= 1)
#endif
#define CHECK_FULL_REGS(regs) BUG_ON(!FULL_REGS(regs))
#define NV_REG_POISON 0xdeadbeefdeadbeefUL
#else
/* /*
* We use the least-significant bit of the trap field to indicate * We use the least-significant bit of the trap field to indicate
* whether we have saved the full set of registers, or only a * whether we have saved the full set of registers, or only a
...@@ -186,17 +200,12 @@ extern int ptrace_put_reg(struct task_struct *task, int regno, ...@@ -186,17 +200,12 @@ extern int ptrace_put_reg(struct task_struct *task, int regno,
* On 4xx we use the next bit to indicate whether the exception * On 4xx we use the next bit to indicate whether the exception
* is a critical exception (1 means it is). * is a critical exception (1 means it is).
*/ */
#define TRAP(regs) ((regs)->trap & ~0xF)
#define FULL_REGS(regs) (((regs)->trap & 1) == 0) #define FULL_REGS(regs) (((regs)->trap & 1) == 0)
#ifndef __powerpc64__ #define SET_FULL_REGS(regs) ((regs)->trap |= 1)
#define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) != 0) #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) != 0)
#define IS_MCHECK_EXC(regs) (((regs)->trap & 4) != 0) #define IS_MCHECK_EXC(regs) (((regs)->trap & 4) != 0)
#define IS_DEBUG_EXC(regs) (((regs)->trap & 8) != 0) #define IS_DEBUG_EXC(regs) (((regs)->trap & 8) != 0)
#endif /* ! __powerpc64__ */
#define TRAP(regs) ((regs)->trap & ~0xF)
#ifdef __powerpc64__
#define NV_REG_POISON 0xdeadbeefdeadbeefUL
#define CHECK_FULL_REGS(regs) BUG_ON(regs->trap & 1)
#else
#define NV_REG_POISON 0xdeadbeef #define NV_REG_POISON 0xdeadbeef
#define CHECK_FULL_REGS(regs) \ #define CHECK_FULL_REGS(regs) \
do { \ do { \
......
...@@ -1720,7 +1720,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) ...@@ -1720,7 +1720,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
* FULL_REGS(regs) return true. This is necessary to allow * FULL_REGS(regs) return true. This is necessary to allow
* ptrace to examine the thread immediately after exec. * ptrace to examine the thread immediately after exec.
*/ */
regs->trap &= ~1UL; SET_FULL_REGS(regs);
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
regs->mq = 0; regs->mq = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment