linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [POWERPC] iSeries: fix slb.c for combined build
@ 2006-11-13  3:49 Stephen Rothwell
  2006-11-13  7:03 ` Olof Johansson
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2006-11-13  3:49 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev


Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/mm/slb.c |   39 +++++++++++++++++++--------------------
 1 files changed, 19 insertions(+), 20 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index d373391..06c0055 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
@@ -227,28 +228,26 @@ void slb_initialize(void)
 
 	/* 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)) {
+		unsigned long lflags, vflags;
 
-	lflags = SLB_VSID_KERNEL | linear_llp;
-	vflags = SLB_VSID_KERNEL | vmalloc_llp;
+		lflags = SLB_VSID_KERNEL | linear_llp;
+		vflags = SLB_VSID_KERNEL | vmalloc_llp;
+
+		/* Invalidate the entire SLB (even slot 0) & all the ERATS */
+		asm volatile("isync":::"memory");
+		asm volatile("slbmte  %0,%0"::"r" (0) : "memory");
+		asm volatile("isync; slbia; isync":::"memory");
+		create_shadowed_slbe(PAGE_OFFSET, lflags, 0);
 
-	/* Invalidate the entire SLB (even slot 0) & all the ERATS */
-	asm volatile("isync":::"memory");
-	asm volatile("slbmte  %0,%0"::"r" (0) : "memory");
-	asm volatile("isync; slbia; isync":::"memory");
-	create_shadowed_slbe(PAGE_OFFSET, lflags, 0);
-
-	create_shadowed_slbe(VMALLOC_START, vflags, 1);
-
-	/* We don't bolt the stack for the time being - we're in boot,
-	 * so the stack is in the bolted segment.  By the time it goes
-	 * elsewhere, we'll call _switch() which will bolt in the new
-	 * one. */
-	asm volatile("isync":::"memory");
- }
-#endif /* CONFIG_PPC_ISERIES */
+		create_shadowed_slbe(VMALLOC_START, vflags, 1);
+
+		/* We don't bolt the stack for the time being - we're in boot,
+		 * so the stack is in the bolted segment.  By the time it goes
+		 * elsewhere, we'll call _switch() which will bolt in the new
+		 * one. */
+		asm volatile("isync":::"memory");
+	}
 
 	get_paca()->stab_rr = SLB_NUM_BOLTED;
 }
-- 
1.4.3.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [POWERPC] iSeries: fix slb.c for combined build
  2006-11-13  3:49 [POWERPC] iSeries: fix slb.c for combined build Stephen Rothwell
@ 2006-11-13  7:03 ` Olof Johansson
  2006-11-14  1:57   ` Stephen Rothwell
  0 siblings, 1 reply; 4+ messages in thread
From: Olof Johansson @ 2006-11-13  7:03 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus

On Mon, 13 Nov 2006 14:49:18 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> -#ifndef CONFIG_PPC_ISERIES
> - {
> -	unsigned long lflags, vflags;
> +	if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
> +		unsigned long lflags, vflags;
>  
> -	lflags = SLB_VSID_KERNEL | linear_llp;

It'll be a little tidier if you move the stab_rr setting (common code
at the bottom of the function) up above the test, and just return early
for iseries, instead of indenting everything an extra level.


-Olof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [POWERPC] iSeries: fix slb.c for combined build
  2006-11-13  7:03 ` Olof Johansson
@ 2006-11-14  1:57   ` Stephen Rothwell
  2006-11-14  2:03     ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2006-11-14  1:57 UTC (permalink / raw)
  To: paulus; +Cc: Olof Johansson, ppc-dev


Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/mm/slb.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

This version takes into account Olof's comment.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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;
 }
-- 
1.4.3.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [POWERPC] iSeries: fix slb.c for combined build
  2006-11-14  1:57   ` Stephen Rothwell
@ 2006-11-14  2:03     ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2006-11-14  2:03 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Olof Johansson, ppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 2167 bytes --]

On Tue, 2006-11-14 at 12:57 +1100, Stephen Rothwell wrote:
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  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                    sfr@canb.auug.org.au
> 
> 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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-14  2:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-13  3:49 [POWERPC] iSeries: fix slb.c for combined build Stephen Rothwell
2006-11-13  7:03 ` Olof Johansson
2006-11-14  1:57   ` Stephen Rothwell
2006-11-14  2:03     ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).