Skip to contentSkip to conversation

powerpc: pseries: Fix kexec on machines with more than 4TB of RAM

PATCH In review Anton Blanchard 2 participants 2 messages Jul 27, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: pseries: Fix kexec on machines with more than 4TB of RAM

On a box with 8TB of RAM the MMU hashtable is 64GB in size. That means we have 4G PTEs. pSeries_lpar_hptab_clear was using a signed int to store the index which will overflow at 2G.

---

arch/powerpc/platforms/pseries/lpar.c +1 -1
Index: linux-powerpc/arch/powerpc/platforms/pseries/lpar.c
===================================================================
@@ -203,7 +203,7 @@ static void pSeries_lpar_hptab_clear(voi
 		unsigned long ptel;
 	} ptes[4];
 	long lpar_rc;
-	int i, j;
+	unsigned long i, j;
 
 	/* Read in batches of 4,
 	 * invalidate only valid entries not in the VRMA
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines

On a box with 8TB of RAM the MMU hashtable is 64GB in size. That means we have 4G PTEs. pSeries_lpar_hptab_clear was using a signed int to store the index which will overflow at 2G.

Wow, I hear... "Anton Blanchard's machine has more memory in it's MMU than you have in total".

Quoted 8 lines

---

Index: linux-powerpc/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/lpar.c 2011-07-27 13:5

0:18.408091576 +1000

Quoted 1 line

+++ linux-powerpc/arch/powerpc/platforms/pseries/lpar.c 2011-07-27 13:5

1:19.359196131 +1000

Quoted 10 lines
arch/powerpc/platforms/pseries/lpar.c +1 -1
@@ -203,7 +203,7 @@ static void pSeries_lpar_hptab_clear(voi
 		unsigned long ptel;
 	} ptes[4];
 	long lpar_rc;
-	int i, j;
+	unsigned long i, j;
 
 	/* Read in batches of 4,
 	 * invalidate only valid entries not in the VRMA