Add fixes necessary for ELN build to pass

Fixing 2 issues with ELEN buildroot:

- xkeyboard-config removed legacy 'ar' map
- clang + binutils 2.4 are failing to build s390-ccw

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
This commit is contained in:
Miroslav Rezanina 2023-07-12 15:31:57 +02:00
parent feb9e9de23
commit 26c10b56ee
6 changed files with 411 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From 46ae4ae0cec2af37130f235ffea9d615f3990364 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Fri, 23 Jun 2023 12:05:20 +0200
Subject: [PATCH] keymaps: use 'ara' X11 keyboard map instead of 'ar'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The keyboard mapping name 'ar' was a legacy name only available from
xkeyboard-config via a (15 year old) backcompat mapping. This mapping
was finally removed in the latest upstream release 2.39:
https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/commit/470ad2cd8fea84d7210377161d86b31999bb5ea6
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
pc-bios/keymaps/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build
index 158a3b410..1cbcdebef 100644
--- a/pc-bios/keymaps/meson.build
+++ b/pc-bios/keymaps/meson.build
@@ -1,5 +1,5 @@
keymaps = {
- 'ar': '-l ar',
+ 'ar': '-l ara',
'bepo': '-l fr -v dvorak',
'cz': '-l cz',
'da': '-l dk',
--
2.40.1

View File

@ -0,0 +1,40 @@
From d8048e4eb5efcc52c4c77c3443a1cabbf12d087c Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Thu, 22 Jun 2023 15:08:22 +0200
Subject: [PATCH 1/4] pc-bios/s390-ccw/Makefile: Use -z noexecstack to silence
linker warning
Recent versions of ld complain when linking the s390-ccw bios:
/usr/bin/ld: warning: start.o: missing .note.GNU-stack section implies
executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in
a future version of the linker
We can silence the warning by telling the linker to mark the stack
as not executable.
Message-Id: <20230622130822.396793-1-thuth@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 442ef32ee5b6059a8f247fb2def9d449578d0a89)
---
pc-bios/s390-ccw/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
index 10e8f5cb63..2a590af4a9 100644
--- a/pc-bios/s390-ccw/Makefile
+++ b/pc-bios/s390-ccw/Makefile
@@ -53,7 +53,7 @@ config-cc.mak: Makefile
$(call cc-option,-march=z900,-march=z10)) 3> config-cc.mak
-include config-cc.mak
-LDFLAGS += -Wl,-pie -nostdlib
+LDFLAGS += -Wl,-pie -nostdlib -z noexecstack
build-all: s390-ccw.img s390-netboot.img
--
2.39.3

View File

@ -0,0 +1,211 @@
From ef50e8f94f0467d7f55745be9f58c7cd369e57c6 Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Tue, 27 Jun 2023 09:47:00 +0200
Subject: [PATCH 2/4] pc-bios/s390-ccw: Fix indentation in start.S
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
start.S is currently indented with a mixture of spaces and tabs, which
is quite ugly. QEMU coding style says indentation should be 4 spaces,
and this is also what we are using in the assembler files in the
tests/tcg/s390x/ folder already, so let's adjust start.S accordingly.
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20230627074703.99608-2-thuth@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit f52420fa4fd9f519dc42c20d2616aba4149adc25)
---
pc-bios/s390-ccw/start.S | 136 +++++++++++++++++++--------------------
1 file changed, 68 insertions(+), 68 deletions(-)
diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S
index 6072906df4..d29de09cc6 100644
--- a/pc-bios/s390-ccw/start.S
+++ b/pc-bios/s390-ccw/start.S
@@ -10,37 +10,37 @@
* directory.
*/
- .globl _start
+ .globl _start
_start:
- larl %r15, stack + 0x8000 /* Set up stack */
+ larl %r15,stack + 0x8000 /* Set up stack */
- /* clear bss */
- larl %r2, __bss_start
- larl %r3, _end
- slgr %r3, %r2 /* get sizeof bss */
- ltgr %r3,%r3 /* bss empty? */
- jz done
- aghi %r3,-1
- srlg %r4,%r3,8 /* how many 256 byte chunks? */
- ltgr %r4,%r4
- lgr %r1,%r2
- jz remainder
+ /* clear bss */
+ larl %r2,__bss_start
+ larl %r3,_end
+ slgr %r3,%r2 /* get sizeof bss */
+ ltgr %r3,%r3 /* bss empty? */
+ jz done
+ aghi %r3,-1
+ srlg %r4,%r3,8 /* how many 256 byte chunks? */
+ ltgr %r4,%r4
+ lgr %r1,%r2
+ jz remainder
loop:
- xc 0(256,%r1),0(%r1)
- la %r1,256(%r1)
- brctg %r4,loop
+ xc 0(256,%r1),0(%r1)
+ la %r1,256(%r1)
+ brctg %r4,loop
remainder:
- larl %r2,memsetxc
- ex %r3,0(%r2)
+ larl %r2,memsetxc
+ ex %r3,0(%r2)
done:
- /* set up a pgm exception disabled wait psw */
- larl %r2, disabled_wait_psw
- mvc 0x01d0(16), 0(%r2)
- j main /* And call C */
+ /* set up a pgm exception disabled wait psw */
+ larl %r2,disabled_wait_psw
+ mvc 0x01d0(16),0(%r2)
+ j main /* And call C */
memsetxc:
- xc 0(1,%r1),0(%r1)
+ xc 0(1,%r1),0(%r1)
/*
@@ -48,11 +48,11 @@ memsetxc:
*
* stops the current guest cpu.
*/
- .globl disabled_wait
+ .globl disabled_wait
disabled_wait:
- larl %r1,disabled_wait_psw
- lpswe 0(%r1)
-1: j 1b
+ larl %r1,disabled_wait_psw
+ lpswe 0(%r1)
+1: j 1b
/*
@@ -60,61 +60,61 @@ disabled_wait:
*
* eats one sclp interrupt
*/
- .globl consume_sclp_int
+ .globl consume_sclp_int
consume_sclp_int:
- /* enable service interrupts in cr0 */
- stctg %c0,%c0,0(%r15)
- oi 6(%r15),0x2
- lctlg %c0,%c0,0(%r15)
- /* prepare external call handler */
- larl %r1, external_new_code
- stg %r1, 0x1b8
- larl %r1, external_new_mask
- mvc 0x1b0(8),0(%r1)
- /* load enabled wait PSW */
- larl %r1, enabled_wait_psw
- lpswe 0(%r1)
+ /* enable service interrupts in cr0 */
+ stctg %c0,%c0,0(%r15)
+ oi 6(%r15),0x2
+ lctlg %c0,%c0,0(%r15)
+ /* prepare external call handler */
+ larl %r1,external_new_code
+ stg %r1,0x1b8
+ larl %r1,external_new_mask
+ mvc 0x1b0(8),0(%r1)
+ /* load enabled wait PSW */
+ larl %r1,enabled_wait_psw
+ lpswe 0(%r1)
/*
* void consume_io_int(void)
*
* eats one I/O interrupt
*/
- .globl consume_io_int
+ .globl consume_io_int
consume_io_int:
- /* enable I/O interrupts in cr6 */
- stctg %c6,%c6,0(%r15)
- oi 4(%r15), 0xff
- lctlg %c6,%c6,0(%r15)
- /* prepare i/o call handler */
- larl %r1, io_new_code
- stg %r1, 0x1f8
- larl %r1, io_new_mask
- mvc 0x1f0(8),0(%r1)
- /* load enabled wait PSW */
- larl %r1, enabled_wait_psw
- lpswe 0(%r1)
+ /* enable I/O interrupts in cr6 */
+ stctg %c6,%c6,0(%r15)
+ oi 4(%r15), 0xff
+ lctlg %c6,%c6,0(%r15)
+ /* prepare i/o call handler */
+ larl %r1,io_new_code
+ stg %r1,0x1f8
+ larl %r1,io_new_mask
+ mvc 0x1f0(8),0(%r1)
+ /* load enabled wait PSW */
+ larl %r1,enabled_wait_psw
+ lpswe 0(%r1)
external_new_code:
- /* disable service interrupts in cr0 */
- stctg %c0,%c0,0(%r15)
- ni 6(%r15),0xfd
- lctlg %c0,%c0,0(%r15)
- br %r14
+ /* disable service interrupts in cr0 */
+ stctg %c0,%c0,0(%r15)
+ ni 6(%r15),0xfd
+ lctlg %c0,%c0,0(%r15)
+ br %r14
io_new_code:
- /* disable I/O interrupts in cr6 */
- stctg %c6,%c6,0(%r15)
- ni 4(%r15), 0x00
- lctlg %c6,%c6,0(%r15)
- br %r14
+ /* disable I/O interrupts in cr6 */
+ stctg %c6,%c6,0(%r15)
+ ni 4(%r15),0x00
+ lctlg %c6,%c6,0(%r15)
+ br %r14
- .align 8
+ .align 8
disabled_wait_psw:
- .quad 0x0002000180000000,0x0000000000000000
+ .quad 0x0002000180000000,0x0000000000000000
enabled_wait_psw:
- .quad 0x0302000180000000,0x0000000000000000
+ .quad 0x0302000180000000,0x0000000000000000
external_new_mask:
- .quad 0x0000000180000000
+ .quad 0x0000000180000000
io_new_mask:
- .quad 0x0000000180000000
+ .quad 0x0000000180000000
--
2.39.3

View File

@ -0,0 +1,52 @@
From 5db331dc14cea38ceb96f7cd55365f7c7d326c29 Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Tue, 27 Jun 2023 09:47:01 +0200
Subject: [PATCH 3/4] pc-bios/s390-ccw: Provide space for initial stack frame
in start.S
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Providing the space of a stack frame is the duty of the caller,
so we should reserve 160 bytes before jumping into the main function.
Otherwise the main() function might write past the stack array.
While we're at it, add a proper STACK_SIZE macro for the stack size
instead of using magic numbers (this is also required for the following
patch).
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20230627074703.99608-3-thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 74fe98ee7fb3344dbd085d1fa32c0dc2fc2c831f)
---
pc-bios/s390-ccw/start.S | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S
index d29de09cc6..abd6fe6639 100644
--- a/pc-bios/s390-ccw/start.S
+++ b/pc-bios/s390-ccw/start.S
@@ -10,10 +10,13 @@
* directory.
*/
+#define STACK_SIZE 0x8000
+#define STACK_FRAME_SIZE 160
+
.globl _start
_start:
- larl %r15,stack + 0x8000 /* Set up stack */
+ larl %r15,stack + STACK_SIZE - STACK_FRAME_SIZE /* Set up stack */
/* clear bss */
larl %r2,__bss_start
--
2.39.3

View File

@ -0,0 +1,68 @@
From ee8a96338078126e17d6aa8569b4638fdfa9423b Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Tue, 27 Jun 2023 09:47:03 +0200
Subject: [PATCH 4/4] pc-bios/s390-ccw: Don't use __bss_start with the "larl"
instruction
start.S currently cannot be compiled with Clang 16 and binutils 2.40:
ld: start.o(.text+0x8): misaligned symbol `__bss_start' (0xc1e5) for
relocation R_390_PC32DBL
According to the built-in linker script of ld, the symbol __bss_start
can actually point *before* the .bss section and does not need to have
any alignment, so in certain situations (like when using the internal
assembler of Clang), the __bss_start symbol can indeed be unaligned
and thus it is not suitable for being used with the "larl" instruction
that needs an address that is at least aligned to halfwords.
The problem went unnoticed so far since binutils <= 2.39 did not
check the alignment, but starting with binutils 2.40, such unaligned
addresses are now refused.
Fix it by loading the address indirectly instead.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2216662
Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
Suggested-by: Andreas Krebbel <andreas.krebbel@de.ibm.com>
Message-Id: <20230629104821.194859-8-thuth@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 7cd50cbe4ca3e2860b31b06ec92c17c54bd82d48)
---
pc-bios/s390-ccw/start.S | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S
index abd6fe6639..22c1c296df 100644
--- a/pc-bios/s390-ccw/start.S
+++ b/pc-bios/s390-ccw/start.S
@@ -19,7 +19,8 @@ _start:
larl %r15,stack + STACK_SIZE - STACK_FRAME_SIZE /* Set up stack */
/* clear bss */
- larl %r2,__bss_start
+ larl %r2,bss_start_literal /* __bss_start might be unaligned ... */
+ lg %r2,0(%r2) /* ... so load it indirectly */
larl %r3,_end
slgr %r3,%r2 /* get sizeof bss */
ltgr %r3,%r3 /* bss empty? */
@@ -45,7 +46,6 @@ done:
memsetxc:
xc 0(1,%r1),0(%r1)
-
/*
* void disabled_wait(void)
*
@@ -113,6 +113,8 @@ io_new_code:
br %r14
.align 8
+bss_start_literal:
+ .quad __bss_start
disabled_wait_psw:
.quad 0x0002000180000000,0x0000000000000000
enabled_wait_psw:
--
2.39.3

View File

@ -373,6 +373,13 @@ Patch109: kvm-kvm-reuse-per-vcpu-stats-fd-to-avoid-vcpu-interrupti.patch
# For bz#2128929 - [rhel9.2] hotplug/hotunplug mlx vdpa device to the occupied addr port, then qemu core dump occurs after shutdown guest
Patch110: kvm-vhost-vdpa-do-not-cleanup-the-vdpa-vhost-net-structu.patch
# ELN specific changes
Patch1001: 1001-keymaps-use-ara-X11-keyboard-map-instead-of-ar.patch
Patch1002: 1002-pc-bios-s390-ccw-Makefile-Use-z-noexecstack-to-silen.patch
Patch1003: 1003-pc-bios-s390-ccw-Fix-indentation-in-start.S.patch
Patch1004: 1004-pc-bios-s390-ccw-Provide-space-for-initial-stack-fra.patch
Patch1005: 1005-pc-bios-s390-ccw-Don-t-use-__bss_start-with-the-larl.patch
%if %{have_clang}
BuildRequires: clang
%if %{have_safe_stack}