[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 0/4] collect kdump targets and improve kdump per those information
by Xunlei Pang
This patch series solves https://bugzilla.redhat.com/1451717
We collect all the kdump targets i.e. devices recognized under kdump,
then improve kdump according to the type of the target.
If we know there is no crypt target, we can remove dracut "crypt" module,
we only add rd.lvm.lv=X regarding the lvm target to kdump.
Xunlei Pang (4):
kdump-lib.sh: fix inproper get_block_dump_target()
kdumpctl: collect all the kdump targets
kdumpctl: use generated rd.lvm.lv=X
mkdumprd: omit crypt when there is no crypt kdump target
kdump-lib.sh | 44 ++++++++++++++++++++-----
kdumpctl | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
mkdumprd | 39 ++++++++++++++--------
3 files changed, 158 insertions(+), 31 deletions(-)
--
1.8.3.1
6 years, 2 months
[PATCH v3 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 v2:
-----------------
- Replaced usage of kdump config file name/absolute path with MACROs
at all relevant places.
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-kdump.sh | 7 +-
dracut-module-setup.sh | 8 +-
fadump-howto.txt | 8 +-
kdump-create-config.sh | 373 +++++++++++++++++++++++++++++++++++++++++++++
kdump-lib-initramfs.sh | 3 +-
kdump-lib.sh | 21 +--
kdump.conf | 4 +-
kdump.conf.5 | 43 +++++-
kdumpctl | 30 ++--
kexec-kdump-howto.txt | 18 +--
kexec-tools.spec | 30 ++--
live-image-kdump-howto.txt | 2 +-
mkdumprd | 13 +-
mkdumprd.8 | 4 +-
14 files changed, 486 insertions(+), 78 deletions(-)
create mode 100755 kdump-create-config.sh
--
2.7.4
6 years, 3 months
[PATCH v2 0/4] Fix rpmlint issue 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 3 fixes several instances of hardcoded-library-path errors.
2. Patch 4 fixes a couple of whitespace errors.
While at it, we also try to improve the way /lib*/kdump paths are
used in the kdump helper scripts via Patch 1 and 2.
Changes since v1:
----------------
~ Addressed the issue with kdump helper scripts where they use /lib*/kdump
as the path of the kdump helper scripts irrespective of whether
they are running on a 64-bit machine.
Bhupesh Sharma (4):
kdump-dep-generator.sh: Use uniform source path for kdump-lib.sh
Make kdump helper scripts use proper lib paths when referring to
/lib*/kdump path
kexec-tools.spec: Fix hardcoded-library-path errors
kexec-tools.spec: Fix whitespace errors
dracut-module-setup.sh | 19 ++++++++++++++++---
kdump-dep-generator.sh | 14 +++++++++++++-
kdumpctl | 15 ++++++++++++++-
kexec-tools.spec | 18 +++++++++---------
mkdumprd | 16 +++++++++++++++-
5 files changed, 67 insertions(+), 15 deletions(-)
--
2.7.4
6 years, 3 months
[PATCH] aarch64: Add makedumpfile executable
by Pratyush Anand
Add makedumpfile executable for aarch64 as well.
Signed-off-by: Pratyush Anand <panand(a)redhat.com>
---
kexec-tools.spec | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index d0496dd2fff1..da2ec56ed717 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -147,7 +147,7 @@ cp %{SOURCE21} .
cp %{SOURCE27} .
make
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
make -C eppic/libeppic
make -C makedumpfile-1.6.1 LINKTYPE=dynamic USELZO=on USESNAPPY=on
make -C makedumpfile-1.6.1 LDFLAGS="-I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so
@@ -190,7 +190,7 @@ install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5
install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/kdump.service
install -m 755 -D %{SOURCE22} $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system-generators/kdump-dep-generator.sh
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
install -m 755 makedumpfile-1.6.1/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile
install -m 644 makedumpfile-1.6.1/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
install -m 644 makedumpfile-1.6.1/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
@@ -296,7 +296,7 @@ done
%{_bindir}/*
%{_datadir}/kdump
%{_prefix}/lib/kdump
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
%{_sysconfdir}/makedumpfile.conf.sample
%endif
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/kdump
@@ -316,7 +316,7 @@ done
%doc kexec-kdump-howto.txt
%doc kdump-in-cluster-environment.txt
%doc live-image-kdump-howto.txt
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
%{_libdir}/eppic_makedumpfile.so
/usr/share/makedumpfile/eppic_scripts/
%endif
--
2.9.3
6 years, 3 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