summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/head64.S
diff options
context:
space:
mode:
authorHongjie Yang <hongjie@us.ibm.com>2007-01-09 10:18:36 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-01-09 10:18:36 +0100
commitdd401e2b9250e3bb07ef388ddccbbf80aa106fc7 (patch)
tree3043c1d699d3d5f31bf6a47985fdf24760a38990 /arch/s390/kernel/head64.S
parentefa06708fe77190f31bed5c3cb5da49e211240f5 (diff)
[S390] memory detection misses 128k.
Fix a memory leak problem in the memory detection routines. A memory leak of 128k occurs when we have a contiguous memory with mixed access-mode (read or write) ranges. Signed-off-by: Hongjie Yang <hongjie@us.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/head64.S')
-rw-r--r--arch/s390/kernel/head64.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index c526279e112..6ba3f4512dd 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -172,12 +172,15 @@ startup_continue:
srl %r7,28
clr %r6,%r7 # compare cc with last access code
je .Lsame
- j .Lchkmem
+ lghi %r8,0 # no program checks
+ j .Lsavchk
.Lsame:
algr %r5,%r1 # add 128KB to end of chunk
# no need to check here,
brc 12,.Lloop # this is the same chunk
.Lchkmem: # > 16EB or tprot got a program check
+ lghi %r8,1 # set program check flag
+.Lsavchk:
clgr %r4,%r5 # chunk size > 0?
je .Lchkloop
stg %r4,0(%r3) # store start address of chunk
@@ -204,8 +207,15 @@ startup_continue:
chi %r10, 0 # do we have chunks left?
je .Ldonemem
.Lhsaskip:
+ chi %r8,1 # program check ?
+ je .Lpgmchk
+ lgr %r4,%r5 # potential new chunk
+ algr %r5,%r1 # add 128KB to end of chunk
+ j .Llpcnt
+.Lpgmchk:
algr %r5,%r1 # add 128KB to end of chunk
lgr %r4,%r5 # potential new chunk
+.Llpcnt:
clgr %r5,%r9 # should we go on?
jl .Lloop
.Ldonemem: