Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] Patch for PA 2.0, 32-bit kernels on systems with > 2GB RAM
@ 2002-03-28  0:39 Ryan Bradetich
  0 siblings, 0 replies; only message in thread
From: Ryan Bradetich @ 2002-03-28  0:39 UTC (permalink / raw)
  To: parisc-linux

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

Hello parisc-linux hackers,

The 2.4.18-pa6 patch broke 32-bit kernel on PA 2.0 systems if the system
has > 2GB RAM.  This patch fixes the problem for my C200+ with > 2GB
RAM, and continues to boots with < 2GB RAM.

The basic problem was that the kernel was performing simple sign
extension instead of F-Extension.

I plan on committing this patch into CVS in a couple of days unless it
causes problems on someones configuration.  Please test and let me
know if you encounter problems.

Thanks,

- Ryan

P.S. Thanks to Thomas Bogendoerfer for helping to identify the cause,
and to LaMont Jones for providing the assembly instructions to fix the
problem without using a branch instruction :)



[-- Attachment #2: entry.S.diff --]
[-- Type: text/x-patch, Size: 2553 bytes --]

Index: arch/parisc/kernel/entry.S
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/entry.S,v
retrieving revision 1.91
diff -u -p -r1.91 entry.S
--- arch/parisc/kernel/entry.S	2002/03/20 05:08:58	1.91
+++ arch/parisc/kernel/entry.S	2002/03/27 04:28:11
@@ -1352,12 +1352,10 @@ dtlb_miss_20:
 
 	/* Get rid of prot bits and convert to page addr for idtlbt */
 
-	/* FIXME - sign extension of 0xf0... range is incorrect!
-	** extrd,s below needs to "f-extend" to "0xf0f0f0...".
-	** 4 instances of this to fix.
-	*/
-
+	extrd,s         pte,35,4,t0
 	depdi		0,63,12,pte	/* clear lower 12 bits */
+        addi,=          1,t0,0 
+        extrd,u,*tr     pte,56,25,pte 
 	extrd,s		pte,56,25,pte	/* bit 31:8 >> 8  */ 
 	idtlbt          pte,prot
 
@@ -1424,9 +1422,12 @@ nadtlb_miss_20:
 
 	/* Get rid of prot bits and convert to page addr for idtlbt */
 
-	depdi		0,63,12,pte	/* clear lower 12 bits */
-	extrd,s		pte,56,25,pte	/* bit 31:8 >> 8  */ 
-	idtlbt          pte,prot
+        extrd,s         pte,35,4,t0
+        depdi           0,63,12,pte     /* clear lower 12 bits */
+        addi,=          1,t0,0
+        extrd,u,*tr     pte,56,25,pte
+        extrd,s         pte,56,25,pte   /* bit 31:8 >> 8  */
+        idtlbt          pte,prot
 
 	rfir
 	nop
@@ -1674,8 +1675,11 @@ itlb_miss_common_20:
 
 	/* Get rid of prot bits and convert to page addr for iitlbt */
 
-	depdi		0,63,12,pte	/* clear lower 12 bits */
-	extrd,s		pte,56,25,pte	/* bit 31:8 >> 8  */ 
+        extrd,s         pte,35,4,t0 
+        depdi           0,63,12,pte     /* clear lower 12 bits */
+        addi,=          1,t0,0
+        extrd,u,*tr     pte,56,25,pte 
+        extrd,s         pte,56,25,pte   /* bit 31:8 >> 8  */
 	iitlbt          pte,prot
 
 	rfir
@@ -1889,11 +1893,13 @@ dbit_nolock_20:
 	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
 	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
 
-	/* Get rid of prot bits and convert to page addr for idtlbt */
+        extrd,s         pte,35,4,t0 
+        depdi           0,63,12,pte     /* clear lower 12 bits */
+        addi,=          1,t0,0
+        extrd,u,*tr     pte,56,25,pte 
+        extrd,s         pte,56,25,pte   /* bit 31:8 >> 8  */
+        idtlbt          pte,prot
 
-	depdi		0,63,12,pte	/* clear lower 12 bits */
-	extrd,s		pte,56,25,pte	/* bit 31:8 >> 8  */ 
-	idtlbt          pte,prot
 #ifdef CONFIG_SMP
 	CMPIB=,n        0,spc,dbit_nounlock_20
 	ldi             1,t1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-03-28  0:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-28  0:39 [parisc-linux] Patch for PA 2.0, 32-bit kernels on systems with > 2GB RAM Ryan Bradetich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox