linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/7] Move 64e to new interrupt return code
@ 2021-03-08  9:52 Nicholas Piggin
  2021-03-08  9:52 ` [PATCH] powerpc: fix inverted SET_FULL_REGS bitop Nicholas Piggin
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Nicholas Piggin @ 2021-03-08  9:52 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin

Time to finally try removing the remaining old cruft left over
from the big interrupt return rewrite in C.

This series will clash lightly with Christophe's one to switch
ppc32 over. His should go in first because it's a lot bigger
and more mature at this stage. I will rebase this series on top
of his at some point but at the moment it's just based on upstream.

Patch 1 should go in as a fix, patch 5 is not required for this
series I'll drop it from non-rfc series and send it separately (it's
not tested at the moment).

Thanks,
Nick

Nicholas Piggin (7):
  powerpc/syscall: switch user_exit_irqoff and trace_hardirqs_off order
  powerpc/64e/interrupt: always save nvgprs on interrupt
  powerpc/64e/interrupt: use new interrupt return
  powerpc/64e/interrupt: reconcile irq soft-mask state in C
  KVM: PPC: Remove RECONCILE_IRQ_STATE from guest exit
  powerpc/64e/interrupt: handle bad_page_fault in C
  powerpc/64e/interrupt: Use new interrupt context tracking scheme

 arch/powerpc/include/asm/asm-prototypes.h |   2 -
 arch/powerpc/include/asm/interrupt.h      |  31 +-
 arch/powerpc/include/asm/irqflags.h       |  58 ----
 arch/powerpc/include/asm/kvm_ppc.h        |  22 --
 arch/powerpc/include/asm/ptrace.h         |   9 +-
 arch/powerpc/kernel/entry_64.S            |  40 +--
 arch/powerpc/kernel/exceptions-64e.S      | 394 ++--------------------
 arch/powerpc/kernel/interrupt.c           |  18 +-
 arch/powerpc/kernel/irq.c                 |  76 -----
 arch/powerpc/kvm/book3s_pr.c              |   8 +-
 arch/powerpc/kvm/booke.c                  |   9 +-
 arch/powerpc/kvm/bookehv_interrupts.S     |   9 -
 arch/powerpc/mm/fault.c                   |   4 +-
 13 files changed, 69 insertions(+), 611 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH] powerpc: fix inverted SET_FULL_REGS bitop
@ 2021-03-08  8:55 Nicholas Piggin
  2021-03-14 10:01 ` Michael Ellerman
  0 siblings, 1 reply; 11+ messages in thread
From: Nicholas Piggin @ 2021-03-08  8:55 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin

This bit operation was inverted and set the low bit rather than cleared
it, breaking the ability to ptrace non-volatile GPRs after exec. Fix.

Fixes: feb9df3462e68 ("powerpc/64s: Always has full regs, so remove remnant checks")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
Well this is embarrassing. Condition flags should be represented by the
bit set, rather than bit clear. That would have made the mistake obvious
even at a glance.

In this case, this stuff is going away soon so I won't bother to change
it around.

Thanks,
Nick

 arch/powerpc/include/asm/ptrace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index 975ba260006a..1499e928ea6a 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -195,7 +195,7 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc)
 #define TRAP_FLAGS_MASK		0x11
 #define TRAP(regs)		((regs)->trap & ~TRAP_FLAGS_MASK)
 #define FULL_REGS(regs)		(((regs)->trap & 1) == 0)
-#define SET_FULL_REGS(regs)	((regs)->trap |= 1)
+#define SET_FULL_REGS(regs)	((regs)->trap &= ~1)
 #endif
 #define CHECK_FULL_REGS(regs)	BUG_ON(!FULL_REGS(regs))
 #define NV_REG_POISON		0xdeadbeefdeadbeefUL
@@ -210,7 +210,7 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc)
 #define TRAP_FLAGS_MASK		0x1F
 #define TRAP(regs)		((regs)->trap & ~TRAP_FLAGS_MASK)
 #define FULL_REGS(regs)		(((regs)->trap & 1) == 0)
-#define SET_FULL_REGS(regs)	((regs)->trap |= 1)
+#define SET_FULL_REGS(regs)	((regs)->trap &= ~1)
 #define IS_CRITICAL_EXC(regs)	(((regs)->trap & 2) != 0)
 #define IS_MCHECK_EXC(regs)	(((regs)->trap & 4) != 0)
 #define IS_DEBUG_EXC(regs)	(((regs)->trap & 8) != 0)
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-03-14 10:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-08  9:52 [RFC PATCH 0/7] Move 64e to new interrupt return code Nicholas Piggin
2021-03-08  9:52 ` [PATCH] powerpc: fix inverted SET_FULL_REGS bitop Nicholas Piggin
2021-03-08  9:52 ` [RFC PATCH 1/7] powerpc/syscall: switch user_exit_irqoff and trace_hardirqs_off order Nicholas Piggin
2021-03-08  9:52 ` [RFC PATCH 2/7] powerpc/64e/interrupt: always save nvgprs on interrupt Nicholas Piggin
2021-03-08  9:52 ` [RFC PATCH 3/7] powerpc/64e/interrupt: use new interrupt return Nicholas Piggin
2021-03-08  9:52 ` [RFC PATCH 4/7] powerpc/64e/interrupt: reconcile irq soft-mask state in C Nicholas Piggin
2021-03-08  9:52 ` [RFC PATCH 5/7] KVM: PPC: Remove RECONCILE_IRQ_STATE from guest exit Nicholas Piggin
2021-03-08  9:52 ` [RFC PATCH 6/7] powerpc/64e/interrupt: handle bad_page_fault in C Nicholas Piggin
2021-03-08  9:52 ` [RFC PATCH 7/7] powerpc/64e/interrupt: Use new interrupt context tracking scheme Nicholas Piggin
  -- strict thread matches above, loose matches on Subject: below --
2021-03-08  8:55 [PATCH] powerpc: fix inverted SET_FULL_REGS bitop Nicholas Piggin
2021-03-14 10:01 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).