Subject: Re: [POWERPC] iSeries: fix slb.c for combined build

From: Michael Ellerman <[email-masked]>
Date: Tue, 14 Nov 2006 13:03:25 +1100

On Tue, 2006-11-14 at 12:57 +1100, Stephen Rothwell wrote:
> Signed-off-by: Stephen Rothwell <[email-masked]>
> ---
>  arch/powerpc/mm/slb.c |   13 ++++++-------
>  1 files changed, 6 insertions(+), 7 deletions(-)
> 
> This version takes into account Olof's comment.

It's not clear from that patch that you haven't altered the logic for !
ISERIES, but I'll take your word for it ;)

cheers

> -- 
> Cheers,
> Stephen Rothwell                    [email-masked]
> 
> diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
> index d373391..224e960 100644
> --- a/arch/powerpc/mm/slb.c
> +++ b/arch/powerpc/mm/slb.c
> @@ -23,6 +23,7 @@
>  #include <asm/cputable.h>
>  #include <asm/cacheflush.h>
>  #include <asm/smp.h>
> +#include <asm/firmware.h>
>  #include <linux/compiler.h>
>  
>  #ifdef DEBUG
> @@ -193,6 +194,7 @@ static inline void patch_slb_encoding(un
>  void slb_initialize(void)
>  {
>  	unsigned long linear_llp, vmalloc_llp, io_llp;
> +	unsigned long lflags, vflags;
>  	static int slb_encoding_inited;
>  	extern unsigned int *slb_miss_kernel_load_linear;
>  	extern unsigned int *slb_miss_kernel_load_io;
> @@ -225,11 +227,12 @@ void slb_initialize(void)
>  #endif
>  	}
>  
> +	get_paca()->stab_rr = SLB_NUM_BOLTED;
> +
>  	/* On iSeries the bolted entries have already been set up by
>  	 * the hypervisor from the lparMap data in head.S */
> -#ifndef CONFIG_PPC_ISERIES
> - {
> -	unsigned long lflags, vflags;
> +	if (firmware_has_feature(FW_FEATURE_ISERIES))
> +		return;
>  
>  	lflags = SLB_VSID_KERNEL | linear_llp;
>  	vflags = SLB_VSID_KERNEL | vmalloc_llp;
> @@ -247,8 +250,4 @@ void slb_initialize(void)
>  	 * elsewhere, we'll call _switch() which will bolt in the new
>  	 * one. */
>  	asm volatile("isync":::"memory");
> - }
> -#endif /* CONFIG_PPC_ISERIES */
> -
> -	get_paca()->stab_rr = SLB_NUM_BOLTED;
>  }
-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person