From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Paul Mackerras" <paulus@ozlabs.org>, <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE
Date: Wed, 29 Jan 2025 16:14:25 +1000 [thread overview]
Message-ID: <D7EC3ZZ2E3YY.5ALSOA646CK4@gmail.com> (raw)
In-Reply-To: <Z5lf-OrrbRe5Q0O-@thinks.paulus.ozlabs.org>
On Wed Jan 29, 2025 at 8:53 AM AEST, Paul Mackerras wrote:
> Power ISA v3.1 implementations in the Linux Compliancy Subset and
> lower are not required to implement broadcast TLBIE, and in fact
> Microwatt doesn't. To avoid the need to specify "disable_tlbie" on
> the kernel command line on SMP Microwatt systems, this defines a
> config option that asserts that broadcast TLBIE should never be used
> (the kernel will instead use IPIs to trigger local TLBIEs on other
> CPUs when required).
>
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> ---
> arch/powerpc/mm/book3s64/pgtable.c | 10 ++++++++--
> arch/powerpc/platforms/Kconfig.cputype | 12 ++++++++++++
> arch/powerpc/platforms/microwatt/Kconfig | 1 +
> 3 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/mm/book3s64/pgtable.c b/arch/powerpc/mm/book3s64/pgtable.c
> index 374542528080..14ee96e2a581 100644
> --- a/arch/powerpc/mm/book3s64/pgtable.c
> +++ b/arch/powerpc/mm/book3s64/pgtable.c
> @@ -588,10 +588,16 @@ int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
> }
> #endif
>
> +#ifndef CONFIG_PPC_RADIX_NO_BROADCAST_TLBIE
Hate to bikeshed, but would it be annoying to make this an affirmative
option?
> +#define DEFAULT_TLBIE_ENABLE true
> +#else
> +#define DEFAULT_TLBIE_ENABLE false
> +#endif
> +
> /*
> * Does the CPU support tlbie?
> */
> -bool tlbie_capable __read_mostly = true;
> +bool tlbie_capable __read_mostly = DEFAULT_TLBIE_ENABLE;
> EXPORT_SYMBOL(tlbie_capable);
>
> /*
> @@ -599,7 +605,7 @@ EXPORT_SYMBOL(tlbie_capable);
> * address spaces? tlbie may still be used for nMMU accelerators, and for KVM
> * guest address spaces.
> */
> -bool tlbie_enabled __read_mostly = true;
> +bool tlbie_enabled __read_mostly = DEFAULT_TLBIE_ENABLE;
>
> static int __init setup_disable_tlbie(char *str)
> {
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index 1453ccc900c4..bd2a4e46ab34 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -449,6 +449,18 @@ config PPC_RADIX_MMU_DEFAULT
>
> If you're unsure, say Y.
>
> +config PPC_RADIX_NO_BROADCAST_TLBIE
> + depends on PPC_RADIX_MMU
> + help
> + Power ISA v3.1 implementations in the Linux Compliancy Subset
> + and lower are not required to implement broadcast TLBIE
> + instructions, that is, a TLB invalidation instruction
> + performed on one CPU is not required to operate on the TLBs
> + in all CPUs in the system. Instead, the kernel does an IPI
> + to each relevant CPU to get it to do a local TLBIE instruction.
> + Select this option to force global invalidations to be done via
> + IPIs unconditionally.
... when using radix MMU. Hash MMU requires broadcast TLBIE.
Nitpicks aside, looks okay to me.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
> +
> config PPC_KERNEL_PREFIXED
> depends on PPC_HAVE_PREFIXED_SUPPORT
> depends on CC_HAS_PREFIXED
> diff --git a/arch/powerpc/platforms/microwatt/Kconfig b/arch/powerpc/platforms/microwatt/Kconfig
> index 5e41adadac1f..1d5cc1ae3636 100644
> --- a/arch/powerpc/platforms/microwatt/Kconfig
> +++ b/arch/powerpc/platforms/microwatt/Kconfig
> @@ -7,6 +7,7 @@ config PPC_MICROWATT
> select PPC_ICP_NATIVE
> select PPC_UDBG_16550
> select COMMON_CLK
> + select PPC_RADIX_NO_BROADCAST_TLBIE
> help
> This option enables support for FPGA-based Microwatt implementations.
>
next prev parent reply other threads:[~2025-01-29 6:14 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 22:49 [PATCH 0/5] Microwatt updates Paul Mackerras
2025-01-28 22:51 ` [PATCH 1/5] powerpc/microwatt: Select COMMON_CLK in order to get the clock framework Paul Mackerras
2025-01-29 5:57 ` Nicholas Piggin
2025-01-28 22:52 ` [PATCH 2/5] powerpc/microwatt: Device-tree updates Paul Mackerras
2025-01-29 6:36 ` Nicholas Piggin
2025-01-29 7:18 ` Paul Mackerras
2025-01-29 8:20 ` Nicholas Piggin
2025-01-31 17:03 ` Segher Boessenkool
2025-01-31 16:55 ` Segher Boessenkool
2025-01-31 16:53 ` Segher Boessenkool
2025-01-31 16:48 ` Segher Boessenkool
2025-01-28 22:52 ` [PATCH 3/5] powerpc/microwatt: Define an idle power-save function Paul Mackerras
2025-01-29 6:06 ` Nicholas Piggin
2025-01-29 6:49 ` Paul Mackerras
2025-01-31 16:32 ` Segher Boessenkool
2025-02-01 1:41 ` Paul Mackerras
2025-01-31 16:25 ` Segher Boessenkool
2025-01-28 22:53 ` [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE Paul Mackerras
2025-01-29 6:14 ` Nicholas Piggin [this message]
2025-01-29 7:10 ` Paul Mackerras
2025-01-29 8:17 ` Nicholas Piggin
2025-01-31 17:30 ` Segher Boessenkool
2025-01-31 17:26 ` Segher Boessenkool
2025-01-28 22:55 ` [PATCH 5/5] powerpc/microwatt: Add SMP support Paul Mackerras
2025-01-29 6:21 ` Nicholas Piggin
2025-01-29 6:57 ` Paul Mackerras
2025-01-29 8:12 ` Nicholas Piggin
2025-01-31 1:27 ` Paul Mackerras
2025-01-29 12:50 ` Michael Ellerman
2025-01-31 1:34 ` Paul Mackerras
2025-01-31 16:13 ` [PATCH 0/5] Microwatt updates Segher Boessenkool
2025-02-01 1:22 ` Paul Mackerras
2025-03-02 10:13 ` Gabriel Paubert
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=D7EC3ZZ2E3YY.5ALSOA646CK4@gmail.com \
--to=npiggin@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@ozlabs.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.