Skip to contentSkip to conversation

s390x: Make tests bootable from disk

PATCH Janosch Frank 1 participant 1 message Dec 6, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nlF7pXhWkj4beqhpvXVirCSfksnUr8T6v
Content-Type: multipart/mixed; boundary="f7LT2k2KSckD2XfX1P0MZVEA6rEp5XpQa";
protected-headers="v1"
From: Janosch Frank <[email protected]>
To: David Hildenbrand <[email protected]>, [email protected]
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Subject: Re: [kvm-unit-tests PATCH v2 2/6] s390x: Make tests bootable from
disk
References: <[email protected]>
<[email protected]> <[email protected]>
In-Reply-To: <[email protected]>

--f7LT2k2KSckD2XfX1P0MZVEA6rEp5XpQa
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Quoted 38 lines · David Hildenbrand
Quoted 37 lines · Janosch Frank

Currently tests are run with the --kernel option of Qemu, which will load the ELF file and jump to the start address. When booting from disk, we need to specify a start address. This is done by setting the initial short PSW at 0x0.

---
 s390x/cstart64.S | 9 ++++++++-
 s390x/flat.lds   | 8 +++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
s390x/cstart64.S +0 -0
index dc7ddd6..d382497 100644
@@ -14,9 +14,16 @@

=20
.section .init
=20

s390x/cstart64.S +8 -1
-/* entry point - for KVM + TCG we directly start in 64 bit mode */
+/*
+ * Short init between 0x10000 and 0x10480 and then jump to 0x11000.
+ * 0x10480 - 0x11000 are written to by bootloader.
+ *
+ * For KVM and TCG kernel boot we are in 64 bit z/Arch mode.
+ * When booting from disk the initial short psw is in 31 bit mode.
+ */
 	.globl start
 start:
+	sam64				# Set addressing mode to 64 bit
 	/* setup stack */
 	larl	%r15, stackptr
 	/* setup initial PSW mask + control registers*/
s390x/flat.lds +0 -0
index b6e2172..7cfd9f9 100644
Quoted 8 lines

s390x/flat.lds line 4

Quoted 5 lines
s390x/flat.lds +2 -0
@@ -1,10 +1,16 @@
 SECTIONS
 {
+	.lowcore : {
+		. =3D 0;

=20
Can you add a comment here describing what this is and what it does? (31bit PSW jumping to start to be used for booting from disk)

Sure

Quoted 13 lines

=20

s390x/flat.lds line 13

Quoted 10 lines
s390x/flat.lds +5 -1
+		 LONG(0x00080000)
+		 LONG(0x80010000)
+	}
+	. =3D 0x10000;
 	.text : {
 		*(.init)
 		. =3D 0x480;
 		ipl_args =3D .;
-		. =3D 0x600;
+		.  =3D 0x1000;

=20
Can you give me a hint why that change is needed?

Martin told me that it's saver to start again at 0x11000 you never know how long the command line will be or if someone writes other stuff in the= re.

Quoted 7 lines

=20

s390x/flat.lds line 16

Quoted 4 lines
s390x/flat.lds +0 -0
 		*(.text)
 		*(.text.*)
 	}

=20
=20

--f7LT2k2KSckD2XfX1P0MZVEA6rEp5XpQa--

--nlF7pXhWkj4beqhpvXVirCSfksnUr8T6v
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJcCPhjAAoJEONU5rjiOLn46bgQAIf6ZGKhy75bukfJp8mo5zrX 9S816E720zjHfx1cLI451Dgtug5dI0BMK59ErTTfxPfVZoWUeVkubLUHli8pKBvI U54D+SleJ5vbtGodeJrztPAP3ad9NPksYDzeI9Zpemdbhm/3lQsQkFUilxemVts0 UF8D/jy76nfNtUbKgV55B4Xgb+sDwbfHVU2fz9yNgpuwgnRuK7wIYNWAVI0BCro2 U8+L9xRJNcBGpnz78BLm29rLQKh4/Iqg4FyUAX/PHiioN5G7A+wUr+CJRcL2sUeR YT9JrwJSvYnnoY7e6yIpEbHvPiy0d9f81EDKG8SefsA+XKsY7LlC2JiXGw9vRHeR 7N3lVFHWhS/p1UqMZ4T/50aNqPZAwM2sg8YwgAmNyryse8RfotuNfA0ebqz8EtK5 d2qFUoUo3hUR777UR+UKw7IncUeGwR4qVBiO8J4/P90lREeueeFHA0jBG0fIW3bw L91ucH3ckGpC6Lv3gMSHIjEQe/Uh5/OjsexneZGz6bIr6ffog4ZfUN8b+DDorz6e 742u1Gw7UoMdr0elwWiTgypcg6BZzFqq0+y5Z9EfpidtMfktaU98gHDXylX9YRjI K0qm1fj1LwU9Ussrbm2qTWOKZp2/zfBqWvSJ64Yy+5ZOgobmj3EIQr8VG18ReJSb exWtuwOgXGbHWNUIywy8
=TQBd
-----END PGP SIGNATURE-----

--nlF7pXhWkj4beqhpvXVirCSfksnUr8T6v--