Patchwork [-V3,10/11] arch/powerpc: Use 32bit array for slb cache

login
register
mail settings
Submitter Aneesh Kumar K.V
Date July 9, 2012, 1:13 p.m.
Message ID <1341839621-28332-11-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/169831/
State Changes Requested
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Aneesh Kumar K.V - July 9, 2012, 1:13 p.m.
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>

With larger vsid we need to track more bits of ESID in slb cache
for slb invalidate.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/paca.h |    2 +-
 arch/powerpc/mm/slb_low.S       |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
Paul Mackerras - July 23, 2012, 12:27 a.m.
On Mon, Jul 09, 2012 at 06:43:40PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> With larger vsid we need to track more bits of ESID in slb cache
> for slb invalidate.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Minor comment below, but apart from that...

Reviewed-by: Paul Mackerras <paulus@samba.org>

> -	sldi	r11,r3,1		/* r11 = offset * sizeof(u16) */
> -	rldicl	r10,r10,36,28		/* get low 16 bits of the ESID */
> -	add	r11,r11,r13		/* r11 = (u16 *)paca + offset */
> -	sth	r10,PACASLBCACHE(r11)	/* paca->slb_cache[offset] = esid */
> +	sldi	r11,r3,2		/* r11 = offset * sizeof(u32) */
> +	rldicl	r10,r10,36,28		/* get the 36 bits of the ESID */

You're correct that the rldicl instruction produces 36 bits of result,
and in fact it is equivalent to srdi r10,r10,28.  If you're changing
the line you might as well change the instruction to the simpler form
too.

Paul.
Aneesh Kumar K.V - July 23, 2012, 8:25 a.m.
Paul Mackerras <paulus@samba.org> writes:

> On Mon, Jul 09, 2012 at 06:43:40PM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>> 
>> With larger vsid we need to track more bits of ESID in slb cache
>> for slb invalidate.
>> 
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>
> Minor comment below, but apart from that...
>
> Reviewed-by: Paul Mackerras <paulus@samba.org>
>
>> -	sldi	r11,r3,1		/* r11 = offset * sizeof(u16) */
>> -	rldicl	r10,r10,36,28		/* get low 16 bits of the ESID */
>> -	add	r11,r11,r13		/* r11 = (u16 *)paca + offset */
>> -	sth	r10,PACASLBCACHE(r11)	/* paca->slb_cache[offset] = esid */
>> +	sldi	r11,r3,2		/* r11 = offset * sizeof(u32) */
>> +	rldicl	r10,r10,36,28		/* get the 36 bits of the ESID */
>
> You're correct that the rldicl instruction produces 36 bits of result,
> and in fact it is equivalent to srdi r10,r10,28.  If you're changing
> the line you might as well change the instruction to the simpler form
> too.

done.

-aneesh

Patch

diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index daf813f..3e7abba 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -100,7 +100,7 @@  struct paca_struct {
 	/* SLB related definitions */
 	u16 vmalloc_sllp;
 	u16 slb_cache_ptr;
-	u16 slb_cache[SLB_CACHE_ENTRIES];
+	u32 slb_cache[SLB_CACHE_ENTRIES];
 #endif /* CONFIG_PPC_STD_MMU_64 */
 
 #ifdef CONFIG_PPC_BOOK3E
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index c1fc81c..d522679 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -269,10 +269,10 @@  _GLOBAL(slb_compare_rr_to_size)
 	bge	1f
 
 	/* still room in the slb cache */
-	sldi	r11,r3,1		/* r11 = offset * sizeof(u16) */
-	rldicl	r10,r10,36,28		/* get low 16 bits of the ESID */
-	add	r11,r11,r13		/* r11 = (u16 *)paca + offset */
-	sth	r10,PACASLBCACHE(r11)	/* paca->slb_cache[offset] = esid */
+	sldi	r11,r3,2		/* r11 = offset * sizeof(u32) */
+	rldicl	r10,r10,36,28		/* get the 36 bits of the ESID */
+	add	r11,r11,r13		/* r11 = (u32 *)paca + offset */
+	stw	r10,PACASLBCACHE(r11)	/* paca->slb_cache[offset] = esid */
 	addi	r3,r3,1			/* offset++ */
 	b	2f
 1:					/* offset >= SLB_CACHE_ENTRIES */