[PATCH] kdumpctl: use "apicid" other than "initial apicid"
by Xunlei Pang
We met a problem on AMD machines, when using "nr_cpus=4" for
kdump, and crash happens on cpus other than cpu0, kdump kernel
will fail to boot and eventually reset.
After some debugging, we found that it stuck at the kernel path
do_boot_cpu()-> ... ->wakeup_secondary_cpu_via_init():
apic_icr_write(APIC_INT_LEVELTRIG|APIC_INT_ASSERT|APIC_DM_INIT,
phys_apicid);
that is, it stuck at sending INIT from AP to BP and reset, which
is actually what "disable_cpu_apicid=X" tries to solve. Printing
the value of @phys_apicid showed that it was the value of "apicid"
other that of "initial apicid" showed by /proc/cpuinfo.
As described in x86 specification:
"In MP systems, the local APIC ID is also used as a processor ID by the
BIOS and the operating system. Some processors permit software to modify
the APIC ID. However, the ability of software to modify the APIC ID is
processor model specific. Because of this, operating system software
should avoid writing to the local APIC ID register. The value returned by
bits 31-24 of the EBX register (when the CPUID instruction is executed with a
source operand value of 1 in the EAX register) is always the Initial APIC ID
(determined by the platform initialization). This is true even if software
has changed the value in the Local APIC ID register."
From kernel commit 151e0c7de("x86, apic, kexec: Add disable_cpu_apicid
kernel parameter"), we can see in generic_processor_info(), it uses
a)read_apic_id() and b)@apicid to compare with @disabled_cpu_apicid.
a)@apicid which is actually @phys_apicid above-mentioned is from the
following calltrace(on the problematic AMD machine):
generic_processor_info+0x37/0x300
acpi_register_lapic+0x30/0x90
acpi_parse_lapic+0x40/0x50
acpi_table_parse_entries_array+0x171/0x1de
acpi_boot_init+0xed/0x50f
The value of @apicid(from acpi MADT) is equal to the value of "apicid"
showed by /proc/cpuinfo as proved by our debug printk.
b)read_apic_id() gets the value from LAPIC ID register which is "apicid"
as well.
While the value of "initial apicid" is from cpuid instruction.
One example of "apicid" and "initial apicid" of cpu0 from /proc/cpuinfo
on AMD machine:
apicid : 32
initial apicid : 0
Therefore, we should assign /proc/cpuifo "apicid" to "disable_cpu_apicid=X".
We've never met such issue before, because we usually tested "nr_cpus=1",
and mostly on Intel machines, and "apicid" and "initial apicid" have the
same value in most cases on Intel machines.
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 4d6b3e8..46b65d2 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -77,15 +77,15 @@ remove_cmdline_param()
}
#
-# This function returns the "initial apicid" of the
-# boot cpu (cpu 0) if present.
+# This function returns the "apicid" of the boot
+# cpu (cpu 0) if present.
#
-get_bootcpu_initial_apicid()
+get_bootcpu_apicid()
{
awk ' \
BEGIN { CPU = "-1"; } \
$1=="processor" && $2==":" { CPU = $NF; } \
- CPU=="0" && /initial apicid/ { print $NF; } \
+ CPU=="0" && /^apicid/ { print $NF; } \
' \
/proc/cpuinfo
}
@@ -206,7 +206,7 @@ prepare_cmdline()
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
- id=`get_bootcpu_initial_apicid`
+ id=`get_bootcpu_apicid`
if [ ! -z ${id} ] ; then
cmdline=`append_cmdline "${cmdline}" disable_cpu_apicid ${id}`
fi
--
1.8.3.1
6 years, 2 months
[PATCH] dracut-module-setup: Fix test for inclusion of DRM modules
by Benjamin Berg
The /sys/modules/*/drivers sysfs entries do not exist anymore on newer
kernels which means that the DRM moduels would never be included.
Instead check if there is any device with a "drm" sysfs directory to
decide on whether DRM modules need to be included.
---
Resend as I was not subscribed to the mailinglist.
---
dracut-module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 9f88b4e..8495fd9 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -20,7 +20,7 @@ check() {
depends() {
local _dep="base shutdown"
- if [ -d /sys/module/drm/drivers ]; then
+ if [ -n "$( find /sys/devices -name drm )" ]; then
_dep="$_dep drm"
fi
--
2.9.3
6 years, 3 months
[PATCH] kdump.conf.5: clarify the fence_kdump_nodes option
by Pingfan Liu
fence_kdump_nodes should include list of cluster node(s) except localhost.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf.5 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.conf.5 b/kdump.conf.5
index b581964..11b1fad 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -200,7 +200,7 @@ arguments except hosts to send notification to).
.B fence_kdump_nodes <node(s)>
.RS
-List of cluster node(s), separated by spaces, to send fence_kdump notification
+List of cluster node(s) except localhost, separated by spaces, to send fence_kdump notification
to (this option is mandatory to enable fence_kdump).
.RE
--
2.7.4
6 years, 3 months
[PATCH 0/2] Fix issues reported by rpmlint for kexec-tools
by Bhupesh Sharma
Resolves: BZ1433852
https://bugzilla.redhat.com/show_bug.cgi?id=1433852
This patchset fixes a couple of issues reported by rpmlint
when it is run on kexec-tools:
1. Patch 1 fixes several instances of hardcoded-library-path errors.
2. Patch 2 fixes a couple of whitespace errors.
Bhupesh Sharma (2):
kexec-tools.spec: Fix hardcoded-library-path errors
kexec-tools.spec: Fix whitespace errors
kexec-tools.spec | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
--
2.7.4
6 years, 3 months
[PATCH v2 0/3] Change kdump configuration file layout
by Bhupesh Sharma
This patchset addresses Fedora BZ1078311 and introduces a new
configuration file layout structure for the kdump files.
Changes since v1:
-----------------
- Address review comments from Pratyush
~ Break the earlier single patch into simpler patches.
~ Other review comments.
- Improve the kdump configuration file generation to do the same
automatically when a new package is installed.
Patchset Description:
--------------------
Patch 1: Start using sensible MACROs for kdump config files across other
helper scripts.
Patch 2: Improves the description at the top of kdump.conf
Patch 3: Patch which actually changes the kdump configuration file
layout.
Bhupesh Sharma (3):
Use sensible MACROs for kdump config files across other helper scripts
kdump.conf: Improve description
Change kdump configuration file layout
dracut-module-setup.sh | 10 +-
fadump-howto.txt | 8 +-
kdump-create-config.sh | 373 +++++++++++++++++++++++++++++++++++++++++++++
kdump-lib-initramfs.sh | 2 +-
kdump-lib.sh | 21 +--
kdump.conf | 4 +-
kdump.conf.5 | 43 +++++-
kdumpctl | 31 ++--
kexec-kdump-howto.txt | 18 +--
kexec-tools.spec | 30 ++--
live-image-kdump-howto.txt | 2 +-
mkdumprd | 4 +-
mkdumprd.8 | 4 +-
13 files changed, 481 insertions(+), 69 deletions(-)
create mode 100755 kdump-create-config.sh
--
2.7.4
6 years, 3 months
kdump will unconditionally to open LUKS device
by Benjamin Berg
Hi,
I was trying to configure kernel dumping (on a Fedora 25 machine). In
this case the installation is encrypted using LUKS so to make things
work I decided to dump to /boot instead.
Now, I do understand prompting for the LUKS password if the dump path
is on an encrypted device (which mkdumprd helpfully warns about).
But I don't see why dumping to e.g. an unencrypted partition like /boot
instead (or through ssh) should even try to open any LUKS devices.
There is no warning generated in that case but I still get a prompt for
the password and dumping will only proceed afterwards.
This seems odd. Mounting anything other than the dump location should
not be necessary for the dumping processes. So the LUKS device should
not be opened in this particular case. It should only happen if the
user selected an encrypted volume as the dump target.
Benjamin
6 years, 4 months
[PATCH v3] kdumpctl: for fence_kdump, the ipaddr of this node should be excluded from list
by Pingfan Liu
kdump should not send fence_kdump notifications to local host, because
the role of the falied node (i.e local host) is to send fence_kdump
notifications to other nodes to tell them I'm kdumping, tell to itself is
nonsense. And we have excluded hostname of local host but when one use ip
address we also need exclude it.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf | 4 ++--
kdumpctl | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf
index 1e24e1b..cfdaec7 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -137,8 +137,8 @@
#
# fence_kdump_nodes <node(s)>
# - List of cluster node(s), separated by spaces, to send
-# fence_kdump notifications to (this option is mandatory to
-# enable fence_kdump).
+# fence_kdump notifications to. The list should exclude this node itself!
+# (this option is mandatory to enable fence_kdump).
#
#raw /dev/vg/lv_kdump
diff --git a/kdumpctl b/kdumpctl
index 60bbd93..e440bbb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1099,6 +1099,7 @@ check_kdump_feasibility()
check_fence_kdump_config()
{
local hostname=`hostname`
+ local ipaddrs=`hostname -I`
local nodes=$(get_option_value "fence_kdump_nodes")
for node in $nodes; do
@@ -1106,6 +1107,12 @@ check_fence_kdump_config()
echo "Option fence_kdump_nodes cannot contain $hostname"
return 1
fi
+ # node can be ipaddr
+ echo $ipaddrs | grep $node > /dev/null
+ if [ $? -eq 0 ]; then
+ echo "Option fence_kdump_nodes cannot contain $node"
+ return 1
+ fi
done
return 0
--
2.7.4
6 years, 4 months
[PATCH v2] kdumpctl: for fence_kdump, the ipaddr of this node should be excluded from list
by Pingfan Liu
In kdump.conf, the fence_kdump_nodes list can be hostname or ipaddr. We have
already excluded the node's hostname from the list to avoid the deadlock issue
in capture kernel. This patch applies the same rule on ipaddr.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
v1 -> v2:
improve commit log
kdump.conf | 4 ++--
kdumpctl | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf
index 1e24e1b..cfdaec7 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -137,8 +137,8 @@
#
# fence_kdump_nodes <node(s)>
# - List of cluster node(s), separated by spaces, to send
-# fence_kdump notifications to (this option is mandatory to
-# enable fence_kdump).
+# fence_kdump notifications to. The list should exclude this node itself!
+# (this option is mandatory to enable fence_kdump).
#
#raw /dev/vg/lv_kdump
diff --git a/kdumpctl b/kdumpctl
index d43f46b..638c6b6 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1118,6 +1118,7 @@ check_kdump_feasibility()
check_fence_kdump_config()
{
local hostname=`hostname`
+ local ipaddrs=`hostname -i`
local nodes=$(get_option_value "fence_kdump_nodes")
for node in $nodes; do
@@ -1125,6 +1126,12 @@ check_fence_kdump_config()
echo "Option fence_kdump_nodes cannot contain $hostname"
return 1
fi
+ # node can be ipaddr
+ echo $ipaddrs | grep $node
+ if [ $? -eq 0 ]; then
+ echo "Option fence_kdump_nodes cannot contain $node"
+ return 1
+ fi
done
return 0
--
2.7.4
6 years, 4 months
[PATCH] kdumpctl: change the shebang header to use /bin/bash
by Xunlei Pang
We met one issue that when changing softlink of "/usr/bin/sh"
to point to "ksh" instead of the default "bash", kdumpctl will
not work and go wrong.
kdumpctl is expected to run under bash like dracut, we should
change its shebang header from "#!/bin/sh" to "#!/bin/bash".
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4d6b3e8..d35c83a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/bash
KEXEC=/sbin/kexec
KDUMP_KERNELVER=""
--
1.8.3.1
6 years, 4 months
[PATCH 1/2] Revert "kdumpctl: improve "while read" time for /etc/kdump.conf"
by Xunlei Pang
Resolves: bz1449801
"cat $KDUMP_CONFIG_FILE|grep -v "^#"|while read ..." use pipes
to invoke subshells, as a result we met "the dreaded inaccessible
variables within a subshell problem" as described in the book
"Advanced Bash-Scripting Guide".
It cause regressions, so revert it.
---
kdumpctl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 46b65d2..644cf96 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -365,11 +365,11 @@ check_config()
return 1
}
- cat $KDUMP_CONFIG_FILE | grep -v "^#" | while read config_opt config_val; do
+ while read config_opt config_val; do
# remove inline comments after the end of a directive.
config_val=$(strip_comments $config_val)
case "$config_opt" in
- "")
+ \#* | "")
;;
raw|ext2|ext3|ext4|minix|btrfs|xfs|nfs|ssh|sshkey|path|core_collector|kdump_post|kdump_pre|extra_bins|extra_modules|default|force_rebuild|force_no_rebuild|dracut_args|fence_kdump_args|fence_kdump_nodes)
[ -z "$config_val" ] && {
@@ -386,7 +386,7 @@ check_config()
return 1;
;;
esac
- done
+ done < $KDUMP_CONFIG_FILE
check_default_config || return 1
@@ -799,7 +799,7 @@ load_kdump()
check_ssh_config()
{
- cat $KDUMP_CONFIG_FILE | grep -v "^#" | while read config_opt config_val; do
+ while read config_opt config_val; do
# remove inline comments after the end of a directive.
config_val=$(strip_comments $config_val)
case "$config_opt" in
@@ -820,7 +820,7 @@ check_ssh_config()
*)
;;
esac
- done
+ done < $KDUMP_CONFIG_FILE
#make sure they've configured kdump.conf for ssh dumps
local SSH_TARGET=`echo -n $DUMP_TARGET | sed -n '/.*@/p'`
--
1.8.3.1
6 years, 4 months