Skip to contentSkip to conversation

s390: 31 bit memory size limit.

PATCH In review Martin Schwidefsky 1 participant 1 message Jun 21, 2005 s390

lore
Share & tools
lore
#0 lore raw

PATCH 16/16 s390: 31 bit memory size limit.

[patch 16/16] s390: 31 bit memory size limit.

From: Heiko Carstens <[email protected]>

Limit reported memory size to 2GB if running in 31 bit mode.

diffstat:

 arch/s390/kernel/head.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)
arch/s390/kernel/head.S +6 -1
diff -urpN linux-2.6/arch/s390/kernel/head.S linux-2.6-patched/arch/s390/kernel/head.S
@@ -535,8 +535,13 @@ startup:basr  %r13,0                    
 	lhi   %r1,0
 	icm   %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
 	jnz   .Lscnd
-	l     %r1,.Lscpincr2-PARMAREA+4(%r4) # otherwise use this one
+	lhi   %r1,0x800			# otherwise report 2GB
 .Lscnd:
+	lhi   %r3,0x800			# limit reported memory size to 2GB
+	cr    %r1,%r3
+	jl    .Lno2gb
+	lr    %r1,%r3
+.Lno2gb:
 	xr    %r3,%r3			# same logic
 	ic    %r3,.Lscpa1-PARMAREA(%r4)
 	chi   %r3,0x00