]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390: correct _stext offset
authorVasily Gorbik <gor@linux.ibm.com>
Wed, 27 Jun 2018 15:32:53 +0000 (17:32 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 2 Jul 2018 09:24:59 +0000 (11:24 +0200)
Avoid unnecessary rewrite of psw and merge _stext into
startup_continue. This allows to move _stext definition to vmlinux.lds.S,
where _etext is also defined and set _stext to the actual beginning of
.text at 0x100000.

This fixes the problem with setting the last .text page as
not-executable due to vmem_map_init relying on page alinged _stext and
_etext.

Fixes: bd79d6632958 ("s390/decompressor: trim the kernel image up to 1M")
Reported-by: Nils Hoppmann <niho@de.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/head64.S
arch/s390/kernel/vmlinux.lds.S

index 6f43faeaaf32ba3e5a15438241a2f39aa0e7f846..6d14ad42ba883b0e1c7a9a3065633aa2b2d40240 100644 (file)
@@ -48,11 +48,23 @@ ENTRY(startup_continue)
 # Early machine initialization and detection functions.
 #
        brasl   %r14,startup_init
-       lpswe   .Lentry-.LPG1(13)       # jump to _stext in primary-space,
-                                       # virtual and never return ...
+
+# check control registers
+       stctg   %c0,%c15,0(%r15)
+       oi      6(%r15),0x60            # enable sigp emergency & external call
+       oi      4(%r15),0x10            # switch on low address proctection
+       lctlg   %c0,%c15,0(%r15)
+
+       lam     0,15,.Laregs-.LPG1(%r13)        # load acrs needed by uaccess
+       brasl   %r14,start_kernel               # go to C code
+#
+# We returned from start_kernel ?!? PANIK
+#
+       basr    %r13,0
+       lpswe   .Ldw-.(%r13)            # load disabled wait psw
+
        .align  16
 .LPG1:
-.Lentry:.quad  0x0000000180000000,_stext
 .Lctl: .quad   0x04040000              # cr0: AFP registers & secondary space
        .quad   0                       # cr1: primary space segment table
        .quad   .Lduct                  # cr2: dispatchable unit control table
@@ -85,27 +97,5 @@ ENTRY(startup_continue)
        .endr
 .Llinkage_stack:
        .long   0,0,0x89000000,0,0,0,0x8a000000,0
-
-#
-# startup-code, running in absolute addressing mode
-#
-ENTRY(_stext)
-       basr    %r13,0                  # get base
-.LPG3:
-# check control registers
-       stctg   %c0,%c15,0(%r15)
-       oi      6(%r15),0x60            # enable sigp emergency & external call
-       oi      4(%r15),0x10            # switch on low address proctection
-       lctlg   %c0,%c15,0(%r15)
-
-       lam     0,15,.Laregs-.LPG3(%r13)        # load acrs needed by uaccess
-       brasl   %r14,start_kernel       # go to C code
-#
-# We returned from start_kernel ?!? PANIK
-#
-       basr    %r13,0
-       lpswe   .Ldw-.(%r13)            # load disabled wait psw
-
-       .align  8
 .Ldw:  .quad   0x0002000180000000,0x0000000000000000
 .Laregs:.long  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
index 35f7ca8a1685f4fab18e543348b45a5fdc222267..b3e95b9d99defc69a0918e605226de4fbf6fda3d 100644 (file)
@@ -31,6 +31,7 @@ PHDRS {
 SECTIONS
 {
        . = 0x100000;
+       _stext = .;             /* Start of text section */
        .text : {
                /* Text and read-only data */
                HEAD_TEXT