All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH 4/6] powerpc/64s: Make hash MMU code build configurable
Date: Sat, 28 Aug 2021 11:34:35 +0200	[thread overview]
Message-ID: <3b419b53-02b8-1a52-2f22-7b8ca49c4460@csgroup.eu> (raw)
In-Reply-To: <20210827163410.1177154-5-npiggin@gmail.com>



Le 27/08/2021 à 18:34, Nicholas Piggin a écrit :
> Introduce a new option CONFIG_PPC_64S_HASH_MMU which allows the 64s hash
> MMU code to be compiled out if radix is selected and the minimum
> supported CPU type is POWER9 or higher, and KVM is not selected.
> 
> This saves 128kB kernel image size (90kB text) on powernv_defconfig
> minus KVM, 350kB on pseries_defconfig minus KVM, 40kB on a tiny config.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---

...

> @@ -324,6 +330,7 @@ static inline void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
>   }
>   #endif /* !CONFIG_DEBUG_VM */
>   
> +#if defined(CONFIG_PPC_RADIX_MMU) && defined(CONFIG_PPC_64S_HASH_MMU)
>   static inline bool radix_enabled(void)
>   {
>   	return mmu_has_feature(MMU_FTR_TYPE_RADIX);
> @@ -333,6 +340,27 @@ static inline bool early_radix_enabled(void)
>   {
>   	return early_mmu_has_feature(MMU_FTR_TYPE_RADIX);
>   }
> +#elif defined(CONFIG_PPC_64S_HASH_MMU)
> +static inline bool radix_enabled(void)
> +{
> +	return false;
> +}
> +
> +static inline bool early_radix_enabled(void)
> +{
> +	return false;
> +}
> +#else
> +static inline bool radix_enabled(void)
> +{
> +	return true;
> +}
> +
> +static inline bool early_radix_enabled(void)
> +{
> +	return true;
> +}
> +#endif

You don't need something that complex. You don't need to change that at all indeed, just have to 
ensure that when CONFIG_PPC_64S_HASH_MMU is not selected you have MMU_FTR_TYPE_RADIX included in 
MMU_FTRS_ALWAYS and voila.

>   
>   #ifdef CONFIG_STRICT_KERNEL_RWX
>   static inline bool strict_kernel_rwx_enabled(void)

  reply	other threads:[~2021-08-28  9:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 16:34 [RFC PATCH 0/6] powerpc: Make hash MMU code build configurable Nicholas Piggin
2021-08-27 16:34 ` [RFC PATCH 1/6] powerpc: Remove unused FW_FEATURE_NATIVE references Nicholas Piggin
2021-08-27 16:34 ` [RFC PATCH 2/6] powerpc: Rename PPC_NATIVE to PPC_HASH_MMU_NATIVE Nicholas Piggin
2021-08-27 16:34 ` [RFC PATCH 3/6] powerpc/pseries: Stop selecting PPC_HASH_MMU_NATIVE Nicholas Piggin
2021-08-27 16:34 ` [RFC PATCH 4/6] powerpc/64s: Make hash MMU code build configurable Nicholas Piggin
2021-08-28  9:34   ` Christophe Leroy [this message]
2021-08-30  6:51     ` Nicholas Piggin
2021-08-28  9:59   ` Christophe Leroy
2021-08-30  6:55     ` Nicholas Piggin
2021-08-30  7:12       ` Christophe Leroy
2021-08-27 16:34 ` [RFC PATCH 5/6] powerpc/microwatt: select POWER9_CPU Nicholas Piggin
2021-08-28  9:50   ` Christophe Leroy
2021-08-30  6:56     ` Nicholas Piggin
2021-08-27 16:34 ` [RFC PATCH 6/6] powerpc/microwatt: Stop building the hash MMU code Nicholas Piggin
2021-08-28  9:54   ` Christophe Leroy
2021-08-30  3:24     ` Michael Ellerman
2021-08-30  6:58       ` 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=3b419b53-02b8-1a52-2f22-7b8ca49c4460@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    /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.