From b33257d65369c083a669f7f5156a72b8f6dcc0d603c532f20ee153e775edfeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Thu, 22 Feb 2018 13:17:16 +0000 Subject: [PATCH 1/2] Accepting request 579009 from home:ptesarik:branches:Kernel:kdump - kdump-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch: calibrate: Do not add KDUMP_PHYS_LOAD to required RAM. - kdump-bootloader-filter-out-KDUMPTOOL_FLAGS.patch: bootloader: Filter out KDUMPTOOL_FLAGS (bsc#1072584). OBS-URL: https://build.opensuse.org/request/show/579009 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=153 --- ...ootloader-filter-out-KDUMPTOOL_FLAGS.patch | 28 +++++++++++++++++++ ...te-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch | 28 +++++++++++++++++++ kdump.changes | 8 ++++++ kdump.spec | 4 +++ 4 files changed, 68 insertions(+) create mode 100644 kdump-bootloader-filter-out-KDUMPTOOL_FLAGS.patch create mode 100644 kdump-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch diff --git a/kdump-bootloader-filter-out-KDUMPTOOL_FLAGS.patch b/kdump-bootloader-filter-out-KDUMPTOOL_FLAGS.patch new file mode 100644 index 0000000..5675b8f --- /dev/null +++ b/kdump-bootloader-filter-out-KDUMPTOOL_FLAGS.patch @@ -0,0 +1,28 @@ +From: Petr Tesarik +Date: Thu, 22 Feb 2018 14:03:26 +0100 +Subject: bootloader: Filter out KDUMPTOOL_FLAGS +References: bsc#1072584 +Upstream: merged +Git-commit: df216d1815eae7e8c4b139e0676696de4dc447d2 + +The bootloader update filters out all parameters starting with +KDUMP_, MAKEDUMPFILE_ or fadump. KDUMPTOOL_FLAGS does not match, so +it is not removed and consequently multiple instances may appear on +the command line. + +Signed-off-by: Petr Tesarik +--- + init/kdump-bootloader.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/init/kdump-bootloader.pl ++++ b/init/kdump-bootloader.pl +@@ -26,7 +26,7 @@ if ($ARGV[0] eq "--get") { + my $param = $rawparam; + $param =~ s/"//g; + $param =~ s/=(.*)//; +- if (! ($param =~ /^(KDUMP|MAKEDUMPFILE)_|^fadump$/)) { ++ if (! ($param =~ /^KDUMP(TOOL)?_|^MAKEDUMPFILE_|^fadump$/)) { + $result .= " " if length($result); + $result .= $rawparam; + } diff --git a/kdump-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch b/kdump-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch new file mode 100644 index 0000000..7a774dd --- /dev/null +++ b/kdump-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch @@ -0,0 +1,28 @@ +From: Petr Tesarik +Date: Tue, 20 Feb 2018 20:44:40 +0100 +Subject: calibrate: Do not add KDUMP_PHYS_LOAD to required RAM +Upstream: merged +Git-commit: b70cbda10aa73f72f2324b8f9bf58918b59c9a86 + +The memory between 0 and KDUMP_PHYS_LOAD is not really allocated to +the panic kernel. It is added to the requirement merely to calculate +the memmap size for pages in this range. + +Signed-off-by: Petr Tesarik +--- + kdumptool/calibrate.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/kdumptool/calibrate.cc ++++ b/kdumptool/calibrate.cc +@@ -968,6 +968,10 @@ void Calibrate::execute() + required = prev + align_memmap(maxpfn) * SIZE_STRUCT_PAGE; + Debug::debug()->dbg("Maximum memmap size: %lu KiB", required - prev); + ++ // Memory between 0 and KDUMP_PHYS_LOAD is not really allocated, ++ // so subtract it again after memmap has been sized. ++ required -= KDUMP_PHYS_LOAD; ++ + // Make sure there is enough space at boot + Debug::debug()->dbg("Total run-time size: %lu KiB", required); + if (required < bootsize) diff --git a/kdump.changes b/kdump.changes index 18b39db..d64b844 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Feb 22 13:10:33 UTC 2018 - ptesarik@suse.com + +- kdump-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch: + calibrate: Do not add KDUMP_PHYS_LOAD to required RAM. +- kdump-bootloader-filter-out-KDUMPTOOL_FLAGS.patch: bootloader: + Filter out KDUMPTOOL_FLAGS (bsc#1072584). + ------------------------------------------------------------------- Fri Feb 9 17:46:06 UTC 2018 - ptesarik@suse.com diff --git a/kdump.spec b/kdump.spec index 07b28ba..2a35802 100644 --- a/kdump.spec +++ b/kdump.spec @@ -85,6 +85,8 @@ Patch35: %{name}-calibrate-update-user-space-requirements.patch Patch36: %{name}-bail-out-if-no-default-interface.patch Patch37: %{name}-fix-missing-index-of-kdump_Host.patch Patch38: %{name}-nsswitch.conf-filtering.patch +Patch39: %{name}-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch +Patch40: %{name}-bootloader-filter-out-KDUMPTOOL_FLAGS.patch BuildRequires: asciidoc BuildRequires: cmake BuildRequires: gcc-c++ @@ -185,6 +187,8 @@ cp %{S:1} tests/data/ %patch36 -p1 %patch37 -p1 %patch38 -p1 +%patch39 -p1 +%patch40 -p1 %build export CFLAGS="%{optflags}" From ea2ea48bad9ae20dde9c6943c8a61ea5e7162dad1b84979ce82cba4669386b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Fri, 23 Feb 2018 08:36:15 +0000 Subject: [PATCH 2/2] Accepting request 579305 from home:ptesarik:branches:Kernel:kdump - kdump-always-kexec_load-if-kexec_file_load-fails.patch: Try kexec_load(2) if kexec_file_load(2) fails for any reason (bsc#1080916). OBS-URL: https://build.opensuse.org/request/show/579305 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=154 --- ...-kexec_load-if-kexec_file_load-fails.patch | 54 +++++++++++++++++++ kdump.changes | 7 +++ kdump.spec | 2 + 3 files changed, 63 insertions(+) create mode 100644 kdump-always-kexec_load-if-kexec_file_load-fails.patch diff --git a/kdump-always-kexec_load-if-kexec_file_load-fails.patch b/kdump-always-kexec_load-if-kexec_file_load-fails.patch new file mode 100644 index 0000000..9b4c076 --- /dev/null +++ b/kdump-always-kexec_load-if-kexec_file_load-fails.patch @@ -0,0 +1,54 @@ +From: Petr Tesarik +Date: Fri, 23 Feb 2018 08:59:00 +0100 +Subject: Try kexec_load(2) if kexec_file_load(2) fails for any reason +References: bsc#1080916 +Upstream: merged +Git-commit: c9f231320fe6544b4e8aedd24a571105c4ff458a + +Currently, kexec_load(2) is attempted only if kexec_file_load(2) is +unavailable. However, kexec_file_load(2) may also fail for other +reasons (e.g. missing kernel signature). It makes sense to try the +older syscall in that case. + +Signed-off-by: Petr Tesarik +--- + init/load.sh | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +--- a/init/load.sh ++++ b/init/load.sh +@@ -164,30 +164,24 @@ function load_kdump_kexec() + + output=$(eval "$KEXEC_CALL -s" 2>&1) + result=$? +- if [ $result -eq 255 ] ; then +- echo $output | grep -q 'syscall kexec_file_load not available' && result=7 +- fi + + # print stderr in any case to show warnings that normally + # would be supressed (bnc#374185) +- echo -n "$output"; echo ++ echo "$output" + + if [ $result -eq 0 ] ; then + kdump_logger "Loaded kdump kernel: $KEXEC_CALL -s, Result: $output" + return 0 +- elif [ $result -ne 7 ]; then +- kdump_logger "FAILED to load kdump kernel: $KEXEC_CALL -s, Result: $output" +- return $result + fi + +- # kexec_file_load(2) not available +- kdump_echo "kexec_file_load(2) not available" ++ # kexec_file_load(2) failed ++ kdump_echo "kexec_file_load(2) failed" + kdump_echo "Starting load kdump kernel with kexec_load(2)" + kdump_echo "kexec cmdline: $KEXEC_CALL" + + output=$(eval "$KEXEC_CALL" 2>&1) + result=$? +- echo -n "$output";echo ++ echo "$output" + + if [ $result -eq 0 ] ; then + kdump_logger "Loaded kdump kernel: $KEXEC_CALL, Result: $output" diff --git a/kdump.changes b/kdump.changes index d64b844..79d91af 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Feb 23 08:07:59 UTC 2018 - ptesarik@suse.com + +- kdump-always-kexec_load-if-kexec_file_load-fails.patch: Try + kexec_load(2) if kexec_file_load(2) fails for any reason + (bsc#1080916). + ------------------------------------------------------------------- Thu Feb 22 13:10:33 UTC 2018 - ptesarik@suse.com diff --git a/kdump.spec b/kdump.spec index 2a35802..f88a119 100644 --- a/kdump.spec +++ b/kdump.spec @@ -87,6 +87,7 @@ Patch37: %{name}-fix-missing-index-of-kdump_Host.patch Patch38: %{name}-nsswitch.conf-filtering.patch Patch39: %{name}-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch Patch40: %{name}-bootloader-filter-out-KDUMPTOOL_FLAGS.patch +Patch41: %{name}-always-kexec_load-if-kexec_file_load-fails.patch BuildRequires: asciidoc BuildRequires: cmake BuildRequires: gcc-c++ @@ -189,6 +190,7 @@ cp %{S:1} tests/data/ %patch38 -p1 %patch39 -p1 %patch40 -p1 +%patch41 -p1 %build export CFLAGS="%{optflags}"