From 3c661da4ee5bc287243272dbc1bac75847ca7c44 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 12 Jan 2021 19:30:43 +0100 Subject: [PATCH] genprotimg: boot: make boot loader -march=z900 compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the `lgfi` opcode with equivalents as z900 has no support for it. While at it, fix a comment in `genprotimg/boot/head.S` and remove a useless label in `genprotimg/boot/stage3b_reloc.S`. Closes: https://github.com/ibm-s390-tools/s390-tools/issues/86 Reviewed-by: Philipp Rudo Reviewed-by: Claudio Imbrenda Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- genprotimg/boot/head.S | 6 ++++-- genprotimg/boot/stage3a_init.S | 4 +++- genprotimg/boot/stage3b_reloc.S | 8 +++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/genprotimg/boot/head.S b/genprotimg/boot/head.S index 8fae4604..bfa35f6e 100644 --- a/genprotimg/boot/head.S +++ b/genprotimg/boot/head.S @@ -1,5 +1,5 @@ /* - * Entry code for stage 3a boot loader + * Entry code for stage 3a and stage 3b boot loader * * Copyright IBM Corp. 2020 * @@ -24,6 +24,8 @@ _start: sam64 /* Initialize stack */ - lgfi %r15, STACK_ADDRESS + STACK_SIZE - STACK_FRAME_OVERHEAD + basr %r13, 0 +.Lbase: llgf %r15, .Lstack - .Lbase(%r13) brasl %r14, initialize +.Lstack: .long STACK_ADDRESS + STACK_SIZE - STACK_FRAME_OVERHEAD .previous diff --git a/genprotimg/boot/stage3a_init.S b/genprotimg/boot/stage3a_init.S index 87c8d754..43dd02b3 100644 --- a/genprotimg/boot/stage3a_init.S +++ b/genprotimg/boot/stage3a_init.S @@ -21,6 +21,8 @@ _init: * kernel command line and the address and size of the * ramdisk. Simply ignore this by starting at 0x11000. */ - lgfi %r1, STAGE3A_ENTRY + basr %r13, 0 +.Lbase: llgf %r1, .Lstage3a_entry - .Lbase(%r13) br %r1 +.Lstage3a_entry: .long STAGE3A_ENTRY .previous diff --git a/genprotimg/boot/stage3b_reloc.S b/genprotimg/boot/stage3b_reloc.S index 7b2242db..a7c4cf50 100644 --- a/genprotimg/boot/stage3b_reloc.S +++ b/genprotimg/boot/stage3b_reloc.S @@ -31,12 +31,12 @@ stage3b_reloc_start: sigp %r1, %r0, SIGP_SET_ARCHITECTURE sam64 -.copy_stage3b: /* Location of stage3b in memory */ larl %r8, stage3b_start /* Destination for stage3b */ - lgfi %r9, STAGE3B_LOAD_ADDRESS + basr %r13, 0 +.Lbase: llgf %r9, .Lstage3b_load_address - .Lbase(%r13) /* Size of stage3b */ lghi %r11, stage3b_end - stage3b_start @@ -45,8 +45,10 @@ stage3b_reloc_start: MEMCPY %r9, %r8, %r11 /* Branch to STAGE3B_ENTRY */ - lgfi %r9, STAGE3B_ENTRY + llgf %r9, .Lstage3b_entry - .Lbase(%r13) br %r9 +.Lstage3b_load_address: .long STAGE3B_LOAD_ADDRESS +.Lstage3b_entry: .long STAGE3B_ENTRY stage3b_start: .incbin "stage3b.bin" stage3b_end: