From a4a538caca140a8e948bbdae2be311168db7a1eb Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Tue, 2 May 2017 16:51:53 -0400 Subject: [PATCH] Fix for Linux 4.10 and later kdump dumpfiles, or kernels that have backported commit 401721ecd1dcb0a428aa5d6832ee05ffbdbffbbe, titled "kexec: export the value of phys_base instead of symbol address". Without the patch, if the x86_64 "phys_base" value in the VMCOREINFO note is a negative negative decimal number, the crash session fails during session intialization with a "page excluded" or "seek error" when reading "page_offset_base". (anderson@redhat.com) --- x86_64.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x86_64.c b/x86_64.c index 74a0268..04364f9 100644 --- a/x86_64.c +++ b/x86_64.c @@ -6219,11 +6219,14 @@ x86_64_calc_phys_base(void) * Linux 4.10 exports it in VMCOREINFO (finally). */ if ((p1 = pc->read_vmcoreinfo("NUMBER(phys_base)"))) { - machdep->machspec->phys_base = dtol(p1, QUIET, NULL); - free(p1); + if (*p1 == '-') + machdep->machspec->phys_base = dtol(p1+1, QUIET, NULL) * -1; + else + machdep->machspec->phys_base = dtol(p1, QUIET, NULL); if (CRASHDEBUG(1)) - fprintf(fp, "VMCOREINFO: phys_base: %lx\n", - machdep->machspec->phys_base); + fprintf(fp, "VMCOREINFO: NUMBER(phys_base): %s -> %lx\n", + p1, machdep->machspec->phys_base); + free(p1); return; }