All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@ozlabs.org
Cc: npiggin@gmail.com
Subject: Re: [PATCH 3/4] powerpc/64s: Move SLB init into hash_utils_64.c
Date: Wed, 23 Jan 2019 14:34:17 +0530	[thread overview]
Message-ID: <87y37bbv8u.fsf@linux.ibm.com> (raw)
In-Reply-To: <20190117121328.13395-3-mpe@ellerman.id.au>

Michael Ellerman <mpe@ellerman.id.au> writes:

> The SLB initialisation code is spread around a bit between prom.c and
> hash_utils_64.c. Consolidate it all in hash_utils_64.c.
>
> This slightly changes the timing of when mmu_slb_size is initialised,
> but that should have no effect.

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>

>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  arch/powerpc/kernel/prom.c      | 16 ----------------
>  arch/powerpc/mm/hash_utils_64.c | 15 ++++++++++-----
>  2 files changed, 10 insertions(+), 21 deletions(-)
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 14693f8ccb80..018ededd1948 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -229,21 +229,6 @@ static void __init check_cpu_pa_features(unsigned long node)
>  		      ibm_pa_features, ARRAY_SIZE(ibm_pa_features));
>  }
>  
> -#ifdef CONFIG_PPC_BOOK3S_64
> -static void __init init_mmu_slb_size(unsigned long node)
> -{
> -	const __be32 *slb_size_ptr;
> -
> -	slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL) ? :
> -			of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
> -
> -	if (slb_size_ptr)
> -		slb_set_size(be32_to_cpup(slb_size_ptr));
> -}
> -#else
> -#define init_mmu_slb_size(node) do { } while(0)
> -#endif
> -
>  static struct feature_property {
>  	const char *name;
>  	u32 min_value;
> @@ -379,7 +364,6 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
>  	}
>  
>  	identical_pvr_fixup(node);
> -	init_mmu_slb_size(node);
>  
>  #ifdef CONFIG_PPC64
>  	if (nthreads == 1)
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index 4aa0797000f7..33ce76be17de 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -344,9 +344,8 @@ static int __init parse_disable_1tb_segments(char *p)
>  }
>  early_param("disable_1tb_segments", parse_disable_1tb_segments);
>  
> -static int __init htab_dt_scan_seg_sizes(unsigned long node,
> -					 const char *uname, int depth,
> -					 void *data)
> +static int __init htab_dt_scan_slb(unsigned long node, const char *uname,
> +				   int depth, void *data)
>  {
>  	const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
>  	const __be32 *prop;
> @@ -356,6 +355,12 @@ static int __init htab_dt_scan_seg_sizes(unsigned long node,
>  	if (type == NULL || strcmp(type, "cpu") != 0)
>  		return 0;
>  
> +	prop = of_get_flat_dt_prop(node, "slb-size", NULL);
> +	if (!prop)
> +		prop = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
> +	if (prop)
> +		slb_set_size(be32_to_cpup(prop));
> +
>  	prop = of_get_flat_dt_prop(node, "ibm,processor-segment-sizes", &size);
>  	if (prop == NULL)
>  		return 0;
> @@ -954,8 +959,8 @@ static void __init htab_initialize(void)
>  
>  void __init hash__early_init_devtree(void)
>  {
> -	/* Initialize segment sizes */
> -	of_scan_flat_dt(htab_dt_scan_seg_sizes, NULL);
> +	/* Initialize SLB size and segment sizes */
> +	of_scan_flat_dt(htab_dt_scan_slb, NULL);
>  
>  	/* Initialize page sizes */
>  	htab_scan_page_sizes();
> -- 
> 2.20.1


  reply	other threads:[~2019-01-23  9:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 12:13 [PATCH 1/4] powerpc/64s: Always set mmu_slb_size using slb_set_size() Michael Ellerman
2019-01-17 12:13 ` [PATCH 2/4] powerpc/64s: Add slb_full_bitmap rather than hard-coding U32_MAX Michael Ellerman
2019-01-17 16:30   ` Segher Boessenkool
2019-01-18 12:28     ` Michael Ellerman
2019-01-18 23:12       ` Segher Boessenkool
2019-01-23  9:02   ` Aneesh Kumar K.V
2019-01-17 12:13 ` [PATCH 3/4] powerpc/64s: Move SLB init into hash_utils_64.c Michael Ellerman
2019-01-23  9:04   ` Aneesh Kumar K.V [this message]
2019-01-17 12:13 ` [PATCH 4/4] powerpc/64s: Support shrinking the SLB for debugging Michael Ellerman
2019-01-19  0:13   ` Michal Suchánek
2019-01-19 10:27     ` Michael Ellerman
2019-01-23  8:40       ` Nicholas Piggin
2019-01-23  9:10   ` Aneesh Kumar K.V
2019-01-23  8:59 ` [PATCH 1/4] powerpc/64s: Always set mmu_slb_size using slb_set_size() Aneesh Kumar K.V

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=87y37bbv8u.fsf@linux.ibm.com \
    --to=aneesh.kumar@linux.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --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.