[PATCH v2] kdump.sysconfig.s390: Remove "prot_virt" from kdump kernel cmdline
by Philipp Rudo
"prot_virt" enables the kernel to run Secure Execution virtual machines
on s390. These virtual machines are isolated from the hypervisor and
thus protected against tampering by a malicious host. Enabling
"prot_virt" requires a minimum of ~2.5GB memory which exceeds what is
typically reserved for the crashkernel. Thus remove "prot_virt" from the
command line for the 2nd kernel to prevent it to run out-of-memory.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
---
v1 -> v2:
* Improve commit message
kdump.sysconfig.s390x | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 439e462..234cfe9 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
--
2.31.1
2 years, 8 months
[PATCH] kdump.sysconfig.s390: Remove "prot_virt" from kdump kernel cmdline
by Philipp Rudo
"prot_virt" enables host protected virtual machines on s390. This
requires a minimum of ~2.5GB memory and thus exceeds what is typically
reserved for the crashkernel. Thus remove "prot_virt" from the command
line for the 2nd kernel to prevent it to run out-of-memory.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
---
kdump.sysconfig.s390x | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 439e462..234cfe9 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
--
2.31.1
2 years, 8 months
Re: [RESEND PATCH] kdump/ppc64: rebuild initramfs image after migration
by Pingfan Liu
On Mon, Jul 12, 2021 at 6:04 PM Hari Bathini <hbathini(a)linux.ibm.com> wrote:
>
> Dump capture initramfs needs rebuild after partition migration (LPM).
> Use servicelog notification mechanism to invoke kdump rebuild after
> migration.
>
> Signed-off-by: Hari Bathini <hbathini(a)linux.ibm.com>
> ---
>
> * Rebased on recent changes.
>
>
> kdump-migrate-action.sh | 8 ++++++++
> kdump-restart.sh | 8 ++++++++
> kexec-tools.spec | 16 ++++++++++++++++
> 3 files changed, 32 insertions(+)
> create mode 100755 kdump-migrate-action.sh
> create mode 100644 kdump-restart.sh
>
> diff --git a/kdump-migrate-action.sh b/kdump-migrate-action.sh
> new file mode 100755
> index 0000000..c516639
> --- /dev/null
> +++ b/kdump-migrate-action.sh
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +
> +systemctl is-active kdump
> +if [ $? -ne 0 ]; then
> + exit 0
> +fi
> +
> +/usr/lib/kdump/kdump-restart.sh
> diff --git a/kdump-restart.sh b/kdump-restart.sh
> new file mode 100644
> index 0000000..a9ecfc1
> --- /dev/null
> +++ b/kdump-restart.sh
> @@ -0,0 +1,8 @@
> +#!/bin/bash
> +export PATH="$PATH:/usr/bin:/usr/sbin"
> +
> +exec >>/var/log/kdump-migration.log 2>&1
> +
> +echo "kdump: Partition Migration detected. Rebuilding initramfs image to reload."
> +/usr/bin/kdumpctl rebuild
> +/usr/bin/kdumpctl reload
> diff --git a/kexec-tools.spec b/kexec-tools.spec
> index 98d39fe..1106d6b 100644
> --- a/kexec-tools.spec
> +++ b/kexec-tools.spec
> @@ -42,6 +42,8 @@ Source31: kdump-logger.sh
> Source32: mkfadumprd
> Source33: 92-crashkernel.install
> Source34: crashkernel-howto.txt
> +Source35: kdump-migrate-action.sh
> +Source36: kdump-restart.sh
>
> #######################################
> # These are sources for mkdumpramfs
> @@ -61,6 +63,9 @@ Source200: dracut-fadump-init-fadump.sh
> Source201: dracut-fadump-module-setup.sh
>
> Requires(post): systemd-units
> +%ifarch ppc64 ppc64le
> +Requires(post): servicelog
> +%endif
> Requires(preun): systemd-units
> Requires(postun): systemd-units
> Requires(pre): coreutils sed zlib
> @@ -199,6 +204,10 @@ install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
> install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
> install -m 755 %{SOURCE23} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
> install -m 755 %{SOURCE31} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-logger.sh
> +%ifarch ppc64 ppc64le
> +install -m 755 %{SOURCE35} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-migrate-action.sh
> +install -m 755 %{SOURCE36} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-restart.sh
> +%endif
> %ifnarch s390x
> install -m 755 %{SOURCE28} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
> %endif
> @@ -265,6 +274,13 @@ mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{d
> %systemd_post kdump.service
>
> touch /etc/kdump.conf
> +
> +ARCH=`uname -m`
> +if [ "$ARCH" == "ppc64" ] || [ "$ARCH" == "ppc64le" ]
> +then
> + servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin
> +fi
> +
> # This portion of the script is temporary. Its only here
> # to fix up broken boxes that require special settings
> # in /etc/sysconfig/kdump. It will be removed when
>
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
2 years, 8 months
[PATCH] kdumpctl: fix a typo
by Kairui Song
Recommanded -> Recommended
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
kdumpctl | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index c5b210c..9e4005f 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1243,7 +1243,7 @@ do_estimate() {
local kdump_mods
local -A large_mods
local baseline
- local kernel_size mod_size initrd_size baseline_size runtime_size reserved_size estimated_size recommanded_size
+ local kernel_size mod_size initrd_size baseline_size runtime_size reserved_size estimated_size recommended_size
local size_mb=$(( 1024 * 1024 ))
setup_initrd
@@ -1301,13 +1301,13 @@ do_estimate() {
estimated_size=$((kernel_size + mod_size + initrd_size + runtime_size + crypt_size))
if [[ $baseline_size -gt $estimated_size ]]; then
- recommanded_size=$baseline_size
+ recommended_size=$baseline_size
else
- recommanded_size=$estimated_size
+ recommended_size=$estimated_size
fi
echo "Reserved crashkernel: $((reserved_size / size_mb))M"
- echo "Recommanded crashkernel: $((recommanded_size / size_mb))M"
+ echo "Recommended crashkernel: $((recommended_size / size_mb))M"
echo
echo "Kernel image size: $((kernel_size / size_mb))M"
echo "Kernel modules size: $((mod_size / size_mb))M"
@@ -1325,8 +1325,8 @@ do_estimate() {
done
fi
- if [[ $reserved_size -le $recommanded_size ]]; then
- echo "WARNING: Current crashkernel size is lower than recommanded size $((recommanded_size / size_mb))M."
+ if [[ $reserved_size -le $recommended_size ]]; then
+ echo "WARNING: Current crashkernel size is lower than recommended size $((recommended_size / size_mb))M."
fi
}
--
2.31.1
2 years, 8 months
[PATCH] Revert "Revert "x86_64: enable the kexec file load by default""
by Coiby Xu
This reverts commit 073c30973cf45ce0cea7bfd2bb30c5449a041a54, i.e.
re-enable the kexec file load by default since this dual signature
issue no longer bothers Fedora 34.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdump.sysconfig.x86_64 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index 1285506..188ba3c 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -28,7 +28,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory
#
# Example:
# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS=""
+KEXEC_ARGS="-s"
#Where to find the boot image
#KDUMP_BOOTDIR="/boot"
--
2.32.0
2 years, 8 months
[PATCH] ppc64: update howto.txt for steps needed after migration
by Hari Bathini
The documentation talks about rebuilding the initramfs image after
partition migration. While it is implicit that a kdump reload is
needed after initramfs image is built, mention that explicitly to
avoid missing that step inadvertently.
As initramfs image rebuild is needed for fadump as well, add the
steps for the same under fadump-howto.txt.
Signed-off-by: Hari Bathini <hbathini(a)linux.ibm.com>
---
fadump-howto.txt | 17 +++++++++++++++++
kexec-kdump-howto.txt | 4 ++++
2 files changed, 21 insertions(+)
diff --git a/fadump-howto.txt b/fadump-howto.txt
index 433e9a6..0eeba42 100644
--- a/fadump-howto.txt
+++ b/fadump-howto.txt
@@ -171,6 +171,23 @@ perform postmortem analysis:
and so on...
+
+Notes on fadump
+===============
+
+To save memory usage and disk space, the initramfs is generated strictly
+against the system it will run on, and contains the minimum set of kernel
+modules and utilities for dump capture.
+
+With kdump service enabled, kdumpctl will try to detect possible system
+change and rebuild the initramfs if needed. But it can not guarantee to
+cover every possible case. So after a hardware change, disk migration,
+storage setup update or any similar system level changes, it's highly
+recommended to rebuild the initramfs manually with following command:
+
+ # kdumpctl rebuild
+
+
Saving vmcore-dmesg.txt
-----------------------
Kernel log bufferes are one of the most important information available
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 88af607..bb9c221 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -163,6 +163,10 @@ recommended to rebuild the initramfs manually with following command:
# kdumpctl rebuild
+and run reload to ensure rebuilt initramfs is used while loading kdump:
+
+ # kdumpctl reload
+
Saving vmcore-dmesg.txt
=======================
2 years, 8 months
[RESEND PATCH] kdump/ppc64: rebuild initramfs image after migration
by Hari Bathini
Dump capture initramfs needs rebuild after partition migration (LPM).
Use servicelog notification mechanism to invoke kdump rebuild after
migration.
Signed-off-by: Hari Bathini <hbathini(a)linux.ibm.com>
---
* Rebased on recent changes.
kdump-migrate-action.sh | 8 ++++++++
kdump-restart.sh | 8 ++++++++
kexec-tools.spec | 16 ++++++++++++++++
3 files changed, 32 insertions(+)
create mode 100755 kdump-migrate-action.sh
create mode 100644 kdump-restart.sh
diff --git a/kdump-migrate-action.sh b/kdump-migrate-action.sh
new file mode 100755
index 0000000..c516639
--- /dev/null
+++ b/kdump-migrate-action.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+systemctl is-active kdump
+if [ $? -ne 0 ]; then
+ exit 0
+fi
+
+/usr/lib/kdump/kdump-restart.sh
diff --git a/kdump-restart.sh b/kdump-restart.sh
new file mode 100644
index 0000000..a9ecfc1
--- /dev/null
+++ b/kdump-restart.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+export PATH="$PATH:/usr/bin:/usr/sbin"
+
+exec >>/var/log/kdump-migration.log 2>&1
+
+echo "kdump: Partition Migration detected. Rebuilding initramfs image to reload."
+/usr/bin/kdumpctl rebuild
+/usr/bin/kdumpctl reload
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 98d39fe..1106d6b 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -42,6 +42,8 @@ Source31: kdump-logger.sh
Source32: mkfadumprd
Source33: 92-crashkernel.install
Source34: crashkernel-howto.txt
+Source35: kdump-migrate-action.sh
+Source36: kdump-restart.sh
#######################################
# These are sources for mkdumpramfs
@@ -61,6 +63,9 @@ Source200: dracut-fadump-init-fadump.sh
Source201: dracut-fadump-module-setup.sh
Requires(post): systemd-units
+%ifarch ppc64 ppc64le
+Requires(post): servicelog
+%endif
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(pre): coreutils sed zlib
@@ -199,6 +204,10 @@ install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
install -m 755 %{SOURCE23} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
install -m 755 %{SOURCE31} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-logger.sh
+%ifarch ppc64 ppc64le
+install -m 755 %{SOURCE35} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-migrate-action.sh
+install -m 755 %{SOURCE36} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-restart.sh
+%endif
%ifnarch s390x
install -m 755 %{SOURCE28} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
%endif
@@ -265,6 +274,13 @@ mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{d
%systemd_post kdump.service
touch /etc/kdump.conf
+
+ARCH=`uname -m`
+if [ "$ARCH" == "ppc64" ] || [ "$ARCH" == "ppc64le" ]
+then
+ servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin
+fi
+
# This portion of the script is temporary. Its only here
# to fix up broken boxes that require special settings
# in /etc/sysconfig/kdump. It will be removed when
2 years, 8 months
[PATCH] Cleanup dead systemd services before start sysroot.mount
by Kairui Song
When kdump failed due to initqueue timeout, the sysroot.mount and other
serivces could be stuck in `start` but `dead` status:
Example output of systemctl:
dev-disk-by\x2duuid-530830d1\x2df2c7\x2d4c9a\x2d9a82\x2d148609097521.device loaded inactive dead start
<... snip ...>
squash-root.mount loaded active mounted /squash/root
squash.mount loaded active mounted /squash
sysroot.mount loaded inactive dead start /sysroot
<... snip ...>
dracut-cmdline.service loaded active exited dracut cmdline hook
dracut-initqueue.service loaded activating start start dracut initqueue hook
dracut-mount.service loaded inactive dead start dracut mount hook
At this point calling `systemctl start sysroot.mount` will just hang as
systemd will just wait for the services that are stuck in `start`
status. So call `systemctl cancel` here to cancel all pending jobs and
have a clean start for mounting sysroot.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
This patch is from patch series:
[PATCH 0/2] Fix kdump hang when failure_action is dump_to_rootfs
It turns out PATCH 1/2 of that patch series is not needed.
kdump-lib-initramfs.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index ca6a825..4cd18e4 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -227,6 +227,8 @@ dump_to_rootfs()
systemctl start dracut-initqueue
fi
+ dinfo "Clean up dead systemd services"
+ systemctl cancel
dinfo "Waiting for rootfs mount, will timeout after 90 seconds"
systemctl start sysroot.mount
--
2.31.1
2 years, 8 months
[PATCH 0/2] Fix kdump hang when failure_action is dump_to_rootfs
by Kairui Song
Kdump kernel might hang if it failed due to initqueue timeout, and
failure_action is set to dump_to_rootfs.
That's because dracut initqueue will start it's own emergency handler
and bypass kdump emergency handler. And recently dracut will enable
initqueue more often so this will more likely to happen.
And we removed the force isolation of kdump error handler in
commit a230634 to avoid failing dracut initqueue multiple times (which
may cause failure loop in this case), so `systemctl start sysroot.mount`
might also hang even if kdump error handler is called.
So two things are fixed in this series:
1. Use a emergency hook to start kdump error handler when initqueue
failed.
2. Do a soft reset of pending jobs, so `dead` services won't block
sysroot.mount.
Kairui Song (2):
module-setup.sh: add kdump-error-handler to emergency hooks
Cleanup dead systemd services before start sysroot.mount
dracut-module-setup.sh | 1 +
kdump-lib-initramfs.sh | 2 ++
2 files changed, 3 insertions(+)
--
2.31.1
2 years, 8 months
[PATCH] kdump/ppc64: rebuild initramfs image after migration
by Hari Bathini
Dump capture initramfs needs rebuild after partition migration (LPM).
Use servicelog notification mechanism to invoke kdump rebuild after
migration.
Signed-off-by: Hari Bathini <hbathini(a)linux.ibm.com>
---
kdump-migrate-action.sh | 8 ++++++++
kdump-restart.sh | 8 ++++++++
kexec-tools.spec | 16 ++++++++++++++++
3 files changed, 32 insertions(+)
create mode 100755 kdump-migrate-action.sh
create mode 100644 kdump-restart.sh
diff --git a/kdump-migrate-action.sh b/kdump-migrate-action.sh
new file mode 100755
index 0000000..c516639
--- /dev/null
+++ b/kdump-migrate-action.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+systemctl is-active kdump
+if [ $? -ne 0 ]; then
+ exit 0
+fi
+
+/usr/lib/kdump/kdump-restart.sh
diff --git a/kdump-restart.sh b/kdump-restart.sh
new file mode 100644
index 0000000..a9ecfc1
--- /dev/null
+++ b/kdump-restart.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+export PATH="$PATH:/usr/bin:/usr/sbin"
+
+exec >>/var/log/kdump-migration.log 2>&1
+
+echo "kdump: Partition Migration detected. Rebuilding initramfs image to reload."
+/usr/bin/kdumpctl rebuild
+/usr/bin/kdumpctl reload
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 8fed959..1f7244a 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -40,6 +40,8 @@ Source29: kdump.sysconfig.aarch64
Source30: 60-kdump.install
Source31: kdump-logger.sh
Source32: mkfadumprd
+Source33: kdump-migrate-action.sh
+Source34: kdump-restart.sh
#######################################
# These are sources for mkdumpramfs
@@ -59,6 +61,9 @@ Source200: dracut-fadump-init-fadump.sh
Source201: dracut-fadump-module-setup.sh
Requires(post): systemd-units
+%ifarch ppc64 ppc64le
+Requires(post): servicelog
+%endif
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(pre): coreutils sed zlib
@@ -195,6 +200,10 @@ install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
install -m 755 %{SOURCE23} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
install -m 755 %{SOURCE31} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-logger.sh
+%ifarch ppc64 ppc64le
+install -m 755 %{SOURCE33} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-migrate-action.sh
+install -m 755 %{SOURCE34} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-restart.sh
+%endif
%ifnarch s390x
install -m 755 %{SOURCE28} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
%endif
@@ -260,6 +269,13 @@ mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{d
%systemd_post kdump.service
touch /etc/kdump.conf
+
+ARCH=`uname -m`
+if [ "$ARCH" == "ppc64" ] || [ "$ARCH" == "ppc64le" ]
+then
+ servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin
+fi
+
# This portion of the script is temporary. Its only here
# to fix up broken boxes that require special settings
# in /etc/sysconfig/kdump. It will be removed when
2 years, 8 months