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: bd79d66329 ("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>
This commit is contained in:
Vasily Gorbik 2018-06-27 17:32:53 +02:00 коммит произвёл Martin Schwidefsky
Родитель 183ab05ff2
Коммит c949786450
2 изменённых файлов: 16 добавлений и 25 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -31,6 +31,7 @@ PHDRS {
SECTIONS
{
. = 0x100000;
_stext = .; /* Start of text section */
.text : {
/* Text and read-only data */
HEAD_TEXT