aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHongjie Yang <hongjie@us.ibm.com>2007-01-09 04:18:36 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-01-09 04:18:36 -0500
commitdd401e2b9250e3bb07ef388ddccbbf80aa106fc7 (patch)
tree3043c1d699d3d5f31bf6a47985fdf24760a38990 /arch
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')
-rw-r--r--arch/s390/kernel/head31.S12
-rw-r--r--arch/s390/kernel/head64.S12
2 files changed, 22 insertions, 2 deletions
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index 4388b3309e0c..eca507050e47 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -164,11 +164,14 @@ startup_continue:
164 srl %r7,28 164 srl %r7,28
165 clr %r6,%r7 # compare cc with last access code 165 clr %r6,%r7 # compare cc with last access code
166 be .Lsame-.LPG1(%r13) 166 be .Lsame-.LPG1(%r13)
167 b .Lchkmem-.LPG1(%r13) 167 lhi %r8,0 # no program checks
168 b .Lsavchk-.LPG1(%r13)
168.Lsame: 169.Lsame:
169 ar %r5,%r1 # add 128KB to end of chunk 170 ar %r5,%r1 # add 128KB to end of chunk
170 bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop 171 bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop
171.Lchkmem: # > 2GB or tprot got a program check 172.Lchkmem: # > 2GB or tprot got a program check
173 lhi %r8,1 # set program check flag
174.Lsavchk:
172 clr %r4,%r5 # chunk size > 0? 175 clr %r4,%r5 # chunk size > 0?
173 be .Lchkloop-.LPG1(%r13) 176 be .Lchkloop-.LPG1(%r13)
174 st %r4,0(%r3) # store start address of chunk 177 st %r4,0(%r3) # store start address of chunk
@@ -190,8 +193,15 @@ startup_continue:
190 je .Ldonemem # if not, leave 193 je .Ldonemem # if not, leave
191 chi %r10,0 # do we have chunks left? 194 chi %r10,0 # do we have chunks left?
192 je .Ldonemem 195 je .Ldonemem
196 chi %r8,1 # program check ?
197 je .Lpgmchk
198 lr %r4,%r5 # potential new chunk
199 alr %r5,%r1 # add 128KB to end of chunk
200 j .Llpcnt
201.Lpgmchk:
193 alr %r5,%r1 # add 128KB to end of chunk 202 alr %r5,%r1 # add 128KB to end of chunk
194 lr %r4,%r5 # potential new chunk 203 lr %r4,%r5 # potential new chunk
204.Llpcnt:
195 clr %r5,%r9 # should we go on? 205 clr %r5,%r9 # should we go on?
196 jl .Lloop 206 jl .Lloop
197.Ldonemem: 207.Ldonemem:
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index c526279e1123..6ba3f4512dd1 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -172,12 +172,15 @@ startup_continue:
172 srl %r7,28 172 srl %r7,28
173 clr %r6,%r7 # compare cc with last access code 173 clr %r6,%r7 # compare cc with last access code
174 je .Lsame 174 je .Lsame
175 j .Lchkmem 175 lghi %r8,0 # no program checks
176 j .Lsavchk
176.Lsame: 177.Lsame:
177 algr %r5,%r1 # add 128KB to end of chunk 178 algr %r5,%r1 # add 128KB to end of chunk
178 # no need to check here, 179 # no need to check here,
179 brc 12,.Lloop # this is the same chunk 180 brc 12,.Lloop # this is the same chunk
180.Lchkmem: # > 16EB or tprot got a program check 181.Lchkmem: # > 16EB or tprot got a program check
182 lghi %r8,1 # set program check flag
183.Lsavchk:
181 clgr %r4,%r5 # chunk size > 0? 184 clgr %r4,%r5 # chunk size > 0?
182 je .Lchkloop 185 je .Lchkloop
183 stg %r4,0(%r3) # store start address of chunk 186 stg %r4,0(%r3) # store start address of chunk
@@ -204,8 +207,15 @@ startup_continue:
204 chi %r10, 0 # do we have chunks left? 207 chi %r10, 0 # do we have chunks left?
205 je .Ldonemem 208 je .Ldonemem
206.Lhsaskip: 209.Lhsaskip:
210 chi %r8,1 # program check ?
211 je .Lpgmchk
212 lgr %r4,%r5 # potential new chunk
213 algr %r5,%r1 # add 128KB to end of chunk
214 j .Llpcnt
215.Lpgmchk:
207 algr %r5,%r1 # add 128KB to end of chunk 216 algr %r5,%r1 # add 128KB to end of chunk
208 lgr %r4,%r5 # potential new chunk 217 lgr %r4,%r5 # potential new chunk
218.Llpcnt:
209 clgr %r5,%r9 # should we go on? 219 clgr %r5,%r9 # should we go on?
210 jl .Lloop 220 jl .Lloop
211.Ldonemem: 221.Ldonemem: