Pull button into test branch
[linux-drm-fsl-dcu.git] / arch / s390 / kernel / head64.S
index 48998d50b00abd7bdbc48640354ca15e56b03fe9..c526279e11239dc65e5c8c8a0b585d3ca1556a04 100644 (file)
@@ -70,7 +70,20 @@ startup_continue:
        sgr     %r5,%r5                 # set src,length and pad to zero
        mvcle   %r2,%r4,0               # clear mem
        jo      .-4                     # branch back, if not finish
+                                       # set program check new psw mask
+       mvc     __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13)
+       larl    %r1,.Lslowmemdetect     # set program check address
+       stg     %r1,__LC_PGM_NEW_PSW+8
+       lghi    %r1,0xc
+       diag    %r0,%r1,0x260           # get memory size of virtual machine
+       cgr     %r0,%r1                 # different? -> old detection routine
+       jne     .Lslowmemdetect
+       aghi    %r1,1                   # size is one more than end
+       larl    %r2,memory_chunk
+       stg     %r1,8(%r2)              # store size of chunk
+       j       .Ldonemem
 
+.Lslowmemdetect:
        l       %r2,.Lrcp-.LPG1(%r13)   # Read SCP forced command word
 .Lservicecall:
        stosm   .Lpmask-.LPG1(%r13),0x01        # authorize ext interrupts
@@ -139,8 +152,6 @@ startup_continue:
        .int    0x100000
 
 .Lfchunk:
-                                       # set program check new psw mask
-       mvc     __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13)
 
 #
 # find memory chunks.
@@ -175,8 +186,6 @@ startup_continue:
        stg     %r0,8(%r3)              # store size of chunk
        st      %r6,20(%r3)             # store type of chunk
        la      %r3,24(%r3)
-       larl    %r8,memory_size
-       stg     %r5,0(%r8)              # store memory size
        ahi     %r10,-1                 # update chunk number
 .Lchkloop:
        lr      %r6,%r7                 # set access code to last cc
@@ -250,6 +259,17 @@ startup_continue:
        oi      7(%r12),0x80            # set IDTE flag
 0:
 
+#
+# find out if the diag 0x9c is available
+#
+       la      %r1,0f-.LPG1(%r13)      # set program check address
+       stg     %r1,__LC_PGM_NEW_PSW+8
+       stap    __LC_CPUID+4            # store cpu address
+       lh      %r1,__LC_CPUID+4
+       diag    %r1,0,0x9c              # test diag 0x9c
+       oi      6(%r12),1               # set diag9c flag
+0:
+
 #
 # find out if we have the MVCOS instruction
 #