From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Scott Wood <oss@buserror.net>, Nicholas Piggin <npiggin@gmail.com>
Subject: [PATCH 06/10] powerpc/64e/interrupt: Use new interrupt context tracking scheme
Date: Mon, 15 Mar 2021 13:17:12 +1000 [thread overview]
Message-ID: <20210315031716.3940350-7-npiggin@gmail.com> (raw)
In-Reply-To: <20210315031716.3940350-1-npiggin@gmail.com>
With the new interrupt exit code, context tracking can be managed
more precisely, so remove the last of the 64e workarounds and switch
to the new context tracking code already used by 64s.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/include/asm/interrupt.h | 28 ----------------------------
arch/powerpc/kernel/interrupt.c | 12 ------------
2 files changed, 40 deletions(-)
diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
index 29b48d083156..94fd8e1ff52c 100644
--- a/arch/powerpc/include/asm/interrupt.h
+++ b/arch/powerpc/include/asm/interrupt.h
@@ -10,9 +10,6 @@
#include <asm/runlatch.h>
struct interrupt_state {
-#ifdef CONFIG_PPC_BOOK3E_64
- enum ctx_state ctx_state;
-#endif
};
static inline void booke_restore_dbcr0(void)
@@ -45,9 +42,7 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
if (irq_soft_mask_set_return(IRQS_ALL_DISABLED) == IRQS_ENABLED)
trace_hardirqs_off();
local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
-#endif
-#ifdef CONFIG_PPC_BOOK3S_64
if (user_mode(regs)) {
CT_WARN_ON(ct_state() != CONTEXT_USER);
user_exit_irqoff();
@@ -64,12 +59,6 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
}
#endif
-#ifdef CONFIG_PPC_BOOK3E_64
- state->ctx_state = exception_enter();
- if (user_mode(regs))
- account_cpu_user_entry();
-#endif
-
booke_restore_dbcr0();
}
@@ -89,25 +78,8 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
*/
static inline void interrupt_exit_prepare(struct pt_regs *regs, struct interrupt_state *state)
{
-#ifdef CONFIG_PPC_BOOK3E_64
- exception_exit(state->ctx_state);
-#endif
-
if (user_mode(regs))
kuep_unlock();
- /*
- * Book3S exits to user via interrupt_exit_user_prepare(), which does
- * context tracking, which is a cleaner way to handle PREEMPT=y
- * and avoid context entry/exit in e.g., preempt_schedule_irq()),
- * which is likely to be where the core code wants to end up.
- *
- * The above comment explains why we can't do the
- *
- * if (user_mode(regs))
- * user_exit_irqoff();
- *
- * sequence here.
- */
}
static inline void interrupt_async_enter_prepare(struct pt_regs *regs, struct interrupt_state *state)
diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index ae7b058b2970..2a017d98973a 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -235,10 +235,6 @@ static notrace void booke_load_dbcr0(void)
#endif
}
-/* temporary hack for context tracking, removed in later patch */
-#include <linux/sched/debug.h>
-asmlinkage __visible void __sched schedule_user(void);
-
/*
* This should be called after a syscall returns, with r3 the return value
* from the syscall. If this function returns non-zero, the system call
@@ -296,11 +292,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) {
local_irq_enable();
if (ti_flags & _TIF_NEED_RESCHED) {
-#ifdef CONFIG_PPC_BOOK3E_64
- schedule_user();
-#else
schedule();
-#endif
} else {
/*
* SIGPENDING must restore signal handler function
@@ -396,11 +388,7 @@ notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned
while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) {
local_irq_enable(); /* returning to user: may enable */
if (ti_flags & _TIF_NEED_RESCHED) {
-#ifdef CONFIG_PPC_BOOK3E_64
- schedule_user();
-#else
schedule();
-#endif
} else {
if (ti_flags & _TIF_SIGPENDING)
ret |= _TIF_RESTOREALL;
--
2.23.0
next prev parent reply other threads:[~2021-03-15 3:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 3:17 [PATCH 00/10] Move 64e to new interrupt return code Nicholas Piggin
2021-03-15 3:17 ` [PATCH 01/10] powerpc/syscall: switch user_exit_irqoff and trace_hardirqs_off order Nicholas Piggin
2021-03-15 3:17 ` [PATCH 02/10] powerpc/64e/interrupt: always save nvgprs on interrupt Nicholas Piggin
2021-03-15 3:17 ` [PATCH 03/10] powerpc/64e/interrupt: use new interrupt return Nicholas Piggin
2021-03-15 7:50 ` Christophe Leroy
2021-03-15 8:20 ` Christophe Leroy
2021-03-16 7:03 ` Nicholas Piggin
2021-03-15 13:30 ` Christophe Leroy
2021-03-16 7:04 ` Nicholas Piggin
2021-03-16 7:25 ` Nicholas Piggin
2021-03-16 7:29 ` Christophe Leroy
2021-03-16 8:14 ` Nicholas Piggin
2021-03-15 3:17 ` [PATCH 04/10] powerpc/64e/interrupt: NMI save irq soft-mask state in C Nicholas Piggin
2021-03-15 3:17 ` [PATCH 05/10] powerpc/64e/interrupt: reconcile " Nicholas Piggin
2021-03-15 3:17 ` Nicholas Piggin [this message]
2021-03-15 3:17 ` [PATCH 07/10] powerpc/64e/interrupt: handle bad_page_fault " Nicholas Piggin
2021-03-15 14:07 ` Christophe Leroy
2021-03-16 7:06 ` Nicholas Piggin
2021-03-15 3:17 ` [PATCH 08/10] powerpc: clean up do_page_fault Nicholas Piggin
2021-03-15 3:17 ` [PATCH 09/10] powerpc: remove partial register save logic Nicholas Piggin
2021-03-15 3:17 ` [PATCH 10/10] powerpc: move norestart trap flag to bit 0 Nicholas Piggin
2021-03-15 8:14 ` Christophe Leroy
2021-03-16 7:11 ` Nicholas Piggin
2021-03-16 7:13 ` Christophe Leroy
2021-03-22 23:45 ` [PATCH 00/10] Move 64e to new interrupt return code Daniel Axtens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315031716.3940350-7-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oss@buserror.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).