import OL kexec-tools-2.0.25-13.0.1.el9_2.1

This commit is contained in:
Andrew Lukoshko 2023-06-22 14:54:43 +00:00
parent 899c5f5857
commit 1cbf40d3e1
10 changed files with 353 additions and 5 deletions

View File

@ -0,0 +1,72 @@
From 58553ad03187f0cf208d6c4a0dc026c6338e5edd Mon Sep 17 00:00:00 2001
From: "Daisuke Hatayama (Fujitsu)" <d.hatayama@fujitsu.com>
Date: Wed, 29 Mar 2023 12:44:10 +0000
Subject: [PATCH] sadump: fix failure of reading memory when 5-level
paging is enabled
makedumpfile fails as follows for memory dumps collected by sadump
when 5-level paging is enabled on the corresponding systems:
# makedumpfile -l -d 31 -x ./vmlinux ./dump.sadump dump.sadump-ld31
__vtop4_x86_64: Can't get a valid pgd.
...snip...
__vtop4_x86_64: Can't get a valid pgd.
calc_kaslr_offset: failed to calculate kaslr_offset and phys_base; default to 0
__vtop4_x86_64: Can't get a valid pgd.
readmem: Can't convert a virtual address(ffffffff82fce960) to physical address.
readmem: type_addr: 0, addr:ffffffff82fce960, size:1024
cpu_online_mask_init: Can't read cpu_online_mask memory.
makedumpfile Failed.
This is because 5-level paging support has not been done yet for
sadump; the work of the 5-level paging support was done by the commit
30a3214a7193e94c551c0cebda5918a72a35c589 (PATCH 4/4 arch/x86_64: Add
5-level paging support) but that was focused on the core part only.
Having said that, most of things has already been finished in the
commit. What needs to be newly added for sadump is just how to check
if 5-level paging is enabled for a given memory dump.
For that purpose, let's refer to CR4.LA57, bit 12 of CR4, representing
whether 5-level paging is enabled or not. We can do this because
memory dumps collected by sadump have SMRAM as note information and
they include CR4 together with the other control registers.
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
---
sadump_info.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/makedumpfile-1.7.2/sadump_info.c b/makedumpfile-1.7.2/sadump_info.c
index adfa8dc..2c44068 100644
--- a/makedumpfile-1.7.2/sadump_info.c
+++ b/makedumpfile-1.7.2/sadump_info.c
@@ -1362,6 +1362,7 @@ static int linux_banner_sanity_check(ulong cr3)
#define PTI_USER_PGTABLE_BIT (info->page_shift)
#define PTI_USER_PGTABLE_MASK (1 << PTI_USER_PGTABLE_BIT)
#define CR3_PCID_MASK 0xFFFull
+#define CR4_LA57 (1 << 12)
int
calc_kaslr_offset(void)
{
@@ -1397,6 +1398,8 @@ calc_kaslr_offset(void)
else
cr3 = smram.Cr3 & ~CR3_PCID_MASK;
+ NUMBER(pgtable_l5_enabled) = !!(smram.Cr4 & CR4_LA57);
+
/* Convert virtual address of IDT table to physical address */
idtr_paddr = vtop4_x86_64_pagetable(idtr, cr3);
if (idtr_paddr == NOT_PADDR) {
@@ -1417,6 +1420,7 @@ calc_kaslr_offset(void)
DEBUG_MSG("sadump: idtr=%" PRIx64 "\n", idtr);
DEBUG_MSG("sadump: cr3=%" PRIx64 "\n", cr3);
+ DEBUG_MSG("sadump: cr4=%" PRIx32 "\n", smram.Cr4);
DEBUG_MSG("sadump: idtr(phys)=%" PRIx64 "\n", idtr_paddr);
DEBUG_MSG("sadump: devide_error(vmlinux)=%lx\n",
divide_error_vmlinux);
--
2.33.1

View File

@ -0,0 +1,30 @@
From 9a81be0511c005216217fffc757804c9b8485817 Mon Sep 17 00:00:00 2001
From: Darren Archibald <darren.archibald@oracle.com>
Date: Thu, 5 May 2022 02:32:37 -0700
Subject: [PATCH]
orabug30352094-makedumpfile-Mark-mem-usage-option-unsupported-for-a
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
---
makedumpfile-1.7.1/makedumpfile.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/makedumpfile-1.7.2/makedumpfile.c b/makedumpfile-1.7.2/makedumpfile.c
index 3ad4443..51f863c 100644
--- a/makedumpfile-1.7.2/makedumpfile.c
+++ b/makedumpfile-1.7.2/makedumpfile.c
@@ -12022,6 +12022,11 @@ main(int argc, char *argv[])
MSG("\n");
MSG("The dmesg log is saved to %s.\n", info->name_dumpfile);
} else if (info->flag_mem_usage) {
+#ifdef __aarch64__
+ MSG("mem-usage not supported for arm64 architecure.\n");
+ goto out;
+#endif
+
if (!check_param_for_creating_dumpfile(argc, argv)) {
MSG("Commandline parameter is invalid.\n");
MSG("Try `makedumpfile --help' for more information.\n");
--
2.27.0

View File

@ -0,0 +1,33 @@
This patch is an adaptation of OL7 similar patch for aarch64
arm64: skip memory integrity checks in purgatory
This takes place with caches disabled and can be very slow on arm64.
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Patch migrated from ol8 to ol9 without any modification
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
--- kdumpctl.old 2020-11-05 01:29:19.000000000 -0800
+++ kdumpctl 2020-11-05 01:39:56.986731735 -0800
@@ -18,6 +18,7 @@
#kdump shall be the default dump mode
DEFAULT_DUMP_MODE="kdump"
image_time=0
+ARCH=$(uname -m)
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
. $dracutbasedir/dracut-functions.sh
@@ -687,6 +688,12 @@
KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}")
KDUMP_COMMANDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}")
+ # arm64: skip memory integrity checks in purgatory
+ if [ "$ARCH" == "aarch64" ]
+ then
+ KEXEC_ARGS="$KEXEC_ARGS --no-checks"
+ fi
+
# For secureboot enabled machines, use new kexec file based syscall.
# Old syscall will always fail as it does not have capability to
# to kernel signature verification.

View File

@ -0,0 +1,25 @@
Patch migrated from ol8 to ol9 without any modification
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
------
--- kdump.sysconfig.aarch64.old 2020-02-06 04:55:47.000000000 -0800
+++ kdump.sysconfig.aarch64 2020-02-06 05:06:18.044773574 -0800
@@ -21,7 +21,7 @@
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0 iommu=off"
# Any additional kexec arguments required. In most situations, this should
# be left empty
--- kdump.sysconfig.x86_64.old 2020-02-06 04:55:47.000000000 -0800
+++ kdump.sysconfig.x86_64 2020-02-06 05:06:30.568969077 -0800
@@ -21,7 +21,7 @@
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0 iommu=off"
# Any additional kexec arguments required. In most situations, this should
# be left empty

View File

@ -0,0 +1,17 @@
Patch migrated from ol8 to ol9 without any modification
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
----
--- kdumpctl.old 2020-11-05 01:39:56.000000000 -0800
+++ kdumpctl 2020-11-05 01:41:30.240246343 -0800
@@ -33,6 +33,11 @@
. /etc/sysconfig/kdump
fi
+# append no_timer_check for xen guest kdump
+if [ "$ARCH" == "x86_64" ] && $(virt-what |grep -qE "^xen$|^xen-domU$|^xen-hvm$"); then
+ KDUMP_COMMANDLINE_APPEND="${KDUMP_COMMANDLINE_APPEND} no_timer_check"
+fi
+
single_instance_lock()
{
local rc timeout=5

View File

@ -0,0 +1,14 @@
Patch migrated from ol8 to ol9 without any modification
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
------
--- kdump.sysconfig.x86_64.old 2020-11-08 03:49:42.000000000 -0800
+++ kdump.sysconfig.x86_64 2020-11-08 03:50:07.094669060 -0800
@@ -28,7 +28,7 @@
#
# Example:
# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
+KEXEC_ARGS=""
#Where to find the boot image
#KDUMP_BOOTDIR="/boot"

View File

@ -0,0 +1,27 @@
From 66a0b1dfe597f219a83ca30ee4c916cb5a6b2ae7 Mon Sep 17 00:00:00 2001
From: John Donnelly <john.p.donnelly@oracle.com>
Date: Fri, 30 Apr 2021 15:08:32 -0700
Subject: [PATCH {kexec-tools } ] Remove -s from kdump.sysconfig.aarch64,
Orabug 32804496
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
---
kdump.sysconfig.aarch64 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
index 2ab2893..6f7830a 100644
--- kdump.sysconfig.aarch64.old
+++ kdump.sysconfig.aarch64
@@ -28,7 +28,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory
#
# Example:
# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
+KEXEC_ARGS=""
#Where to find the boot image
#KDUMP_BOOTDIR="/boot"
--
2.27.0

View File

@ -0,0 +1,41 @@
kdump: Skip LVM private devices
Orabug: 33822070
Orabug: 33574003
As per the commit 20e1c3dc0339 ("libblkid: ignore private LVM devices") in
util-linux, the virtual private LVM devices do not contain any blkid relevant data
and it does not make any sense to scan for superblocks or partitions
on the devices.
The blkid command is expected to fail if it is run on these LVM devices. This
change skips the scanning of LVM private metadata devices when scanning for
underlying crypt devices.
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
kdump-lib.sh | 7 +++++++
1 file changed, 7 insertions(+)
--- a/kdump-lib.sh 2022-10-10 15:26:42.287897779 -0400
+++ b/kdump-lib.sh 2022-10-10 15:27:51.158973691 -0400
@@ -919,6 +919,13 @@ get_luks_crypt_dev()
[[ -b /dev/block/$1 ]] || return 1
+ # blkid will fail if it is run on a LVM private. Make sure blkid succeeds before proceeding.
+ blkid -u filesystem,crypto -o export -- /dev/block/$1 > /dev/null
+ if [ $? -ne 0 ]
+ then
+ return 1
+ fi
+
_type=$(blkid -u filesystem,crypto -o export -- "/dev/block/$1" | \
sed -n -E "s/^TYPE=(.*)$/\1/p")
[[ $_type == "crypto_LUKS" ]] && echo "$1"
--
2.31.1

View File

@ -0,0 +1,36 @@
From 595a1b05d89033064267a71401d2f22cce7d1a4a Mon Sep 17 00:00:00 2001
From: "john.p.donnelly" <john.p.donnelly@oracle.com>
Date: Tue, 14 Jun 2022 06:57:10 -0400
Subject: [PATCH] Update UEK reserved sizes
Orabug: 34240246
Orabug: 34391412
Orabug: 34663083
Set the proper default reservations we need for UEK for both x86_64 and aarch64.
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
---
kdump-lib.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kdump-lib.sh 2022-10-10 15:38:13.942660163 -0400
+++ a/kdump-lib.sh 2022-10-10 15:43:30.939009570 -0400
@@ -879,10 +879,10 @@ kdump_get_arch_recommend_crashkernel()
_arch=$(uname -m)
if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then
- _ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M"
+ _ck_cmdline="1G-64G:448M,64G-:512M"
elif [[ $_arch == "aarch64" ]]; then
# For 4KB page size, the formula is based on x86 plus extra = 64M
- _ck_cmdline="1G-4G:256M,4G-64G:320M,64G-:576M"
+ _ck_cmdline="2G-8G:256M,8G-:1G"
elif [[ $_arch == "ppc64le" ]]; then
if [[ $_dump_mode == "fadump" ]]; then
_ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
--
2.31.1

View File

@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.25
Release: 13%{?dist}
Release: 13.0.1%{?dist}.1
License: GPLv2
Summary: The kexec/kdump userspace component
@ -72,6 +72,7 @@ Requires: dracut >= 050
Requires: dracut-network >= 050
Requires: dracut-squash >= 050
Requires: ethtool
Requires: virt-what
Recommends: grubby
Recommends: hostname
BuildRequires: make
@ -113,6 +114,17 @@ Patch301: kexec-tools-2.0.25-ppc64-ppc64-remove-rma_top-limit.patch
#
# Patches 601 onward are generic patches
#
Patch601: kexec-tools-2.0.23-makedumpfile-1.7.2-sadump-fix-failure-of-reading-memory-when-5-le.patch
# Oracle patches
Patch1000: orabug30352094-makedumpfile-Mark-mem-usage-option-unsupported-for-a.patch
Patch1001: orabug30822387.kdumpctl-arm64-fast-boot.patch
Patch1002: orabug30832988.kdump.sysconfig.iommu_off.x86_64.aarch64.patch
Patch1003: orabug30928441.kdumpctl.no_timer_check.patch
Patch1004: orabug32127375-kdump.sysconfig.no.double.s.patch
Patch1007: orabug3280449-Remove-s-from-kdump.sysconfig.aarch64.patch
Patch1008: orabug33822070-kdump-skip-lvm-private-devices.patch
Patch1009: orabug34663083-Update-UEK-reserved-sizes.patch
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
@ -129,6 +141,8 @@ tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
%patch301 -p1
%patch601 -p1
%patch1000 -p1
%ifarch ppc
%define archdef ARCH=ppc
@ -184,12 +198,23 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump
mkdir -p -m755 $RPM_BUILD_ROOT%{_sharedstatedir}/kdump
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl
patch $RPM_BUILD_ROOT%{_bindir}/kdumpctl %{PATCH1001}
patch $RPM_BUILD_ROOT%{_bindir}/kdumpctl %{PATCH1003}
install -m 755 build/sbin/kexec $RPM_BUILD_ROOT/usr/sbin/kexec
install -m 755 build/sbin/vmcore-dmesg $RPM_BUILD_ROOT/usr/sbin/vmcore-dmesg
install -m 644 build/man/man8/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 644 build/man/man8/vmcore-dmesg.8 $RPM_BUILD_ROOT%{_mandir}/man8/
#apply kdump sysconfig patches, if there are any
patch -d $RPM_SOURCE_DIR -p0 < %{PATCH1002}
patch -d $RPM_SOURCE_DIR -p0 < %{PATCH1004}
patch -d $RPM_SOURCE_DIR -p0 < %{PATCH1007}
#apply kdump-lib patches
patch -d $RPM_SOURCE_DIR -p1 < %{PATCH1008}
patch -d $RPM_SOURCE_DIR -p1 < %{PATCH1009}
SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu}
[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_arch}
[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig
@ -197,6 +222,7 @@ install -m 644 $SYSCONFIG $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/sbin/mkdumprd
install -m 644 kdump.conf $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf
#mkdumprd should be patched after installation, not before
install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8
install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
@ -228,10 +254,8 @@ install -m 755 -D %{SOURCE33} $RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/92-
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
install -m 755 makedumpfile-%{mkdf_ver}/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile
gzip -c makedumpfile-%{mkdf_ver}/makedumpfile.8 > makedumpfile-%{mkdf_ver}/makedumpfile.8.gz
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
gzip -c makedumpfile-%{mkdf_ver}/makedumpfile.conf.5 > makedumpfile-%{mkdf_ver}/makedumpfile.conf.5.gz
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8.in $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5.in $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.in
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
install -m 755 makedumpfile-%{mkdf_ver}/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
mkdir -p $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/
@ -428,6 +452,35 @@ fi
%endif
%changelog
* Wed Jun 21 2023 EL Errata <el-errata_ww@oracle.com> - 2.0.25-13.0.1
- Update UEK aarch64 reserved sizes for UEK7 kernels [Orabug: 34663083]
- Correct UEK reserved size for x86_64 [Orabug: 34391412]
- Update UEK reserved sizes [Orabug: 34240246]
- fix virt-what related warning with kdumpctl script execution [Orabug: 33790973]
- fix saving vmcore-dmesg.txt failed on aarch64 with UEK7 [Orabug: 34003037]
- include OL8 patch for sysconfig, its needed on OL9 [Orabug: 33512440]
- Update makedumpfile to 1.7.2 [Orabug: 34219368]
- kdump: skip lvm private devices [Orabug: 33822070] [Orabug: 33574003]
- Added dracut module setup patches [Orabug: 29518713] [Orabug: 22780125]
- Added orabug30352094-makedumpfile-Mark-mem-usage-option-unsupported-for-a.patch [Orabug: 30352094]
- Added orabug30822387.kdumpctl-arm64-fast-boot.patch [Orabug: 30822387]
- Added orabug30832988.kdump.sysconfig.iommu_off.x86_64.aarch64.patch [Orabug: 30832988]
- Added orabug30928441.kdumpctl.no_timer_check.patch [Orabug: 30928441]
- Added orabug32127375-kdump.sysconfig.no.double.s.patch [Orabug: 32127375]
- Added orabug32258986-arm64-support-more-than-one-crash-kernel-regions.patch [Orabug: 32258986]
- Removed orabug32258986-arm64-support-more-than-one-crash-kernel-regions.patch [Orabug: 32258986]
- Removed orabug34003037-arm64-crashdump-deduce-paddr-of-_text-based-on-kerne.patch [Orabug: 34003037]
- Removed orabug34003037-arm64-make-phys_offset-signed.patch [Orabug: 34003037]
- Removed orabug34003037-arm64-crashdump-unify-routine-to-get-page_offset.patch [Orabug: 34003037]
- Removed orabug34003037-arm64-read-VA_BITS-from-kcore-for-52-bits-VA-kernel.patch [Orabug: 34003037]
- Removed orabug34003037-arm64-fix-PAGE_OFFSET-calc-for-flipped-mm.patch [Orabug: 34003037]
- Removed orabug34003037-kdump-kexec-fix-saving-vmcore-dmesg.txt-failed-on-aa.patch [Orabug: 34003037]
- Fix formatting for orabug33822070-kdump-skip-lvm-private-devices.patch [Orabug: 33822070]
- Rework orabug34663083-Update-UEK-reserved-sizes.patch [Orabug: 34240246]
* Fri May 5 2023 Tao Liu <ltao@redhat.com> - 2.0.25-13.1
- makedumpfile: sadump: fix failure of reading memory when 5-level
* Fri Mar 10 2023 Tao Liu <ltao@redhat.com> - 2.0.25-13
- kdump-lib: Add the CoreOS kernel dir to the boot_dirlist
- kdump-lib: attempt to fix BOOT_IMAGE detection