From d55a0565585aa22db069cf5f5fa1955373be60b3 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Thu, 12 Jan 2023 16:31:06 +0100 Subject: [PATCH] kdumpctl: move aws workaround to kdump-lib Move the workaround for aws graviton cpus from load_kdump to prepare_cmdline. This (1) makes the workaround available also for other callers of prepare_cmdline (although not needed at the moment) and (2) makes it easier to fix the problems found by the unit test included earlier as all changes to the cmdline are done at one place now. Signed-off-by: Philipp Rudo Reviewed-by: Coiby Xu --- kdump-lib.sh | 9 +++++++++ kdumpctl | 17 ----------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/kdump-lib.sh b/kdump-lib.sh index 0109b95..bea74b2 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -22,6 +22,11 @@ is_fadump_capable() return 1 } +is_aws_aarch64() +{ + [[ "$(lscpu | grep "BIOS Model name")" =~ "AWS Graviton" ]] +} + is_squash_available() { local _version kmodule @@ -846,6 +851,10 @@ prepare_cmdline() fi done + # This is a workaround on AWS platform. Always remove irqpoll since it + # may cause the hot-remove of some pci hotplug device. + is_aws_aarch64 && cmdline=$(remove_cmdline_param "${cmdline}" irqpoll) + echo "$cmdline" } diff --git a/kdumpctl b/kdumpctl index dd4bae6..ce3f23f 100755 --- a/kdumpctl +++ b/kdumpctl @@ -656,18 +656,6 @@ function remove_kdump_kernel_key() keyctl unlink "$KDUMP_KEY_ID" %:.ima } -function is_aws_aarch64() -{ - local _bios_model - - _bios_model=$(lscpu | grep "BIOS Model name") - if [[ "${_bios_model}" =~ "AWS Graviton" ]]; then - return 0 - fi - - return 1 -} - # Load the kdump kernel specified in /etc/sysconfig/kdump # If none is specified, try to load a kdump kernel with the same version # as the currently running kernel. @@ -677,11 +665,6 @@ load_kdump() KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}") KDUMP_COMMANDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}") - # This is a workaround on AWS platform, since irqpoll may cause the hot-remove of some pci hotplug device - if is_aws_aarch64; then - KDUMP_COMMANDLINE=$(remove_cmdline_param "${KDUMP_COMMANDLINE}" irqpoll) - 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.