SHA256
1
0
forked from pool/kexec-tools
Dominique Leuenberger 2024-08-13 11:22:44 +00:00 committed by Git OBS Bridge
commit 711f940b6f
9 changed files with 49 additions and 154 deletions

View File

@ -1,88 +0,0 @@
From: Michel Lind <salimma@fedoraproject.org>
Subject: Fix building on x86_64 with binutils 2.41
Git-commit: 328de8e00e298f00d7ba6b25dc3950147e9642e6
Patch-mainline:
References:
Acked-by: Jiri Bohac <jbohac@suse.cz>
Newer versions of the GNU assembler (observed with binutils 2.41) will
complain about the ".arch i386" in files assembled with "as --64",
with the message "Error: 64bit mode not supported on 'i386'".
Fix by moving ".arch i386" below the relevant ".code32" directive, so
that the assembler is no longer expecting 64-bit instructions to be used
by the time that the ".arch i386" directive is encountered.
Based on similar iPXE fix:
https://github.com/ipxe/ipxe/commit/6ca597eee
Signed-off-by: Michel Lind <michel@michel-slm.name>
Signed-off-by: Simon Horman <horms@kernel.org>
diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S
index 5167944..12e1164 100644
--- a/purgatory/arch/i386/entry32-16-debug.S
+++ b/purgatory/arch/i386/entry32-16-debug.S
@@ -25,10 +25,10 @@
.globl entry16_debug_pre32
.globl entry16_debug_first32
.globl entry16_debug_old_first32
- .arch i386
.balign 16
entry16_debug:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S
index c051aab..eace095 100644
--- a/purgatory/arch/i386/entry32-16.S
+++ b/purgatory/arch/i386/entry32-16.S
@@ -20,10 +20,10 @@
#undef i386
.text
.globl entry16, entry16_regs
- .arch i386
.balign 16
entry16:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S
index f7a494f..8ce9e31 100644
--- a/purgatory/arch/i386/entry32.S
+++ b/purgatory/arch/i386/entry32.S
@@ -20,10 +20,10 @@
#undef i386
.text
- .arch i386
.globl entry32, entry32_regs
entry32:
.code32
+ .arch i386
/* Setup a gdt that should that is generally usefully */
lgdt %cs:gdt
diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S
index 201bb2c..a212eed 100644
--- a/purgatory/arch/i386/setup-x86.S
+++ b/purgatory/arch/i386/setup-x86.S
@@ -21,10 +21,10 @@
#undef i386
.text
- .arch i386
.globl purgatory_start
purgatory_start:
.code32
+ .arch i386
/* Load a gdt so I know what the segment registers are */
lgdt %cs:gdt
--
2.43.0

View File

@ -1,59 +0,0 @@
From: Jiri Bohac <jbohac@suse.cz>
Subject: [PATCH] kexec: dont use kexec_file_load on XEN
Patch-mainline: 94fbe64fb22d61726ca0c0996987574b6c783c19
References: bsc#1218590
Since commit 29fe5067ed07 ("kexec: make -a the default")
kexec tries the kexec_file_load syscall first and only falls back to kexec_load on
selected error codes.
This effectively breaks kexec on XEN, unless -c is pecified to force the kexec_load
syscall.
The XEN-specific functions (xen_kexec_load / xen_kexec_unload) are only called
from my_load / k_unload, i.e. the kexec_load code path.
With -p (panic kernel) kexec_file_load on XEN fails with -EADDRNOTAVAIL (crash
kernel reservation is ignored by the kernel on XEN), which is not in the list
of return codes that cause the fallback to kexec_file.
Without -p kexec_file_load actualy leads to a kernel oops on v6.4.0
(needs to be dubugged separately).
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Fixes: 29fe5067ed07 ("kexec: make -a the default")
---
kexec/kexec.8 | 1 +
kexec/kexec.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/kexec/kexec.8 b/kexec/kexec.8
index b969cea..9e995fe 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -162,6 +162,7 @@ Specify that the new kernel is of this
.TP
.BI \-s\ (\-\-kexec-file-syscall)
Specify that the new KEXEC_FILE_LOAD syscall should be used exclusively.
+Ignored on XEN.
.TP
.BI \-c\ (\-\-kexec-syscall)
Specify that the old KEXEC_LOAD syscall should be used exclusively.
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 08edfca..9d0ec46 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1685,6 +1685,10 @@ int main(int argc, char *argv[])
}
}
}
+ if (xen_present()) {
+ do_kexec_file_syscall = 0;
+ do_kexec_fallback = 0;
+ }
if (do_kexec_file_syscall) {
if (do_load_jump_back_helper && !do_kexec_fallback)
die("--load-jump-back-helper not supported with kexec_file_load\n");
--
2.43.0

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d2f0ef872f39e2fe4b1b01feb62b0001383207239b9f8041f98a95564161d053
size 312524

BIN
kexec-tools-2.0.29.tar.sign Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67b1ac503aade45a54db0bc79228a8830a35d5d4f83cee932cff3e7a81a4a9ec
size 314576

View File

@ -0,0 +1,23 @@
From: Petr Tesarik <ptesarik@suse.com>
Subject: riscv: fix build with hotplug support
Upstream: not yet, blocked by base RISC-V patches
Commit 3c47f384f1c4 ("kexec_load: Use new kexec flag for hotplug support")
adds a new architecture-specific function named arch_do_exclude_segment.
Since RISC-V does not yet implement hotplug updates in the kernel, add a
trivial definition of this function to kexec-tools.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Index: kexec-tools-2.0.29/kexec/arch/riscv/kexec-riscv.c
===================================================================
--- kexec-tools-2.0.29.orig/kexec/arch/riscv/kexec-riscv.c
+++ kexec-tools-2.0.29/kexec/arch/riscv/kexec-riscv.c
@@ -362,3 +362,8 @@ int arch_compat_trampoline(struct kexec_
void arch_update_purgatory(struct kexec_info *UNUSED(info))
{
}
+
+int arch_do_exclude_segment(struct kexec_info *UNUSED(info), struct kexec_segment *UNUSED(segment))
+{
+ return 0;
+}

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Mon Aug 12 11:15:32 UTC 2024 - Petr Tesařík <ptesarik@suse.com>
- update to 2.0.29:
* update man and --help
* powerpc/kexec_load: add hotplug support
* kexec_load: Use new kexec flag for hotplug support
* x86-linux-setup.c: Use POSIX basename API
* LoongArch: fix load command line segment error
* LoongArch: add multi crash kernel segment support
* LoongArch: fix kernel image size error
* Arm: Fix add_buffer_phys_virt() align issue
* Fix incorrect Free Software Foundation address in the license
* util_lib/elf_info.c: fix a warning
* kexec_file: add kexec_file flag to support debug printing
* workflow: update to use checkout@v4
- drop kexec-dont-use-kexec_file_load-on-xen.patch, upstream
- drop fix-building-on-x86_64-with-binutils-2.41.patch, upstream
- kexec-tools-riscv-hotplug.patch: Fix build for riscv64.
-------------------------------------------------------------------
Wed Mar 6 16:46:15 UTC 2024 - Jiri Bohac <jbohac@suse.com>

View File

@ -18,7 +18,7 @@
# Temporarily bump version to aid package split
Name: kexec-tools
Version: 2.0.28
Version: 2.0.29
Release: 0
Summary: Tools for loading replacement kernels into memory
License: GPL-2.0-or-later
@ -34,8 +34,7 @@ Patch4: %{name}-vmcoreinfo-in-xen.patch
# https://patchwork.kernel.org/project/linux-riscv/patch/20190416123233.4779-1-mick@ics.forth.gr/
Patch5: %{name}-riscv64.patch
Patch10: %{name}-SYS_getrandom.patch
Patch11: kexec-dont-use-kexec_file_load-on-xen.patch
Patch12: fix-building-on-x86_64-with-binutils-2.41.patch
Patch11: %{name}-riscv-hotplug.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: systemd-rpm-macros
@ -44,7 +43,7 @@ BuildRequires: zlib-devel
#!BuildIgnore: gcc-PIE
Requires: perl-Bootloader >= 1.6
Requires(post): suse-module-tools
Requires(postun):suse-module-tools
Requires(postun): suse-module-tools
%{?systemd_requires}
%if 0%{?suse_version} == 1600
# No Xen