Blame SOURCES/github_5cbb2fd8_to_6c1c8ac6.patch

145e27
commit 5cbb2fd8c20c46793095522059b1efc8232df926
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Wed Nov 13 11:29:14 2019 -0500
145e27
145e27
    Add support for handling openSUSE vmlinux files which will be shipped
145e27
    in .xz compressed format.  Without the patch, only gzip and bzip2
145e27
    formats are supported.
145e27
    (jirislaby@gmail.com)
145e27
145e27
diff --git a/symbols.c b/symbols.c
145e27
index 55199fc..7e1bca7 100644
145e27
--- a/symbols.c
145e27
+++ b/symbols.c
145e27
@@ -3655,6 +3655,7 @@ is_compressed_kernel(char *file, char **tmp)
145e27
 
145e27
 #define GZIP  (1)
145e27
 #define BZIP2 (2)
145e27
+#define XZ    (3)
145e27
 
145e27
 #define FNAME (1 << 3)
145e27
 
145e27
@@ -3704,6 +3705,19 @@ is_compressed_kernel(char *file, char **tmp)
145e27
 		type = BZIP2;
145e27
 	}
145e27
 
145e27
+	if (!memcmp(header, "\xfd""7zXZ", 6)) {
145e27
+		if (!STRNEQ(basename(file), "vmlinux") &&
145e27
+		    !(st->flags & FORCE_DEBUGINFO)) {
145e27
+			error(INFO, "%s: compressed file name does not start "
145e27
+			    "with \"vmlinux\"\n", file);
145e27
+			error(CONT, 
145e27
+			    "Use \"-f %s\" on command line to override.\n\n",
145e27
+				file);
145e27
+			return FALSE;
145e27
+		}
145e27
+		type = XZ;
145e27
+	}
145e27
+
145e27
 	if (!type)
145e27
 		return FALSE;
145e27
 
145e27
@@ -3739,6 +3753,12 @@ is_compressed_kernel(char *file, char **tmp)
145e27
 			"/bin/bunzip2" : "/usr/bin/bunzip2",
145e27
 			file, tempname);
145e27
 		break;
145e27
+	case XZ:
145e27
+		sprintf(command, "%s -c %s > %s", 
145e27
+			file_exists("/bin/unxz", NULL) ?
145e27
+			"/bin/unxz" : "/usr/bin/unxz",
145e27
+			file, tempname);
145e27
+		break;
145e27
 	}
145e27
 	if (system(command) < 0) {
145e27
 		please_wait_done();
145e27
145e27
commit babd7ae62d4e8fd6f93fd30b88040d9376522aa3
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Fri Nov 15 09:55:34 2019 -0500
145e27
145e27
    Fix for the determination of the ARM64 page size on Linux 4.4 and
145e27
    earlier kernels that do not have vmcoreinfo data.  Without the patch,
145e27
    the crash session fails during initialization with the error message
145e27
    "crash: "cannot determine page size".
145e27
    (chenqiwu@xiaomi.com)
145e27
145e27
diff --git a/arm64.c b/arm64.c
145e27
index 5ee5f1a..af7147d 100644
145e27
--- a/arm64.c
145e27
+++ b/arm64.c
145e27
@@ -179,17 +179,16 @@ arm64_init(int when)
145e27
 
145e27
 		}
145e27
 
145e27
+		/*
145e27
+		 * This code section will only be executed if the kernel is
145e27
+		 * earlier than Linux 4.4 (if there is no vmcoreinfo)
145e27
+		 */
145e27
 		if (!machdep->pagesize &&
145e27
 		    kernel_symbol_exists("swapper_pg_dir") &&
145e27
 		    kernel_symbol_exists("idmap_pg_dir")) {
145e27
-			if (kernel_symbol_exists("tramp_pg_dir"))
145e27
-				value = symbol_value("tramp_pg_dir");
145e27
-			else if (kernel_symbol_exists("reserved_ttbr0"))
145e27
-				value = symbol_value("reserved_ttbr0");
145e27
-			else
145e27
-				value = symbol_value("swapper_pg_dir");
145e27
+			value = symbol_value("swapper_pg_dir") -
145e27
+				symbol_value("idmap_pg_dir");
145e27
 
145e27
-			value -= symbol_value("idmap_pg_dir");
145e27
 			/*
145e27
 			 * idmap_pg_dir is 2 pages prior to 4.1,
145e27
 			 * and 3 pages thereafter.  Only 4K and 64K 
145e27
145e27
commit bfd9a651f9426d86250295ac875d7e33d8de2a97
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Tue Nov 19 10:19:55 2019 -0500
145e27
145e27
    Determine the ARM64 kernel's "vabits_actual" value by reading the
145e27
    new TCR_EL1.T1SZ vmcoreinfo entry.
145e27
    (bhsharma@redhat.com)
145e27
145e27
diff --git a/arm64.c b/arm64.c
145e27
index af7147d..0834913 100644
145e27
--- a/arm64.c
145e27
+++ b/arm64.c
145e27
@@ -3856,8 +3856,17 @@ arm64_calc_VA_BITS(void)
145e27
 		} else if (ACTIVE())
145e27
 			error(FATAL, "cannot determine VA_BITS_ACTUAL: please use /proc/kcore\n");
145e27
 		else {
145e27
-			if ((string = pc->read_vmcoreinfo("NUMBER(VA_BITS_ACTUAL)"))) {
145e27
-				value = atol(string);
145e27
+			if ((string = pc->read_vmcoreinfo("NUMBER(tcr_el1_t1sz)"))) {
145e27
+				/* See ARMv8 ARM for the description of
145e27
+				 * TCR_EL1.T1SZ and how it can be used
145e27
+				 * to calculate the vabits_actual
145e27
+				 * supported by underlying kernel.
145e27
+				 *
145e27
+				 * Basically:
145e27
+				 * vabits_actual = 64 - T1SZ;
145e27
+				 */
145e27
+				value = 64 - strtoll(string, NULL, 0);
145e27
+				fprintf(fp,  "vmcoreinfo : vabits_actual: %ld\n", value);
145e27
 				free(string);
145e27
 				machdep->machspec->VA_BITS_ACTUAL = value;
145e27
 				machdep->machspec->VA_BITS = value;
145e27
145e27
commit f1c71de4ef66508108c5929e79e21a85b147787b
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Wed Nov 20 11:59:00 2019 -0500
145e27
145e27
    Fix to determine the ARM64 kernel's "vabits_actual" value from the
145e27
    ELF header of a dumpfile created with the "snap.so" extension module.
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/netdump.c b/netdump.c
145e27
index 3ced87c..406416a 100644
145e27
--- a/netdump.c
145e27
+++ b/netdump.c
145e27
@@ -1887,7 +1887,7 @@ vmcoreinfo_read_string(const char *key)
145e27
 			sprintf(value, "%ld", nd->arch_data2 & 0xffffffff);
145e27
 			return value;
145e27
 		}
145e27
-		if (STREQ(key, "NUMBER(VA_BITS_ACTUAL)") && nd->arch_data2) {
145e27
+		if (STREQ(key, "NUMBER(tcr_el1_t1sz)") && nd->arch_data2) {
145e27
 			value = calloc(VADDR_PRLEN+1, sizeof(char));
145e27
 			sprintf(value, "%lld", ((ulonglong)nd->arch_data2 >> 32) & 0xffffffff);
145e27
 			pc->read_vmcoreinfo = no_vmcoreinfo;
145e27
145e27
commit b259940b228cc7025904f9b7372348b56f73a4d2
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Thu Nov 21 09:27:52 2019 -0500
145e27
145e27
    Fix two typos in the examples section of the "help bt" display, which
145e27
    mistakenly show "bf -f" and "bf -FF" instead of "bt -f" and "bt -FF".
145e27
    (austindh.kim@gmail.com)
145e27
145e27
diff --git a/help.c b/help.c
145e27
index 2b2285b..eed249b 100644
145e27
--- a/help.c
145e27
+++ b/help.c
145e27
@@ -2117,7 +2117,7 @@ char *help_bt[] = {
145e27
 "  The following three examples show the difference in the display of",
145e27
 "  the same stack frame's contents using -f, -F, and -FF:",
145e27
 "  ",
145e27
-"    %s> bf -f",
145e27
+"    %s> bt -f",
145e27
 "    ...",
145e27
 "     #4 [ffff810072b47f10] vfs_write at ffffffff800789d8",
145e27
 "        ffff810072b47f18: ffff81007e020380 ffff81007e2c2880 ",
145e27
@@ -2133,7 +2133,7 @@ char *help_bt[] = {
145e27
 "        ffff810072b47f38: 00002b141825d000 sys_write+69   ",
145e27
 "     #5 [ffff810072b47f40] sys_write at ffffffff80078f75",
145e27
 "    ...",
145e27
-"    %s> bf -FF",
145e27
+"    %s> bt -FF",
145e27
 "    ...",
145e27
 "     #4 [ffff810072b47f10] vfs_write at ffffffff800789d8",
145e27
 "        ffff810072b47f18: [ffff81007e020380:files_cache] [ffff81007e2c2880:filp]",
145e27
145e27
commit 5171ef5a7e85805f61ef98b15801da06648a8e39
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Fri Nov 22 13:39:40 2019 -0500
145e27
145e27
    Similar to ARM64, the X86_64, PPC64 and S390x architectures will use
145e27
    the exported value of MAX_PHYSMEM_BITS from the vmcoreinfo data as
145e27
    the preferred method if it is available.
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/ppc64.c b/ppc64.c
145e27
index 0936551..f368bf8 100644
145e27
--- a/ppc64.c
145e27
+++ b/ppc64.c
145e27
@@ -225,6 +225,13 @@ static int ppc64_is_vmaddr(ulong addr)
145e27
 static int set_ppc64_max_physmem_bits(void)
145e27
 {
145e27
 	int dimension;
145e27
+	char *string;
145e27
+
145e27
+	if ((string = pc->read_vmcoreinfo("NUMBER(MAX_PHYSMEM_BITS)"))) {
145e27
+		machdep->max_physmem_bits = atol(string);
145e27
+		free(string);
145e27
+		return 0;
145e27
+	}
145e27
 
145e27
 	get_array_length("mem_section", &dimension, 0);
145e27
 
145e27
diff --git a/s390x.c b/s390x.c
145e27
index 0055890..4a1a466 100644
145e27
--- a/s390x.c
145e27
+++ b/s390x.c
145e27
@@ -240,6 +240,13 @@ static int
145e27
 set_s390x_max_physmem_bits(void)
145e27
 {
145e27
 	int array_len, dimension;
145e27
+	char *string;
145e27
+
145e27
+	if ((string = pc->read_vmcoreinfo("NUMBER(MAX_PHYSMEM_BITS)"))) {
145e27
+		machdep->max_physmem_bits = atol(string);
145e27
+		free(string);
145e27
+		return TRUE;
145e27
+	}
145e27
 
145e27
 	machdep->max_physmem_bits = _MAX_PHYSMEM_BITS_OLD;
145e27
 
145e27
diff --git a/x86_64.c b/x86_64.c
145e27
index c7967bd..a4138ed 100644
145e27
--- a/x86_64.c
145e27
+++ b/x86_64.c
145e27
@@ -665,7 +665,10 @@ x86_64_init(int when)
145e27
 		}
145e27
 		machdep->section_size_bits = _SECTION_SIZE_BITS;
145e27
 		if (!machdep->max_physmem_bits) {
145e27
-			if (machdep->flags & VM_5LEVEL)
145e27
+			if ((string = pc->read_vmcoreinfo("NUMBER(MAX_PHYSMEM_BITS)"))) {
145e27
+				machdep->max_physmem_bits = atol(string);
145e27
+				free(string);
145e27
+			} else if (machdep->flags & VM_5LEVEL)
145e27
 				machdep->max_physmem_bits = 
145e27
 					_MAX_PHYSMEM_BITS_5LEVEL;
145e27
 			else if (THIS_KERNEL_VERSION >= LINUX(2,6,31))
145e27
145e27
commit 6664cb3f4ea2eac1b6d482e541b56d7792a4be04
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Tue Nov 26 12:18:02 2019 -0500
145e27
145e27
    If an S390X kernel crashes before vmcoreinfo initialization, there is
145e27
    no way to extract the KASLR offset for such early dumps.  In a new
145e27
    S390X kernel patch, the KASLR offset will be stored in the lowcore
145e27
    memory during early boot and then overwritten after vmcoreinfo is
145e27
    initialized.  This patch allows crash to identify the KASLR offset
145e27
    that is stored in the lowcore memory.
145e27
    (zaslonko@linux.ibm.com)
145e27
145e27
diff --git a/s390x.c b/s390x.c
145e27
index 4a1a466..8840cc7 100644
145e27
--- a/s390x.c
145e27
+++ b/s390x.c
145e27
@@ -46,6 +46,8 @@
145e27
 
145e27
 #define S390X_PSW_MASK_PSTATE	0x0001000000000000UL
145e27
 
145e27
+#define S390X_LC_VMCORE_INFO	0xe0c
145e27
+
145e27
 /*
145e27
  * Flags for Region and Segment table entries.
145e27
  */
145e27
@@ -460,6 +462,8 @@ static void s390x_check_live(void)
145e27
 void
145e27
 s390x_init(int when)
145e27
 {
145e27
+	ulong s390x_lc_kaslr;
145e27
+
145e27
 	switch (when)
145e27
 	{
145e27
 	case SETUP_ENV:
145e27
@@ -486,6 +490,24 @@ s390x_init(int when)
145e27
 		machdep->verify_paddr = generic_verify_paddr;
145e27
 		machdep->get_kvaddr_ranges = s390x_get_kvaddr_ranges;
145e27
 		machdep->ptrs_per_pgd = PTRS_PER_PGD;
145e27
+		if (DUMPFILE() && !(kt->flags & RELOC_SET)) {
145e27
+			/* Read the value from well-known lowcore location*/
145e27
+			if (readmem(S390X_LC_VMCORE_INFO, PHYSADDR, &s390x_lc_kaslr,
145e27
+			    sizeof(s390x_lc_kaslr), "s390x_lc_kaslr",
145e27
+			    QUIET|RETURN_ON_ERROR)) {
145e27
+				/* Check for explicit kaslr offset flag */
145e27
+				if (s390x_lc_kaslr & 0x1UL) {
145e27
+					/* Drop the last bit to get an offset value */
145e27
+					s390x_lc_kaslr &= ~(0x1UL);
145e27
+					/* Make sure the offset is aligned by 0x1000 */
145e27
+					if (s390x_lc_kaslr && !(s390x_lc_kaslr & 0xfff)) {
145e27
+						kt->relocate = s390x_lc_kaslr * (-1);
145e27
+						kt->flags |= RELOC_SET;
145e27
+						kt->flags2 |= KASLR;
145e27
+					}
145e27
+				}
145e27
+			}
145e27
+		}
145e27
 		break;
145e27
 
145e27
 	case PRE_GDB:
145e27
145e27
commit b265bad21cdb394b230431360605551b02fc5053
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Sun Dec 1 14:06:59 2019 -0500
145e27
145e27
    Fix for a crash-7.2.7 regression that determined the value of the
145e27
    ARM64 kernel SECTION_SIZE_BITS by reading the in-kernel configuration
145e27
    data if there is no VMCOREINFO data available.  In that case, without
145e27
    the patch, a double-free exception may occur.
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/arm64.c b/arm64.c
145e27
index 0834913..233029d 100644
145e27
--- a/arm64.c
145e27
+++ b/arm64.c
145e27
@@ -1073,10 +1073,8 @@ arm64_get_section_size_bits(void)
145e27
 		free(string);
145e27
 	} else if (kt->ikconfig_flags & IKCONFIG_AVAIL) {
145e27
 		if ((ret = get_kernel_config("CONFIG_MEMORY_HOTPLUG", NULL)) == IKCONFIG_Y) {
145e27
-			if ((ret = get_kernel_config("CONFIG_HOTPLUG_SIZE_BITS", &string)) == IKCONFIG_STR) {
145e27
+			if ((ret = get_kernel_config("CONFIG_HOTPLUG_SIZE_BITS", &string)) == IKCONFIG_STR)
145e27
 				machdep->section_size_bits = atol(string);
145e27
-				free(string);
145e27
-			}
145e27
 		} 
145e27
 	}
145e27
 
145e27
145e27
commit e13b51a59645fd8c3884082b157a0b494cf77ec6
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Sun Dec 1 14:18:41 2019 -0500
145e27
145e27
    Fix for segmentation violation if the gdb_readmem_callback() function
145e27
    gets called from other than a crash command, such as from an epython
145e27
    command from the mypkdump.so extension module.
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/gdb_interface.c b/gdb_interface.c
145e27
index 608da86..562d2ac 100644
145e27
--- a/gdb_interface.c
145e27
+++ b/gdb_interface.c
145e27
@@ -1,8 +1,8 @@
145e27
 /* gdb_interface.c - core analysis suite
145e27
  *
145e27
  * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
145e27
- * Copyright (C) 2002-2015,2018 David Anderson
145e27
- * Copyright (C) 2002-2015,2018 Red Hat, Inc. All rights reserved.
145e27
+ * Copyright (C) 2002-2015,2018-2019 David Anderson
145e27
+ * Copyright (C) 2002-2015,2018-2019 Red Hat, Inc. All rights reserved.
145e27
  *
145e27
  * This program is free software; you can redistribute it and/or modify
145e27
  * it under the terms of the GNU General Public License as published by
145e27
@@ -831,6 +831,11 @@ gdb_readmem_callback(ulong addr, void *buf, int len, int write)
145e27
 	if (write)
145e27
 		return FALSE;
145e27
 
145e27
+	if (!(pc->cur_req)) {
145e27
+		return(readmem(addr, KVADDR, buf, len, 
145e27
+			"gdb_readmem_callback", RETURN_ON_ERROR));
145e27
+	}
145e27
+
145e27
 	if (pc->cur_req->flags & GNU_NO_READMEM)
145e27
 		return TRUE;
145e27
 
145e27
145e27
commit da4a22029aa55fa55200d52f98866fce48ba720e
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Tue Dec 3 11:41:19 2019 -0500
145e27
145e27
    Fix for the "dis -s" option when running against kernels that have
145e27
    been configured with CONFIG_RANDOMIZE_BASE=y (KASLR).  Without the
145e27
    patch, the command option indicates that the FILE and LINE numbers
145e27
    are "(unknown)", and that "source code is not available".
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/kernel.c b/kernel.c
145e27
index c4cb001..80486ba 100644
145e27
--- a/kernel.c
145e27
+++ b/kernel.c
145e27
@@ -1459,12 +1459,20 @@ list_source_code(struct gnu_request *req, int count_entered)
145e27
         char *argv[MAXARGS];
145e27
 	struct syment *sp;
145e27
 	ulong remaining, offset;
145e27
+	struct load_module *lm;
145e27
 	char *p1;
145e27
 
145e27
 	sp = value_search(req->addr, &offset);
145e27
 	if (!sp || !is_symbol_text(sp))
145e27
 		error(FATAL, "%lx: not a kernel text address\n", req->addr);
145e27
 
145e27
+	if (module_symbol(req->addr, NULL, &lm, NULL, 0)) {
145e27
+		if (!(lm->mod_flags & MOD_LOAD_SYMS))
145e27
+			error(FATAL, "%s: module source code is not available\n", lm->mod_name);
145e27
+		get_line_number(req->addr, buf1, FALSE);
145e27
+	} else if (kt->flags2 & KASLR)
145e27
+		req->addr -= (kt->relocate * -1);
145e27
+
145e27
 	sprintf(buf1, "list *0x%lx", req->addr);
145e27
 	open_tmpfile();
145e27
 	if (!gdb_pass_through(buf1, pc->tmpfile, GNU_RETURN_ON_ERROR)) {
145e27
145e27
commit 4e4e5859731da650d3520150d7ea2ef07094c7af
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Thu Dec 12 12:08:11 2019 -0500
145e27
145e27
    Fix for newer Xen hypervisors, which fail during initialization with
145e27
    the error message "crash: cannot resolve init_tss".  This is caused
145e27
    by a change in the Xen hypervisor with commit 78884406256, from
145e27
    4.12.0-rc5-763-g7888440625.  In that patch the tss_struct structure
145e27
    was renamed to tss64 and the tss_page structure was introduced,
145e27
    which contains a single tss64.  Now tss information is accessible
145e27
    via the symbol "per_cpu__tss_page".
145e27
    (dietmar.hahn@ts.fujitsu.com)
145e27
145e27
diff --git a/x86.c b/x86.c
145e27
index 88562b6..de0d3d3 100644
145e27
--- a/x86.c
145e27
+++ b/x86.c
145e27
@@ -5600,18 +5600,18 @@ x86_get_stackbase_hyper(ulong task)
145e27
 
145e27
 	if (symbol_exists("init_tss")) {
145e27
 		init_tss = symbol_value("init_tss");
145e27
-		init_tss += XEN_HYPER_SIZE(tss_struct) * pcpu;
145e27
+		init_tss += XEN_HYPER_SIZE(tss) * pcpu;
145e27
 	} else {
145e27
 		init_tss = symbol_value("per_cpu__init_tss");
145e27
 		init_tss = xen_hyper_per_cpu(init_tss, pcpu);
145e27
 	}
145e27
 	
145e27
-	buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
145e27
+	buf = GETBUF(XEN_HYPER_SIZE(tss));
145e27
 	if (!readmem(init_tss, KVADDR, buf,
145e27
-			XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
145e27
+			XEN_HYPER_SIZE(tss), "init_tss", RETURN_ON_ERROR)) {
145e27
 		error(FATAL, "cannot read init_tss.\n");
145e27
 	}
145e27
-	esp = ULONG(buf + XEN_HYPER_OFFSET(tss_struct_esp0));
145e27
+	esp = ULONG(buf + XEN_HYPER_OFFSET(tss_esp0));
145e27
 	FREEBUF(buf);
145e27
 	base = esp & (~(STACKSIZE() - 1));
145e27
 
145e27
@@ -5745,8 +5745,8 @@ x86_init_hyper(int when)
145e27
 #endif
145e27
 		XEN_HYPER_STRUCT_SIZE_INIT(cpu_time, "cpu_time");
145e27
 		XEN_HYPER_STRUCT_SIZE_INIT(cpuinfo_x86, "cpuinfo_x86");
145e27
-		XEN_HYPER_STRUCT_SIZE_INIT(tss_struct, "tss_struct");
145e27
-		XEN_HYPER_MEMBER_OFFSET_INIT(tss_struct_esp0, "tss_struct", "esp0");
145e27
+		XEN_HYPER_STRUCT_SIZE_INIT(tss, "tss_struct");
145e27
+		XEN_HYPER_MEMBER_OFFSET_INIT(tss_esp0, "tss_struct", "esp0");
145e27
 		XEN_HYPER_MEMBER_OFFSET_INIT(cpu_time_local_tsc_stamp, "cpu_time", "local_tsc_stamp");
145e27
 		XEN_HYPER_MEMBER_OFFSET_INIT(cpu_time_stime_local_stamp, "cpu_time", "stime_local_stamp");
145e27
 		XEN_HYPER_MEMBER_OFFSET_INIT(cpu_time_stime_master_stamp, "cpu_time", "stime_master_stamp");
145e27
diff --git a/x86_64.c b/x86_64.c
145e27
index a4138ed..4f1a6d7 100644
145e27
--- a/x86_64.c
145e27
+++ b/x86_64.c
145e27
@@ -7973,13 +7973,23 @@ x86_64_init_hyper(int when)
145e27
 
145e27
 	case POST_GDB:
145e27
 		XEN_HYPER_STRUCT_SIZE_INIT(cpuinfo_x86, "cpuinfo_x86");
145e27
-		XEN_HYPER_STRUCT_SIZE_INIT(tss_struct, "tss_struct");
145e27
-		if (MEMBER_EXISTS("tss_struct", "__blh")) {
145e27
-			XEN_HYPER_ASSIGN_OFFSET(tss_struct_rsp0) = MEMBER_OFFSET("tss_struct", "__blh") + sizeof(short unsigned int);
145e27
+		if (symbol_exists("per_cpu__tss_page")) {
145e27
+			XEN_HYPER_STRUCT_SIZE_INIT(tss, "tss64");
145e27
+			XEN_HYPER_ASSIGN_OFFSET(tss_rsp0) =
145e27
+							MEMBER_OFFSET("tss64", "rsp0");
145e27
+			XEN_HYPER_MEMBER_OFFSET_INIT(tss_ist, "tss64", "ist");
145e27
 		} else {
145e27
-			XEN_HYPER_ASSIGN_OFFSET(tss_struct_rsp0) = MEMBER_OFFSET("tss_struct", "rsp0");
145e27
+			XEN_HYPER_STRUCT_SIZE_INIT(tss, "tss_struct");
145e27
+			XEN_HYPER_MEMBER_OFFSET_INIT(tss_ist, "tss_struct", "ist");
145e27
+			if (MEMBER_EXISTS("tss_struct", "__blh")) {
145e27
+				XEN_HYPER_ASSIGN_OFFSET(tss_rsp0) =
145e27
+					MEMBER_OFFSET("tss_struct", "__blh") +
145e27
+								sizeof(short unsigned int);
145e27
+			} else	{
145e27
+				XEN_HYPER_ASSIGN_OFFSET(tss_rsp0) =
145e27
+							MEMBER_OFFSET("tss_struct", "rsp0");
145e27
+			}
145e27
 		}
145e27
-		XEN_HYPER_MEMBER_OFFSET_INIT(tss_struct_ist, "tss_struct", "ist");
145e27
 		if (symbol_exists("cpu_data")) {
145e27
 			xht->cpu_data_address = symbol_value("cpu_data");
145e27
 		}
145e27
diff --git a/xen_hyper.c b/xen_hyper.c
145e27
index f2f00e6..1030c0a 100644
145e27
--- a/xen_hyper.c
145e27
+++ b/xen_hyper.c
145e27
@@ -338,33 +338,35 @@ xen_hyper_x86_pcpu_init(void)
145e27
 	if((xhpct->pcpu_struct = malloc(XEN_HYPER_SIZE(cpu_info))) == NULL) {
145e27
 		error(FATAL, "cannot malloc pcpu struct space.\n");
145e27
 	}
145e27
-
145e27
 	/* get physical cpu context */
145e27
 	xen_hyper_alloc_pcpu_context_space(XEN_HYPER_MAX_CPUS());
145e27
 	if (symbol_exists("per_cpu__init_tss")) {
145e27
 		init_tss_base = symbol_value("per_cpu__init_tss");
145e27
 		flag = TRUE;
145e27
+	} else if (symbol_exists("per_cpu__tss_page")) {
145e27
+			init_tss_base = symbol_value("per_cpu__tss_page");
145e27
+			flag = TRUE;
145e27
 	} else {
145e27
 		init_tss_base = symbol_value("init_tss");
145e27
 		flag = FALSE;
145e27
 	}
145e27
-	buf = GETBUF(XEN_HYPER_SIZE(tss_struct));	
145e27
+	buf = GETBUF(XEN_HYPER_SIZE(tss));
145e27
 	for_cpu_indexes(i, cpuid)
145e27
 	{
145e27
 		if (flag)
145e27
 			init_tss = xen_hyper_per_cpu(init_tss_base, cpuid);
145e27
 		else
145e27
 			init_tss = init_tss_base +
145e27
-				XEN_HYPER_SIZE(tss_struct) * cpuid;
145e27
+				XEN_HYPER_SIZE(tss) * cpuid;
145e27
 		if (!readmem(init_tss, KVADDR, buf,
145e27
-			XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
145e27
+			XEN_HYPER_SIZE(tss), "init_tss", RETURN_ON_ERROR)) {
145e27
 			error(FATAL, "cannot read init_tss.\n");
145e27
 		}
145e27
 		if (machine_type("X86")) {
145e27
-			sp = ULONG(buf + XEN_HYPER_OFFSET(tss_struct_esp0));
145e27
+			sp = ULONG(buf + XEN_HYPER_OFFSET(tss_esp0));
145e27
 		} else if (machine_type("X86_64")) {
145e27
-			sp = ULONG(buf + XEN_HYPER_OFFSET(tss_struct_rsp0));
145e27
-		} else 
145e27
+			sp = ULONG(buf + XEN_HYPER_OFFSET(tss_rsp0));
145e27
+		} else
145e27
 			sp = 0;
145e27
 		cpu_info = XEN_HYPER_GET_CPU_INFO(sp);
145e27
 		if (CRASHDEBUG(1)) {
145e27
@@ -1777,10 +1779,10 @@ xen_hyper_store_pcpu_context_tss(struct xen_hyper_pcpu_context *pcc,
145e27
 
145e27
 	pcc->init_tss = init_tss;
145e27
 	if (machine_type("X86")) {
145e27
-		pcc->sp.esp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_struct_esp0));
145e27
+		pcc->sp.esp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_esp0));
145e27
 	} else if (machine_type("X86_64")) {
145e27
-		pcc->sp.rsp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_struct_rsp0));
145e27
-		ist_p = (uint64_t *)(tss + XEN_HYPER_OFFSET(tss_struct_ist));
145e27
+		pcc->sp.rsp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_rsp0));
145e27
+		ist_p = (uint64_t *)(tss + XEN_HYPER_OFFSET(tss_ist));
145e27
 		for (i = 0; i < XEN_HYPER_TSS_IST_MAX; i++, ist_p++) {
145e27
 			pcc->ist[i] = ULONG(ist_p);
145e27
 		}
145e27
diff --git a/xen_hyper_defs.h b/xen_hyper_defs.h
145e27
index b871bdd..acf910a 100644
145e27
--- a/xen_hyper_defs.h
145e27
+++ b/xen_hyper_defs.h
145e27
@@ -598,7 +598,7 @@ struct xen_hyper_size_table {
145e27
 	long scheduler;
145e27
 	long shared_info;
145e27
 	long timer;
145e27
-	long tss_struct;
145e27
+	long tss;
145e27
 	long vcpu;
145e27
 	long vcpu_runstate_info;
145e27
 	long xen_crash_xen_regs_t;		/* elf note v2 */
145e27
@@ -727,9 +727,9 @@ struct xen_hyper_offset_table {
145e27
 	long timer_heap_offset;
145e27
 	long timer_killed;
145e27
 	/* tss */
145e27
-	long tss_struct_rsp0;
145e27
-	long tss_struct_esp0;
145e27
-	long tss_struct_ist;
145e27
+	long tss_rsp0;
145e27
+	long tss_esp0;
145e27
+	long tss_ist;
145e27
 	/* vcpu */
145e27
 	long vcpu_vcpu_id;
145e27
 	long vcpu_processor;
145e27
diff --git a/xen_hyper_dump_tables.c b/xen_hyper_dump_tables.c
145e27
index eb646b6..0360d25 100644
145e27
--- a/xen_hyper_dump_tables.c
145e27
+++ b/xen_hyper_dump_tables.c
145e27
@@ -636,8 +636,8 @@ xen_hyper_dump_xen_hyper_size_table(char *spec, ulong makestruct)
145e27
 		(buf, "%ld\n", xen_hyper_size_table.shared_info));
145e27
 	XEN_HYPER_PRI(fp, len, "timer: ", buf, flag,
145e27
 		(buf, "%ld\n", xen_hyper_size_table.timer));
145e27
-	XEN_HYPER_PRI(fp, len, "tss_struct: ", buf, flag,
145e27
-		(buf, "%ld\n", xen_hyper_size_table.tss_struct));
145e27
+	XEN_HYPER_PRI(fp, len, "tss: ", buf, flag,
145e27
+		(buf, "%ld\n", xen_hyper_size_table.tss));
145e27
 	XEN_HYPER_PRI(fp, len, "vcpu: ", buf, flag,
145e27
 		(buf, "%ld\n", xen_hyper_size_table.vcpu));
145e27
 	XEN_HYPER_PRI(fp, len, "vcpu_runstate_info: ", buf, flag,
145e27
@@ -868,9 +868,9 @@ xen_hyper_dump_xen_hyper_offset_table(char *spec, ulong makestruct)
145e27
 		(buf, "%ld\n", xen_hyper_offset_table.timer_killed));
145e27
 
145e27
 	XEN_HYPER_PRI(fp, len, "tss_struct_rsp0: ", buf, flag,
145e27
-		(buf, "%ld\n", xen_hyper_offset_table.tss_struct_rsp0));
145e27
+		(buf, "%ld\n", xen_hyper_offset_table.tss_rsp0));
145e27
 	XEN_HYPER_PRI(fp, len, "tss_struct_esp0: ", buf, flag,
145e27
-		(buf, "%ld\n", xen_hyper_offset_table.tss_struct_esp0));
145e27
+		(buf, "%ld\n", xen_hyper_offset_table.tss_esp0));
145e27
 
145e27
 	XEN_HYPER_PRI(fp, len, "vcpu_vcpu_id: ", buf, flag,
145e27
 		(buf, "%ld\n", xen_hyper_offset_table.vcpu_vcpu_id));
145e27
145e27
commit c408862daff0b07f0d98a1c309febcf6590ccf0c
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Sun Dec 15 12:24:13 2019 -0500
145e27
145e27
    When accessing the ARM64 kernel's "crash_notes" array, continue to
145e27
    read the per-cpu NT_PRSTATUS note contents if an invalid note is
145e27
    encountered.  Without the patch, if an invalid note is found, all
145e27
    other notes were ignored, and subsequent "bt" attempts on the active
145e27
    tasks would fail.
145e27
    (chenqiwu@xiaomi.com, anderson@redhat.com)
145e27
145e27
diff --git a/arm64.c b/arm64.c
145e27
index 233029d..1b024a4 100644
145e27
--- a/arm64.c
145e27
+++ b/arm64.c
145e27
@@ -81,7 +81,7 @@ static int arm64_on_irq_stack(int, ulong);
145e27
 static void arm64_set_irq_stack(struct bt_info *);
145e27
 static void arm64_set_process_stack(struct bt_info *);
145e27
 static int arm64_get_kvaddr_ranges(struct vaddr_range *);
145e27
-static int arm64_get_crash_notes(void);
145e27
+static void arm64_get_crash_notes(void);
145e27
 static void arm64_calc_VA_BITS(void);
145e27
 static int arm64_is_uvaddr(ulong, struct task_context *);
145e27
 
145e27
@@ -465,11 +465,8 @@ arm64_init(int when)
145e27
 		 * of the crash. We need this information to extract correct
145e27
 		 * backtraces from the panic task.
145e27
 		 */
145e27
-		if (!LIVE() && !arm64_get_crash_notes())
145e27
-			error(WARNING, 
145e27
-			    "cannot retrieve registers for active task%s\n\n",
145e27
-				kt->cpus > 1 ? "s" : "");
145e27
-
145e27
+		if (!LIVE()) 
145e27
+			arm64_get_crash_notes();
145e27
 		break;
145e27
 
145e27
 	case LOG_ONLY:
145e27
@@ -3578,7 +3575,7 @@ arm64_get_smp_cpus(void)
145e27
 /*
145e27
  * Retrieve task registers for the time of the crash.
145e27
  */
145e27
-static int
145e27
+static void
145e27
 arm64_get_crash_notes(void)
145e27
 {
145e27
 	struct machine_specific *ms = machdep->machspec;
145e27
@@ -3587,10 +3584,10 @@ arm64_get_crash_notes(void)
145e27
 	ulong offset;
145e27
 	char *buf, *p;
145e27
 	ulong *notes_ptrs;
145e27
-	ulong i;
145e27
+	ulong i, found;
145e27
 
145e27
 	if (!symbol_exists("crash_notes"))
145e27
-		return FALSE;
145e27
+		return;
145e27
 
145e27
 	crash_notes = symbol_value("crash_notes");
145e27
 
145e27
@@ -3602,9 +3599,9 @@ arm64_get_crash_notes(void)
145e27
 	 */
145e27
 	if (!readmem(crash_notes, KVADDR, &notes_ptrs[kt->cpus-1], 
145e27
 	    sizeof(notes_ptrs[kt->cpus-1]), "crash_notes", RETURN_ON_ERROR)) {
145e27
-		error(WARNING, "cannot read crash_notes\n");
145e27
+		error(WARNING, "cannot read \"crash_notes\"\n");
145e27
 		FREEBUF(notes_ptrs);
145e27
-		return FALSE;
145e27
+		return;
145e27
 	}
145e27
 
145e27
 	if (symbol_exists("__per_cpu_offset")) {
145e27
@@ -3620,12 +3617,11 @@ arm64_get_crash_notes(void)
145e27
 	if (!(ms->panic_task_regs = calloc((size_t)kt->cpus, sizeof(struct arm64_pt_regs))))
145e27
 		error(FATAL, "cannot calloc panic_task_regs space\n");
145e27
 	
145e27
-	for  (i = 0; i < kt->cpus; i++) {
145e27
-
145e27
+	for  (i = found = 0; i < kt->cpus; i++) {
145e27
 		if (!readmem(notes_ptrs[i], KVADDR, buf, SIZE(note_buf), 
145e27
 		    "note_buf_t", RETURN_ON_ERROR)) {
145e27
-			error(WARNING, "failed to read note_buf_t\n");
145e27
-			goto fail;
145e27
+			error(WARNING, "cpu %d: cannot read NT_PRSTATUS note\n", i);
145e27
+			continue;
145e27
 		}
145e27
 
145e27
 		/*
145e27
@@ -3655,19 +3651,24 @@ arm64_get_crash_notes(void)
145e27
 				    note->n_descsz == notesz)
145e27
 					BCOPY((char *)note, buf, notesz);
145e27
 			} else {
145e27
-				error(WARNING,
145e27
-					"cannot find NT_PRSTATUS note for cpu: %d\n", i);
145e27
+				error(WARNING, "cpu %d: cannot find NT_PRSTATUS note\n", i);
145e27
 				continue;
145e27
 			}
145e27
 		}
145e27
 
145e27
+		/*
145e27
+		 * Check the sanity of NT_PRSTATUS note only for each online cpu.
145e27
+		 * If this cpu has invalid note, continue to find the crash notes
145e27
+		 * for other online cpus.
145e27
+		 */
145e27
 		if (note->n_type != NT_PRSTATUS) {
145e27
-			error(WARNING, "invalid note (n_type != NT_PRSTATUS)\n");
145e27
-			goto fail;
145e27
+			error(WARNING, "cpu %d: invalid NT_PRSTATUS note (n_type != NT_PRSTATUS)\n", i);
145e27
+			continue;
145e27
 		}
145e27
-		if (p[0] != 'C' || p[1] != 'O' || p[2] != 'R' || p[3] != 'E') {
145e27
-			error(WARNING, "invalid note (name != \"CORE\"\n");
145e27
-			goto fail;
145e27
+
145e27
+		if (!STRNEQ(p, "CORE")) {
145e27
+			error(WARNING, "cpu %d: invalid NT_PRSTATUS note (name != \"CORE\")\n", i);
145e27
+			continue;
145e27
 		}
145e27
 
145e27
 		/*
145e27
@@ -3680,18 +3681,17 @@ arm64_get_crash_notes(void)
145e27
 
145e27
 		BCOPY(p + OFFSET(elf_prstatus_pr_reg), &ms->panic_task_regs[i],
145e27
 		      sizeof(struct arm64_pt_regs));
145e27
+
145e27
+		found++;
145e27
 	}
145e27
 
145e27
 	FREEBUF(buf);
145e27
 	FREEBUF(notes_ptrs);
145e27
-	return TRUE;
145e27
 
145e27
-fail:
145e27
-	FREEBUF(buf);
145e27
-	FREEBUF(notes_ptrs);
145e27
-	free(ms->panic_task_regs);
145e27
-	ms->panic_task_regs = NULL;
145e27
-	return FALSE;
145e27
+	if (!found) {
145e27
+		free(ms->panic_task_regs);
145e27
+		ms->panic_task_regs = NULL;
145e27
+	}
145e27
 }
145e27
 
145e27
 static void
145e27
145e27
commit 63df9c067de0b2017f50f5d236954890bbb42fe3
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Mon Dec 16 11:28:46 2019 -0500
145e27
145e27
    When accessing the 32-bit ARM kernel's "crash_notes" array, continue
145e27
    to read the per-cpu NT_PRSTATUS note contents if an invalid note is
145e27
    encountered.  Without the patch, if an invalid note is found, all
145e27
    other notes were ignored, and subsequent "bt" attempts on the active
145e27
    tasks would fail.
145e27
    (chenqiwu@xiaomi.com, anderson@redhat.com)
145e27
145e27
diff --git a/arm.c b/arm.c
145e27
index b05b0b3..e52d29f 100644
145e27
--- a/arm.c
145e27
+++ b/arm.c
145e27
@@ -26,7 +26,7 @@
145e27
 #include "defs.h"
145e27
 
145e27
 static void arm_parse_cmdline_args(void);
145e27
-static int arm_get_crash_notes(void);
145e27
+static void arm_get_crash_notes(void);
145e27
 static int arm_verify_symbol(const char *, ulong, char);
145e27
 static int arm_is_module_addr(ulong);
145e27
 static int arm_is_kvaddr(ulong);
145e27
@@ -348,10 +348,8 @@ arm_init(int when)
145e27
 		 * of the crash. We need this information to extract correct
145e27
 		 * backtraces from the panic task.
145e27
 		 */
145e27
-		if (!ACTIVE() && !arm_get_crash_notes())
145e27
-			error(WARNING, 
145e27
-			    "cannot retrieve registers for active task%s\n\n",
145e27
-				kt->cpus > 1 ? "s" : "");
145e27
+		if (!ACTIVE())
145e27
+			arm_get_crash_notes();
145e27
 
145e27
 		if (init_unwind_tables()) {
145e27
 			if (CRASHDEBUG(1))
145e27
@@ -543,7 +541,7 @@ arm_parse_cmdline_args(void)
145e27
 /*
145e27
  * Retrieve task registers for the time of the crash.
145e27
  */
145e27
-static int
145e27
+static void
145e27
 arm_get_crash_notes(void)
145e27
 {
145e27
 	struct machine_specific *ms = machdep->machspec;
145e27
@@ -552,10 +550,10 @@ arm_get_crash_notes(void)
145e27
 	ulong offset;
145e27
 	char *buf, *p;
145e27
 	ulong *notes_ptrs;
145e27
-	ulong i;
145e27
+	ulong i, found;
145e27
 
145e27
 	if (!symbol_exists("crash_notes"))
145e27
-		return FALSE;
145e27
+		return;
145e27
 
145e27
 	crash_notes = symbol_value("crash_notes");
145e27
 
145e27
@@ -570,11 +568,10 @@ arm_get_crash_notes(void)
145e27
 		     RETURN_ON_ERROR)) {
145e27
 		error(WARNING, "cannot read crash_notes\n");
145e27
 		FREEBUF(notes_ptrs);
145e27
-		return FALSE;
145e27
+		return;
145e27
 	}
145e27
 
145e27
 	if (symbol_exists("__per_cpu_offset")) {
145e27
-
145e27
 		/* Add __per_cpu_offset for each cpu to form the pointer to the notes */
145e27
 		for (i = 0; i<kt->cpus; i++)
145e27
 			notes_ptrs[i] = notes_ptrs[kt->cpus-1] + kt->__per_cpu_offset[i];	
145e27
@@ -585,12 +582,11 @@ arm_get_crash_notes(void)
145e27
 	if (!(panic_task_regs = calloc((size_t)kt->cpus, sizeof(*panic_task_regs))))
145e27
 		error(FATAL, "cannot calloc panic_task_regs space\n");
145e27
 	
145e27
-	for  (i=0;i<kt->cpus;i++) {
145e27
-
145e27
+	for  (i = found = 0; i<kt->cpus; i++) {
145e27
 		if (!readmem(notes_ptrs[i], KVADDR, buf, SIZE(note_buf), "note_buf_t",
145e27
 			     RETURN_ON_ERROR)) {
145e27
-			error(WARNING, "failed to read note_buf_t\n");
145e27
-			goto fail;
145e27
+			error(WARNING, "cpu %d: cannot read NT_PRSTATUS note\n", i);
145e27
+			continue;
145e27
 		}
145e27
 
145e27
 		/*
145e27
@@ -620,19 +616,23 @@ arm_get_crash_notes(void)
145e27
 				    note->n_descsz == notesz)
145e27
 					BCOPY((char *)note, buf, notesz);
145e27
 			} else {
145e27
-				error(WARNING,
145e27
-					"cannot find NT_PRSTATUS note for cpu: %d\n", i);
145e27
+				error(WARNING, "cpu %d: cannot find NT_PRSTATUS note\n", i);
145e27
 				continue;
145e27
 			}
145e27
 		}
145e27
-
145e27
+		/*
145e27
+		 * Check the sanity of NT_PRSTATUS note only for each online cpu.
145e27
+		 * If this cpu has invalid note, continue to find the crash notes
145e27
+		 * for other online cpus.
145e27
+		 */
145e27
 		if (note->n_type != NT_PRSTATUS) {
145e27
-			error(WARNING, "invalid note (n_type != NT_PRSTATUS)\n");
145e27
-			goto fail;
145e27
+			error(WARNING, "cpu %d: invalid NT_PRSTATUS note (n_type != NT_PRSTATUS)\n", i);
145e27
+			continue;
145e27
 		}
145e27
-		if (p[0] != 'C' || p[1] != 'O' || p[2] != 'R' || p[3] != 'E') {
145e27
-			error(WARNING, "invalid note (name != \"CORE\"\n");
145e27
-			goto fail;
145e27
+
145e27
+		if (!STRNEQ(p, "CORE")) {
145e27
+			error(WARNING, "cpu %d: invalid NT_PRSTATUS note (name != \"CORE\")\n", i);
145e27
+			continue;
145e27
 		}
145e27
 
145e27
 		/*
145e27
@@ -646,6 +646,7 @@ arm_get_crash_notes(void)
145e27
 		BCOPY(p + OFFSET(elf_prstatus_pr_reg), &panic_task_regs[i],
145e27
 		      sizeof(panic_task_regs[i]));
145e27
 
145e27
+		found++;
145e27
 	}
145e27
 
145e27
 	/*
145e27
@@ -656,13 +657,10 @@ arm_get_crash_notes(void)
145e27
 
145e27
 	FREEBUF(buf);
145e27
 	FREEBUF(notes_ptrs);
145e27
-	return TRUE;
145e27
-
145e27
-fail:
145e27
-	FREEBUF(buf);
145e27
-	FREEBUF(notes_ptrs);
145e27
-	free(panic_task_regs);
145e27
-	return FALSE;
145e27
+	if (!found) {
145e27
+		free(panic_task_regs);
145e27
+		ms->crash_task_regs = NULL;
145e27
+	}
145e27
 }
145e27
 
145e27
 /*
145e27
145e27
commit af7f78dc501b8acf7fee3f924f69e93513d0a74b
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Fri Dec 20 14:33:11 2019 -0500
145e27
145e27
    Fix for the "log -a" option.  The kernel's sk_buff.len field is a
145e27
    32-bit unsigned int, but crash was reading its 32-bit value into a
145e27
    64-bit unsigned long stack variable.  All extra bits that pre-existed
145e27
    in the upper 32-bits of the stack variable were passed along as part
145e27
    of a buffer size request; if the upper 32-bit bits were non-zero,
145e27
    then the command would fail with a dump of the internal buffer
145e27
    allocation stats followed by the message "log: cannot allocate any
145e27
    more memory!".
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/kernel.c b/kernel.c
145e27
index 80486ba..68ee282 100644
145e27
--- a/kernel.c
145e27
+++ b/kernel.c
145e27
@@ -11284,7 +11284,8 @@ dump_audit_skb_queue(ulong audit_skb_queue)
145e27
 
145e27
 	p = skb_buff_head_next;
145e27
 	do {
145e27
-		ulong data, len, data_len;
145e27
+		ulong data, data_len;
145e27
+		uint len;
145e27
 		uint16_t nlmsg_type;
145e27
 		char *buf = NULL;
145e27
 
145e27
@@ -11295,7 +11296,7 @@ dump_audit_skb_queue(ulong audit_skb_queue)
145e27
 			KVADDR,
145e27
 			&len,
145e27
 			SIZE(sk_buff_len),
145e27
-			"sk_buff.data",
145e27
+			"sk_buff.len",
145e27
 			FAULT_ON_ERROR);
145e27
 
145e27
 		data_len = len - roundup(SIZE(nlmsghdr), NLMSG_ALIGNTO);
145e27
145e27
commit 5e975dd8c817ea6aea35e1e15b83c378aee9c136
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Tue Dec 24 08:43:52 2019 -0500
145e27
145e27
    When determining the ARM64 kernel's "vabits_actual" value by reading
145e27
    the new TCR_EL1.T1SZ vmcoreinfo entry, display its value during
145e27
    session initialization only when invoking crash with "-d1" or larger
145e27
    -d debug value.
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/arm64.c b/arm64.c
145e27
index 1b024a4..6c2c58f 100644
145e27
--- a/arm64.c
145e27
+++ b/arm64.c
145e27
@@ -3864,7 +3864,8 @@ arm64_calc_VA_BITS(void)
145e27
 				 * vabits_actual = 64 - T1SZ;
145e27
 				 */
145e27
 				value = 64 - strtoll(string, NULL, 0);
145e27
-				fprintf(fp,  "vmcoreinfo : vabits_actual: %ld\n", value);
145e27
+				if (CRASHDEBUG(1))
145e27
+					fprintf(fp,  "vmcoreinfo : vabits_actual: %ld\n", value);
145e27
 				free(string);
145e27
 				machdep->machspec->VA_BITS_ACTUAL = value;
145e27
 				machdep->machspec->VA_BITS = value;
145e27
145e27
commit 0ab7ac3bea5deaa3da894247ffab9ef2433c1b9b
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Tue Jan 7 09:34:38 2020 -0500
145e27
145e27
    Update copyright to 2020 in crash version output.
145e27
145e27
diff --git a/help.c b/help.c
145e27
index eed249b..a481850 100644
145e27
--- a/help.c
145e27
+++ b/help.c
145e27
@@ -1,8 +1,8 @@
145e27
 /* help.c - core analysis suite
145e27
  *
145e27
  * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
145e27
- * Copyright (C) 2002-2019 David Anderson
145e27
- * Copyright (C) 2002-2019 Red Hat, Inc. All rights reserved.
145e27
+ * Copyright (C) 2002-2020 David Anderson
145e27
+ * Copyright (C) 2002-2020 Red Hat, Inc. All rights reserved.
145e27
  *
145e27
  * This program is free software; you can redistribute it and/or modify
145e27
  * it under the terms of the GNU General Public License as published by
145e27
@@ -8269,7 +8269,7 @@ display_version(void)
145e27
 static 
145e27
 char *version_info[] = {
145e27
 
145e27
-"Copyright (C) 2002-2019  Red Hat, Inc.",
145e27
+"Copyright (C) 2002-2020  Red Hat, Inc.",
145e27
 "Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation", 
145e27
 "Copyright (C) 1999-2006  Hewlett-Packard Co",
145e27
 "Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited",
145e27
145e27
commit 08b01834641b0a387c86adf651c660df0fe37ae1
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Tue Jan 7 11:07:12 2020 -0500
145e27
145e27
    Fix for ARM64 when running against Linux 5.5-rc1 and later kernels
145e27
    that contain commit b6e43c0e3129ffe87e65c85f20fcbdf0eb86fba0, titled
145e27
    "arm64: remove __exception annotations".  Without the patch, the
145e27
    ARM64 crash session fails during initialization with the error
145e27
    message "crash: cannot resolve __exception_text_start".
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/arm64.c b/arm64.c
145e27
index 6c2c58f..7662d71 100644
145e27
--- a/arm64.c
145e27
+++ b/arm64.c
145e27
@@ -1,8 +1,8 @@
145e27
 /*
145e27
  * arm64.c - core analysis suite
145e27
  *
145e27
- * Copyright (C) 2012-2019 David Anderson
145e27
- * Copyright (C) 2012-2019 Red Hat, Inc. All rights reserved.
145e27
+ * Copyright (C) 2012-2020 David Anderson
145e27
+ * Copyright (C) 2012-2020 Red Hat, Inc. All rights reserved.
145e27
  *
145e27
  * This program is free software; you can redistribute it and/or modify
145e27
  * it under the terms of the GNU General Public License as published by
145e27
@@ -1644,10 +1644,11 @@ arm64_stackframe_init(void)
145e27
 		machdep->machspec->kern_eframe_offset = SIZE(pt_regs);
145e27
 	}
145e27
 
145e27
-	machdep->machspec->__exception_text_start = 
145e27
-		symbol_value("__exception_text_start");
145e27
-	machdep->machspec->__exception_text_end = 
145e27
-		symbol_value("__exception_text_end");
145e27
+	if ((sp1 = kernel_symbol_search("__exception_text_start")) &&
145e27
+	    (sp2 = kernel_symbol_search("__exception_text_end"))) {
145e27
+		machdep->machspec->__exception_text_start = sp1->value;
145e27
+		machdep->machspec->__exception_text_end = sp2->value;
145e27
+	}
145e27
 	if ((sp1 = kernel_symbol_search("__irqentry_text_start")) &&
145e27
 	    (sp2 = kernel_symbol_search("__irqentry_text_end"))) {
145e27
 		machdep->machspec->__irqentry_text_start = sp1->value; 
145e27
@@ -1856,20 +1857,38 @@ arm64_eframe_search(struct bt_info *bt)
145e27
 	return count;
145e27
 }
145e27
 
145e27
+static char *arm64_exception_functions[] = {
145e27
+        "do_undefinstr",
145e27
+        "do_sysinstr",
145e27
+        "do_debug_exception",
145e27
+        "do_mem_abort",
145e27
+        "do_el0_irq_bp_hardening",
145e27
+        "do_sp_pc_abort",
145e27
+        NULL
145e27
+};
145e27
+
145e27
 static int
145e27
 arm64_in_exception_text(ulong ptr)
145e27
 {
145e27
 	struct machine_specific *ms = machdep->machspec;
145e27
-
145e27
-	if ((ptr >= ms->__exception_text_start) &&
145e27
-	    (ptr < ms->__exception_text_end))
145e27
-		return TRUE;
145e27
+	char *name, **func;
145e27
 
145e27
 	if (ms->__irqentry_text_start && ms->__irqentry_text_end &&
145e27
 	    ((ptr >= ms->__irqentry_text_start) && 
145e27
 	    (ptr < ms->__irqentry_text_end)))
145e27
 		return TRUE;
145e27
 
145e27
+	if (ms->__exception_text_start && ms->__exception_text_end) {
145e27
+		if ((ptr >= ms->__exception_text_start) &&
145e27
+		    (ptr < ms->__exception_text_end))
145e27
+			return TRUE;
145e27
+	} else if ((name = closest_symbol(ptr))) {  /* Linux 5.5 and later */
145e27
+		for (func = &arm64_exception_functions[0]; *func; func++) {
145e27
+			if (STREQ(name, *func))
145e27
+				return TRUE;
145e27
+		}
145e27
+	}
145e27
+
145e27
 	return FALSE;
145e27
 }
145e27
 
145e27
145e27
commit 7c2d41e1b25e9fec50d525361bcfa29bdaa410b2
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Wed Jan 8 14:28:39 2020 -0500
145e27
145e27
    Fix for support of ELF format kdump vmcores from S390X KASLR kernels.
145e27
    Without the patch, the crash session fails during initialization with
145e27
    the error message "crash: vmlinux and vmcore do not match!".
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/symbols.c b/symbols.c
145e27
index 7e1bca7..82ac549 100644
145e27
--- a/symbols.c
145e27
+++ b/symbols.c
145e27
@@ -1,8 +1,8 @@
145e27
 /* symbols.c - core analysis suite
145e27
  *
145e27
  * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
145e27
- * Copyright (C) 2002-2019 David Anderson
145e27
- * Copyright (C) 2002-2019 Red Hat, Inc. All rights reserved.
145e27
+ * Copyright (C) 2002-2020 David Anderson
145e27
+ * Copyright (C) 2002-2020 Red Hat, Inc. All rights reserved.
145e27
  *
145e27
  * This program is free software; you can redistribute it and/or modify
145e27
  * it under the terms of the GNU General Public License as published by
145e27
@@ -597,6 +597,11 @@ kaslr_init(void)
145e27
 	    !machine_type("S390X")) || (kt->flags & RELOC_SET))
145e27
 		return;
145e27
 
145e27
+	if ((string = pc->read_vmcoreinfo("SYMBOL(_stext)"))) {
145e27
+		kt->vmcoreinfo._stext_SYMBOL = htol(string, RETURN_ON_ERROR, NULL);
145e27
+		free(string);
145e27
+	}
145e27
+
145e27
 	/*
145e27
 	 *  --kaslr=auto
145e27
 	 */
145e27
@@ -609,8 +614,7 @@ kaslr_init(void)
145e27
 		st->_stext_vmlinux = UNINITIALIZED;
145e27
 	}
145e27
 
145e27
-	if (machine_type("S390X") &&  /* Linux 5.2 */
145e27
-	    (symbol_value_from_proc_kallsyms("__kaslr_offset") != BADVAL)) {
145e27
+	if (machine_type("S390X")) { 
145e27
 		kt->flags2 |= (RELOC_AUTO|KASLR);
145e27
 		st->_stext_vmlinux = UNINITIALIZED;
145e27
 	}
145e27
@@ -622,12 +626,6 @@ kaslr_init(void)
145e27
 			kt->flags2 |= KASLR_CHECK;
145e27
 		}
145e27
 	} else if (KDUMP_DUMPFILE() || DISKDUMP_DUMPFILE()) {
145e27
-		if ((string = pc->read_vmcoreinfo("SYMBOL(_stext)"))) {
145e27
-			kt->vmcoreinfo._stext_SYMBOL =
145e27
-				htol(string, RETURN_ON_ERROR, NULL);
145e27
-			free(string);
145e27
-		}
145e27
-
145e27
 		/* Linux 3.14 */
145e27
 		if ((string = pc->read_vmcoreinfo("KERNELOFFSET"))) {
145e27
 			free(string);
145e27
145e27
commit 6e033fe099f8faea8fe284b9f7c08da7bc3af7a7
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Thu Jan 16 11:46:10 2020 -0500
145e27
145e27
    Fix for support of S390X standalone dumpfiles and LKCD dumpfiles that
145e27
    were taken from S390X KASLR kernels.
145e27
    (zaslonko@linux.ibm.com)
145e27
145e27
diff --git a/defs.h b/defs.h
145e27
index efa40b9..88a47d6 100644
145e27
--- a/defs.h
145e27
+++ b/defs.h
145e27
@@ -6267,6 +6267,8 @@ void get_s390_panicmsg(char *);
145e27
 /*
145e27
  *  s390x.c
145e27
  */
145e27
+ulong get_stext_relocated_s390x(void);
145e27
+
145e27
 #ifdef S390X
145e27
 void s390x_init(int);
145e27
 void s390x_dump_machdep_table(ulong);
145e27
diff --git a/s390x.c b/s390x.c
145e27
index 8840cc7..e030f93 100644
145e27
--- a/s390x.c
145e27
+++ b/s390x.c
145e27
@@ -455,6 +455,78 @@ static void s390x_check_live(void)
145e27
 		pc->flags2 |= LIVE_DUMP;
145e27
 }
145e27
 
145e27
+static char *
145e27
+vmcoreinfo_read_string_s390x(const char *vmcoreinfo, const char *key)
145e27
+{
145e27
+	char *value_string = NULL;
145e27
+	size_t value_length;
145e27
+	char keybuf[128];
145e27
+	char *p1, *p2;
145e27
+
145e27
+	sprintf(keybuf, "%s=", key);
145e27
+
145e27
+	if ((p1 = strstr(vmcoreinfo, keybuf))) {
145e27
+		p2 = p1 + strlen(keybuf);
145e27
+		p1 = strstr(p2, "\n");
145e27
+		value_length = p1-p2;
145e27
+		value_string = calloc(value_length + 1, sizeof(char));
145e27
+		strncpy(value_string, p2, value_length);
145e27
+		value_string[value_length] = NULLCHAR;
145e27
+	}
145e27
+
145e27
+	return value_string;
145e27
+}
145e27
+
145e27
+/*
145e27
+ * Read _stext symbol from vmcoreinfo when lowcore vmcoreinfo pointer is present
145e27
+ * in the dump (can be relevant for s390 and lkcd dump formats).
145e27
+ */
145e27
+ulong get_stext_relocated_s390x(void)
145e27
+{
145e27
+	char *_stext_string, *vmcoreinfo;
145e27
+	Elf64_Nhdr note;
145e27
+	char str[128];
145e27
+	ulong val = 0;
145e27
+	ulong addr;
145e27
+
145e27
+	if (!readmem(S390X_LC_VMCORE_INFO, PHYSADDR, &addr,
145e27
+		    sizeof(addr), "s390x vmcoreinfo ptr",
145e27
+		    QUIET|RETURN_ON_ERROR))
145e27
+		return 0;
145e27
+	if (addr == 0 ||  addr & 0x1)
145e27
+		return 0;
145e27
+	if (!readmem(addr, PHYSADDR, &note,
145e27
+		     sizeof(note), "Elf64_Nhdr vmcoreinfo",
145e27
+		     QUIET|RETURN_ON_ERROR))
145e27
+		return 0;
145e27
+	memset(str, 0, sizeof(str));
145e27
+	if (!readmem(addr + sizeof(note), PHYSADDR, str,
145e27
+		     note.n_namesz, "VMCOREINFO",
145e27
+		     QUIET|RETURN_ON_ERROR))
145e27
+		return 0;
145e27
+	if (memcmp(str, "VMCOREINFO", sizeof("VMCOREINFO")) != 0)
145e27
+		return 0;
145e27
+	if ((vmcoreinfo = malloc(note.n_descsz + 1)) == NULL) {
145e27
+		error(INFO, "s390x: cannot malloc vmcoreinfo buffer\n");
145e27
+		return 0;
145e27
+	}
145e27
+	addr = addr + sizeof(note) + note.n_namesz + 1;
145e27
+	if (!readmem(addr, PHYSADDR, vmcoreinfo,
145e27
+		     note.n_descsz, "s390x vmcoreinfo",
145e27
+		     QUIET|RETURN_ON_ERROR)) {
145e27
+		free(vmcoreinfo);
145e27
+		return 0;
145e27
+	}
145e27
+	vmcoreinfo[note.n_descsz] = 0;
145e27
+	if ((_stext_string = vmcoreinfo_read_string_s390x(vmcoreinfo,
145e27
+							  "SYMBOL(_stext)"))) {
145e27
+		val = htol(_stext_string, RETURN_ON_ERROR, NULL);
145e27
+		free(_stext_string);
145e27
+	}
145e27
+	free(vmcoreinfo);
145e27
+	return val;
145e27
+}
145e27
+
145e27
 /*
145e27
  *  Do all necessary machine-specific setup here.  This is called several
145e27
  *  times during initialization.
145e27
@@ -1948,4 +2020,10 @@ s390x_get_kvaddr_ranges(struct vaddr_range *vrp)
145e27
 
145e27
 	return cnt;
145e27
 }
145e27
-#endif 
145e27
+#else
145e27
+#include "defs.h"
145e27
+ulong get_stext_relocated_s390x(void)
145e27
+{
145e27
+	return 0;
145e27
+}
145e27
+#endif  /* S390X */
145e27
diff --git a/symbols.c b/symbols.c
145e27
index 82ac549..6df3358 100644
145e27
--- a/symbols.c
145e27
+++ b/symbols.c
145e27
@@ -614,7 +614,9 @@ kaslr_init(void)
145e27
 		st->_stext_vmlinux = UNINITIALIZED;
145e27
 	}
145e27
 
145e27
-	if (machine_type("S390X")) { 
145e27
+	if (machine_type("S390X")) {
145e27
+		if (!kt->vmcoreinfo._stext_SYMBOL)
145e27
+			kt->vmcoreinfo._stext_SYMBOL = get_stext_relocated_s390x();
145e27
 		kt->flags2 |= (RELOC_AUTO|KASLR);
145e27
 		st->_stext_vmlinux = UNINITIALIZED;
145e27
 	}
145e27
145e27
commit c6b19715495221dca52a57690419f9df9777573d
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Fri Jan 17 13:34:53 2020 -0500
145e27
145e27
    Rework the previous patch for support of S390X standalone dumpfiles
145e27
    and LKCD dumpfiles that were taken from S390X KASLR kernels to avoid
145e27
    calling an s390x-specific function from generic code.
145e27
    (zaslonko@linux.ibm.com)
145e27
145e27
diff --git a/defs.h b/defs.h
145e27
index 88a47d6..efa40b9 100644
145e27
--- a/defs.h
145e27
+++ b/defs.h
145e27
@@ -6267,8 +6267,6 @@ void get_s390_panicmsg(char *);
145e27
 /*
145e27
  *  s390x.c
145e27
  */
145e27
-ulong get_stext_relocated_s390x(void);
145e27
-
145e27
 #ifdef S390X
145e27
 void s390x_init(int);
145e27
 void s390x_dump_machdep_table(ulong);
145e27
diff --git a/s390x.c b/s390x.c
145e27
index e030f93..c07d283 100644
145e27
--- a/s390x.c
145e27
+++ b/s390x.c
145e27
@@ -478,53 +478,72 @@ vmcoreinfo_read_string_s390x(const char *vmcoreinfo, const char *key)
145e27
 }
145e27
 
145e27
 /*
145e27
- * Read _stext symbol from vmcoreinfo when lowcore vmcoreinfo pointer is present
145e27
- * in the dump (can be relevant for s390 and lkcd dump formats).
145e27
+ * Check the value in well-known lowcore location and process it as either
145e27
+ * an explicit KASLR offset (early dump case) or as vmcoreinfo pointer to
145e27
+ * read the relocated _stext symbol value (important for s390 and lkcd dump
145e27
+ * formats).
145e27
  */
145e27
-ulong get_stext_relocated_s390x(void)
145e27
+static void s390x_check_kaslr(void)
145e27
 {
145e27
 	char *_stext_string, *vmcoreinfo;
145e27
 	Elf64_Nhdr note;
145e27
 	char str[128];
145e27
-	ulong val = 0;
145e27
 	ulong addr;
145e27
 
145e27
+	/* Read the value from well-known lowcore location*/
145e27
 	if (!readmem(S390X_LC_VMCORE_INFO, PHYSADDR, &addr,
145e27
 		    sizeof(addr), "s390x vmcoreinfo ptr",
145e27
 		    QUIET|RETURN_ON_ERROR))
145e27
-		return 0;
145e27
-	if (addr == 0 ||  addr & 0x1)
145e27
-		return 0;
145e27
+		return;
145e27
+	if (addr == 0)
145e27
+		return;
145e27
+	/* Check for explicit kaslr offset flag */
145e27
+	if (addr & 0x1UL) {
145e27
+		/* Drop the last bit to get an offset value */
145e27
+		addr &= ~(0x1UL);
145e27
+		/* Make sure the offset is aligned by 0x1000 */
145e27
+		if (addr && !(addr & 0xfff)) {
145e27
+					kt->relocate = addr * (-1);
145e27
+					kt->flags |= RELOC_SET;
145e27
+					kt->flags2 |= KASLR;
145e27
+		}
145e27
+		return;
145e27
+	}
145e27
+	/* Use the addr value as vmcoreinfo pointer */
145e27
 	if (!readmem(addr, PHYSADDR, &note,
145e27
 		     sizeof(note), "Elf64_Nhdr vmcoreinfo",
145e27
 		     QUIET|RETURN_ON_ERROR))
145e27
-		return 0;
145e27
+		return;
145e27
 	memset(str, 0, sizeof(str));
145e27
 	if (!readmem(addr + sizeof(note), PHYSADDR, str,
145e27
 		     note.n_namesz, "VMCOREINFO",
145e27
 		     QUIET|RETURN_ON_ERROR))
145e27
-		return 0;
145e27
+		return;
145e27
 	if (memcmp(str, "VMCOREINFO", sizeof("VMCOREINFO")) != 0)
145e27
-		return 0;
145e27
+		return;
145e27
 	if ((vmcoreinfo = malloc(note.n_descsz + 1)) == NULL) {
145e27
-		error(INFO, "s390x: cannot malloc vmcoreinfo buffer\n");
145e27
-		return 0;
145e27
+		error(INFO, "s390x_check_kaslr: cannot malloc vmcoreinfo buffer\n");
145e27
+		return;
145e27
 	}
145e27
 	addr = addr + sizeof(note) + note.n_namesz + 1;
145e27
 	if (!readmem(addr, PHYSADDR, vmcoreinfo,
145e27
 		     note.n_descsz, "s390x vmcoreinfo",
145e27
 		     QUIET|RETURN_ON_ERROR)) {
145e27
 		free(vmcoreinfo);
145e27
-		return 0;
145e27
+		return;
145e27
 	}
145e27
-	vmcoreinfo[note.n_descsz] = 0;
145e27
+	vmcoreinfo[note.n_descsz] = NULLCHAR;
145e27
+	/*
145e27
+	 * Read relocated _stext symbol value and store it in the kernel_table
145e27
+	 * for further processing within derive_kaslr_offset().
145e27
+	 */
145e27
 	if ((_stext_string = vmcoreinfo_read_string_s390x(vmcoreinfo,
145e27
 							  "SYMBOL(_stext)"))) {
145e27
-		val = htol(_stext_string, RETURN_ON_ERROR, NULL);
145e27
+		kt->vmcoreinfo._stext_SYMBOL = htol(_stext_string,
145e27
+						    RETURN_ON_ERROR, NULL);
145e27
 		free(_stext_string);
145e27
 	}
145e27
 	free(vmcoreinfo);
145e27
-	return val;
145e27
 }
145e27
 
145e27
 /*
145e27
@@ -534,8 +553,6 @@ ulong get_stext_relocated_s390x(void)
145e27
 void
145e27
 s390x_init(int when)
145e27
 {
145e27
-	ulong s390x_lc_kaslr;
145e27
-
145e27
 	switch (when)
145e27
 	{
145e27
 	case SETUP_ENV:
145e27
@@ -562,24 +579,8 @@ s390x_init(int when)
145e27
 		machdep->verify_paddr = generic_verify_paddr;
145e27
 		machdep->get_kvaddr_ranges = s390x_get_kvaddr_ranges;
145e27
 		machdep->ptrs_per_pgd = PTRS_PER_PGD;
145e27
-		if (DUMPFILE() && !(kt->flags & RELOC_SET)) {
145e27
-			/* Read the value from well-known lowcore location*/
145e27
-			if (readmem(S390X_LC_VMCORE_INFO, PHYSADDR, &s390x_lc_kaslr,
145e27
-			    sizeof(s390x_lc_kaslr), "s390x_lc_kaslr",
145e27
-			    QUIET|RETURN_ON_ERROR)) {
145e27
-				/* Check for explicit kaslr offset flag */
145e27
-				if (s390x_lc_kaslr & 0x1UL) {
145e27
-					/* Drop the last bit to get an offset value */
145e27
-					s390x_lc_kaslr &= ~(0x1UL);
145e27
-					/* Make sure the offset is aligned by 0x1000 */
145e27
-					if (s390x_lc_kaslr && !(s390x_lc_kaslr & 0xfff)) {
145e27
-						kt->relocate = s390x_lc_kaslr * (-1);
145e27
-						kt->flags |= RELOC_SET;
145e27
-						kt->flags2 |= KASLR;
145e27
-					}
145e27
-				}
145e27
-			}
145e27
-		}
145e27
+		if (DUMPFILE() && !(kt->flags & RELOC_SET))
145e27
+			s390x_check_kaslr();
145e27
 		break;
145e27
 
145e27
 	case PRE_GDB:
145e27
@@ -2020,10 +2021,4 @@ s390x_get_kvaddr_ranges(struct vaddr_range *vrp)
145e27
 
145e27
 	return cnt;
145e27
 }
145e27
-#else
145e27
-#include "defs.h"
145e27
-ulong get_stext_relocated_s390x(void)
145e27
-{
145e27
-	return 0;
145e27
-}
145e27
 #endif  /* S390X */
145e27
diff --git a/symbols.c b/symbols.c
145e27
index 6df3358..f04e8b5 100644
145e27
--- a/symbols.c
145e27
+++ b/symbols.c
145e27
@@ -597,7 +597,8 @@ kaslr_init(void)
145e27
 	    !machine_type("S390X")) || (kt->flags & RELOC_SET))
145e27
 		return;
145e27
 
145e27
-	if ((string = pc->read_vmcoreinfo("SYMBOL(_stext)"))) {
145e27
+	if (!kt->vmcoreinfo._stext_SYMBOL &&
145e27
+	    (string = pc->read_vmcoreinfo("SYMBOL(_stext)"))) {
145e27
 		kt->vmcoreinfo._stext_SYMBOL = htol(string, RETURN_ON_ERROR, NULL);
145e27
 		free(string);
145e27
 	}
145e27
@@ -615,8 +616,6 @@ kaslr_init(void)
145e27
 	}
145e27
 
145e27
 	if (machine_type("S390X")) {
145e27
-		if (!kt->vmcoreinfo._stext_SYMBOL)
145e27
-			kt->vmcoreinfo._stext_SYMBOL = get_stext_relocated_s390x();
145e27
 		kt->flags2 |= (RELOC_AUTO|KASLR);
145e27
 		st->_stext_vmlinux = UNINITIALIZED;
145e27
 	}
145e27
145e27
commit 6c1c8ac6b3c877e6facd6f2807ba721ddbc4597b
145e27
Author: Dave Anderson <anderson@redhat.com>
145e27
Date:   Wed Jan 29 11:10:26 2020 -0500
145e27
145e27
    Fix for a gcc-10 compilation error.  Without the patch, the build of
145e27
    the crash library fails with a stream of error messages indicating
145e27
    "multiple definition of 'diskdump_flags'"
145e27
    (anderson@redhat.com)
145e27
145e27
diff --git a/defs.h b/defs.h
145e27
index efa40b9..ac24a5d 100644
145e27
--- a/defs.h
145e27
+++ b/defs.h
145e27
@@ -1,8 +1,8 @@
145e27
 /* defs.h - core analysis suite
145e27
  *
145e27
  * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
145e27
- * Copyright (C) 2002-2019 David Anderson
145e27
- * Copyright (C) 2002-2019 Red Hat, Inc. All rights reserved.
145e27
+ * Copyright (C) 2002-2020 David Anderson
145e27
+ * Copyright (C) 2002-2020 Red Hat, Inc. All rights reserved.
145e27
  * Copyright (C) 2002 Silicon Graphics, Inc.
145e27
  *
145e27
  * This program is free software; you can redistribute it and/or modify
145e27
@@ -6447,7 +6447,7 @@ FILE *set_diskdump_fp(FILE *);
145e27
 void get_diskdump_regs(struct bt_info *, ulong *, ulong *);
145e27
 int diskdump_phys_base(unsigned long *);
145e27
 int diskdump_set_phys_base(unsigned long);
145e27
-ulong *diskdump_flags;
145e27
+extern ulong *diskdump_flags;
145e27
 int is_partial_diskdump(void);
145e27
 int get_dump_level(void);
145e27
 int dumpfile_is_split(void);