All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: <linuxppc-dev@ozlabs.org>,
	haokexin@gmail.com, aneesh.kumar@linux.vnet.ibm.com
Subject: Re: [PATCH v3 10/21] powerpc/mm: Define radix_enabled() in one place & use static inline
Date: Thu, 28 Jul 2016 17:46:11 +1000	[thread overview]
Message-ID: <20160728174611.1ec99066@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <1469629097-30859-10-git-send-email-mpe@ellerman.id.au>

On Thu, 28 Jul 2016 00:18:06 +1000
Michael Ellerman <mpe@ellerman.id.au> wrote:

> Currently we have radix_enabled() three times, twice in
> asm/book3s/64/mmu.h and then a fallback in asm/mmu.h.
> 
> Consolidate them in asm/mmu.h. While we're at it convert them to be
> static inlines, and change the fallback case to returning a bool, like
> mmu_has_feature().
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  arch/powerpc/include/asm/book3s/64/mmu.h |  7 -------
>  arch/powerpc/include/asm/mmu.h           | 16 ++++++++++++----
>  2 files changed, 12 insertions(+), 11 deletions(-)
> 
> v3: New.
> 
> diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h
> b/arch/powerpc/include/asm/book3s/64/mmu.h index
> ad2d501cddcf..70c995870297 100644 ---
> a/arch/powerpc/include/asm/book3s/64/mmu.h +++
> b/arch/powerpc/include/asm/book3s/64/mmu.h @@ -23,13 +23,6 @@ struct
> mmu_psize_def { };
>  extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
>  
> -#ifdef CONFIG_PPC_RADIX_MMU
> -#define radix_enabled() mmu_has_feature(MMU_FTR_TYPE_RADIX)
> -#else
> -#define radix_enabled() (0)
> -#endif
> -
> -
>  #endif /* __ASSEMBLY__ */
>  
>  /* 64-bit classic hash table MMU */
> diff --git a/arch/powerpc/include/asm/mmu.h
> b/arch/powerpc/include/asm/mmu.h index eb942a446969..f413b3213a3b
> 100644 --- a/arch/powerpc/include/asm/mmu.h
> +++ b/arch/powerpc/include/asm/mmu.h
> @@ -163,6 +163,18 @@ static inline void assert_pte_locked(struct
> mm_struct *mm, unsigned long addr) }
>  #endif /* !CONFIG_DEBUG_VM */
>  
> +#ifdef CONFIG_PPC_RADIX_MMU
> +static inline bool radix_enabled(void)
> +{
> +	return mmu_has_feature(MMU_FTR_TYPE_RADIX);
> +}
> +#else
> +static inline bool radix_enabled(void)
> +{
> +	return false;
> +}
> +#endif

Won't MMU_FTRS_POSSIBLE just do the right thing when
!CONFIG_PPC_RADIX_MMU?

Thanks,
Nick

  reply	other threads:[~2016-07-28  7:46 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 14:17 [PATCH v3 01/21] powerpc/mm: Add mmu_early_init_devtree() Michael Ellerman
2016-07-27 14:17 ` [PATCH v3 02/21] powerpc/mm: Move disable_radix handling into mmu_early_init_devtree() Michael Ellerman
2016-07-28  3:14   ` Balbir Singh
2016-07-27 14:17 ` [PATCH v3 03/21] powerpc/mm: Do hash device tree scanning earlier Michael Ellerman
2016-07-28 12:40   ` [PATCH v4] " Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 04/21] powerpc/mm: Do radix " Michael Ellerman
2016-07-28  3:48   ` Balbir Singh
2016-07-28  8:11     ` Michael Ellerman
2016-07-28 11:55       ` Balbir Singh
2016-07-27 14:18 ` [PATCH v3 05/21] powerpc/64: Do feature patching before MMU init Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 06/21] powerpc/kernel: Check features don't change after patching Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 07/21] powerpc/mm: Make MMU_FTR_RADIX a MMU family feature Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 08/21] powerpc/kernel: Convert mmu_has_feature() to returning bool Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 09/21] powerpc/kernel: Convert cpu_has_feature() " Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 10/21] powerpc/mm: Define radix_enabled() in one place & use static inline Michael Ellerman
2016-07-28  7:46   ` Nicholas Piggin [this message]
2016-07-29 11:42     ` Michael Ellerman
2016-07-29 12:54       ` Balbir Singh
2016-07-30 10:08         ` Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 11/21] powerpc/mm: Add __cpu/__mmu_has_feature() Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 12/21] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers Michael Ellerman
2016-07-27 21:37   ` Benjamin Herrenschmidt
2016-07-28 11:24     ` Michael Ellerman
2016-07-27 21:42   ` Benjamin Herrenschmidt
2016-07-28  7:49   ` Nicholas Piggin
2016-07-28 13:04     ` Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 13/21] jump_label: Make it possible for arches to invoke jump_label_init() earlier Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 14/21] powerpc: Call jump_label_init() in apply_feature_fixups() Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 15/21] powerpc: Remove mfvtb() Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 16/21] powerpc: Move cpu_has_feature() to a separate file Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 17/21] powerpc: Add kconfig option to use jump labels for cpu/mmu_has_feature() Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 18/21] powerpc: Add option to use jump label for cpu_has_feature() Michael Ellerman
2016-07-28  7:51   ` Nicholas Piggin
2016-07-27 14:18 ` [PATCH v3 19/21] powerpc: Add option to use jump label for mmu_has_feature() Michael Ellerman
2016-07-28  7:52   ` Nicholas Piggin
2016-08-08  0:59   ` Anton Blanchard
2016-08-08  7:35     ` Anton Blanchard
2016-07-27 14:18 ` [PATCH v3 20/21] powerpc/mm: Catch usage of cpu/mmu_has_feature() before jump label init Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 21/21] powerpc/jump_label: Annotate jump label assembly Michael Ellerman
2016-07-28  7:56   ` Nicholas Piggin
     [not found] ` <1469629097-30859-14-git-send-email-mpe__30163.7288918302$1469630223$gmane$org@ellerman.id.au>
2016-08-13 23:55   ` [PATCH v3 14/21] powerpc: Call jump_label_init() in apply_feature_fixups() Andreas Schwab
2016-08-14  4:44     ` Michael Ellerman

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=20160728174611.1ec99066@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=haokexin@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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.