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 <prudo@redhat.com>
Reviewed-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
Philipp Rudo 2023-01-12 16:31:06 +01:00 committed by Coiby Xu
parent 269c26972d
commit d55a056558
2 changed files with 9 additions and 17 deletions

View File

@ -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"
}

View File

@ -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.