Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9497864 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky
Browse files

s390: correct _stext offset



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: bd79d663 ("s390/decompressor: trim the kernel image up to 1M")
Reported-by: default avatarNils Hoppmann <niho@de.ibm.com>
Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 183ab05f
Loading
Loading
Loading
Loading
+15 −25
Original line number Original line Diff line number Diff line
@@ -48,11 +48,23 @@ ENTRY(startup_continue)
# Early machine initialization and detection functions.
# Early machine initialization and detection functions.
#
#
	brasl	%r14,startup_init
	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
	.align	16
.LPG1:
.LPG1:
.Lentry:.quad	0x0000000180000000,_stext
.Lctl:	.quad	0x04040000		# cr0: AFP registers & secondary space
.Lctl:	.quad	0x04040000		# cr0: AFP registers & secondary space
	.quad	0			# cr1: primary space segment table
	.quad	0			# cr1: primary space segment table
	.quad	.Lduct			# cr2: dispatchable unit control table
	.quad	.Lduct			# cr2: dispatchable unit control table
@@ -85,27 +97,5 @@ ENTRY(startup_continue)
	.endr
	.endr
.Llinkage_stack:
.Llinkage_stack:
	.long	0,0,0x89000000,0,0,0,0x8a000000,0
	.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
.Ldw:	.quad	0x0002000180000000,0x0000000000000000
.Laregs:.long	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.Laregs:.long	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+1 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ PHDRS {
SECTIONS
SECTIONS
{
{
	. = 0x100000;
	. = 0x100000;
	_stext = .;		/* Start of text section */
	.text : {
	.text : {
		/* Text and read-only data */
		/* Text and read-only data */
		HEAD_TEXT
		HEAD_TEXT