From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: akpm@osdl.org, heiko.carstens@de.ibm.com, linux-kernel@vger.kernel.org
Subject: [patch 14/16] s390: memory detection > 32GB.
Date: Tue, 21 Jun 2005 18:29:35 +0200 [thread overview]
Message-ID: <20050621162935.GN6053@localhost.localdomain> (raw)
[patch 14/16] s390: memory detection > 32GB.
From: Heiko Carstens <heiko.carstens@de.ibm.com>
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>
diffstat:
arch/s390/kernel/head.S | 8 ++++----
arch/s390/kernel/head64.S | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff -urpN linux-2.6/arch/s390/kernel/head64.S linux-2.6-patched/arch/s390/kernel/head64.S
--- linux-2.6/arch/s390/kernel/head64.S 2005-06-21 17:36:55.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/head64.S 2005-06-21 17:36:55.000000000 +0200
@@ -518,9 +518,9 @@ startup:basr %r13,0
l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP
b .Lservicecall-.LPG1(%r13)
.Lprocsccb:
- lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
- chi %r1,0x00
- jne .Lscnd
+ lghi %r1,0
+ icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
+ jnz .Lscnd
lg %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
.Lscnd:
xr %r3,%r3 # same logic
diff -urpN linux-2.6/arch/s390/kernel/head.S linux-2.6-patched/arch/s390/kernel/head.S
--- linux-2.6/arch/s390/kernel/head.S 2005-06-21 17:36:55.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/head.S 2005-06-21 17:36:55.000000000 +0200
@@ -517,10 +517,10 @@ startup:basr %r13,0
l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
b .Lservicecall-.LPG1(%r13)
.Lprocsccb:
- lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
- chi %r1,0x00
- jne .Lscnd
- l %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
+ 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
.Lscnd:
xr %r3,%r3 # same logic
ic %r3,.Lscpa1-PARMAREA(%r4)
reply other threads:[~2005-06-21 17:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050621162935.GN6053@localhost.localdomain \
--to=schwidefsky@de.ibm.com \
--cc=akpm@osdl.org \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox