LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Christophe Leroy <christophe.leroy@c-s.fr>,
Michael Ellerman <mpe@ellerman.id.au>,
msuchanek@suse.de, Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH v3 05/15] powerpc/irq: Add helpers to get and set regs->softe
Date: Tue, 07 Apr 2020 10:50:20 +1000 [thread overview]
Message-ID: <1586219567.cl8bye6kgu.astroid@bobo.none> (raw)
In-Reply-To: <f9f0bd58f9e75e8e3826f25d9db9ff2c6ad9c84b.1586196948.git.christophe.leroy@c-s.fr>
Christophe Leroy's on April 7, 2020 4:16 am:
> regs->softe doesn't exist on PPC32.
>
> Add helpers to get and set regs->softe.
> Those helpers will void on PPC32.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> arch/powerpc/include/asm/hw_irq.h | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
> index e0e71777961f..e69466867d5f 100644
> --- a/arch/powerpc/include/asm/hw_irq.h
> +++ b/arch/powerpc/include/asm/hw_irq.h
> @@ -39,6 +39,8 @@
> #define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE)
> #endif
>
> +#endif /* CONFIG_PPC64 */
> +
> /*
> * flags for paca->irq_soft_mask
> */
> @@ -47,8 +49,6 @@
> #define IRQS_PMI_DISABLED 2
> #define IRQS_ALL_DISABLED (IRQS_DISABLED | IRQS_PMI_DISABLED)
>
> -#endif /* CONFIG_PPC64 */
> -
> #ifndef __ASSEMBLY__
>
> extern void replay_system_reset(void);
> @@ -282,6 +282,15 @@ extern void irq_set_pending_from_srr1(unsigned long srr1);
>
> extern void force_external_irq_replay(void);
>
> +static inline unsigned long get_softe(struct pt_regs *regs)
> +{
> + return regs->softe;
> +}
> +
> +static inline void set_softe(struct pt_regs *regs, unsigned long val)
> +{
> + regs->softe = val;
> +}
> #else /* CONFIG_PPC64 */
>
> static inline unsigned long arch_local_save_flags(void)
> @@ -350,6 +359,14 @@ static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
>
> static inline void may_hard_irq_enable(void) { }
>
> +static inline unsigned long get_softe(struct pt_regs *regs)
> +{
> + return 0;
> +}
> +
> +static inline void set_softe(struct pt_regs *regs, unsigned long val)
> +{
> +}
If this goes into a general shared header, I would prefer if we could
do something a bit more general (at least with the name).
I think get_softe() could just be replaced with arch_irq_disabled_regs().
For set, could we call it irq_soft_mask_regs_set_state()? 32 has no soft
mask state in regs, so it's more obvious that it's a no-op. Or you could
make 32-bit version a BUG(), and then always guard it with IS_ENABLED().
Thanks,
Nick
next prev parent reply other threads:[~2020-04-07 0:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 18:16 [RFC PATCH v3 01/15] powerpc/syscall: Refactorise from Nick Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 02/15] powerpc/radix: Make kuap_check_amr() and kuap_restore_amr() generic Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 03/15] powerpc/32s: Create C version of kuap_restore() and kuap_check() Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 04/15] powerpc/8xx: " Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 05/15] powerpc/irq: Add helpers to get and set regs->softe Christophe Leroy
2020-04-07 0:50 ` Nicholas Piggin [this message]
2020-04-06 18:16 ` [RFC PATCH v3 06/15] powerpc/irq: Add new helpers to play with MSR_EE and MSR_RI on PPC32 Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 07/15] powerpc/irq: Add stub irq_soft_mask_return() for PPC32 Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 08/15] powerpc/syscall: Rename syscall_64.c into syscall.c Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 09/15] powerpc/syscall: Make syscall_64.c buildable on PPC32 Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 10/15] powerpc/syscall: Use is_compat_task() Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 11/15] powerpc/syscall: Save r3 in regs->orig_r3 Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 12/15] powerpc/syscall: Selectively check MSR_RI and MSR_PR on syscall entry Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 13/15] powerpc/syscall: system call implement entry/exit logic in C for PPC32 Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 14/15] powerpc/syscall: Avoid stack frame in likely part of syscall_call_exception() Christophe Leroy
2020-04-06 18:16 ` [RFC PATCH v3 15/15] powerpc/kernel: Do not inconditionally save non volatile registers on system call Christophe Leroy
2020-04-07 1:10 ` Nicholas Piggin
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=1586219567.cl8bye6kgu.astroid@bobo.none \
--to=npiggin@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=paulus@samba.org \
--subject='Re: [RFC PATCH v3 05/15] powerpc/irq: Add helpers to get and set regs->softe' \
/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
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).