[PATCH] s390: memory detection > 32GB
The kernel takes a very long time to boot if the memory size is bigger then 32767 MB. The memory size is contained in a structure created by an sclp call. The kernel accesses the field with a LH instrution which performs a sign extension of a 16 bit word. In the case of a memory size with bit 2^15 set this results in a very large value and the memory detection just loops for a long time. In addition if more then 64 GB are used on a 64 bit system the memory size is read from an incorrect storage location. Use zero-extention to read the 16 bit memory size and the correct offset to read the 4 byte memory size on 64 bit. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Родитель
447570cfde
Коммит
e9b9a04796
|
@ -517,10 +517,10 @@ startup:basr %r13,0 # get base
|
||||||
l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
|
l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
|
||||||
b .Lservicecall-.LPG1(%r13)
|
b .Lservicecall-.LPG1(%r13)
|
||||||
.Lprocsccb:
|
.Lprocsccb:
|
||||||
lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
|
lhi %r1,0
|
||||||
chi %r1,0x00
|
icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
|
||||||
jne .Lscnd
|
jnz .Lscnd
|
||||||
l %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
|
l %r1,.Lscpincr2-PARMAREA+4(%r4) # otherwise use this one
|
||||||
.Lscnd:
|
.Lscnd:
|
||||||
xr %r3,%r3 # same logic
|
xr %r3,%r3 # same logic
|
||||||
ic %r3,.Lscpa1-PARMAREA(%r4)
|
ic %r3,.Lscpa1-PARMAREA(%r4)
|
||||||
|
|
|
@ -518,9 +518,9 @@ startup:basr %r13,0 # get base
|
||||||
l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP
|
l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP
|
||||||
b .Lservicecall-.LPG1(%r13)
|
b .Lservicecall-.LPG1(%r13)
|
||||||
.Lprocsccb:
|
.Lprocsccb:
|
||||||
lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
|
lghi %r1,0
|
||||||
chi %r1,0x00
|
icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
|
||||||
jne .Lscnd
|
jnz .Lscnd
|
||||||
lg %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
|
lg %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
|
||||||
.Lscnd:
|
.Lscnd:
|
||||||
xr %r3,%r3 # same logic
|
xr %r3,%r3 # same logic
|
||||||
|
|
Загрузка…
Ссылка в новой задаче