crash/0007-MIPS64-three-fixes-for-MIPS64-kernels.patch
Lianbo Jiang 42254b004a Update to the latest upstream <f53b73e8380b>
Release: crash-7.3.0-2

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
2021-07-13 16:27:19 +08:00

68 lines
2.2 KiB
Diff

From c15a1e025e62134094ba0ac600263d75673d5a22 Mon Sep 17 00:00:00 2001
From: Youling Tang <tangyouling@loongson.cn>
Date: Fri, 23 Apr 2021 15:42:11 +0800
Subject: [PATCH 07/16] MIPS64: three fixes for MIPS64 kernels
Three fixes for MIPS64 kernels:
(1) To support ramdumps, add the machine_type() check for MIPS64 in
ramdump_to_elf().
(2) To fix a stuck issue when invoking crash with "-d1" or larger
debug value, add the machine_type() check to get the correct
dump NOTE offsets.
(3) Fix the reference file path to the definition of the pt_regs
structure, to which mips64_regster refers.
[ kh: merged three patches into one ]
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
---
defs.h | 2 +-
diskdump.c | 2 +-
ramdump.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/defs.h b/defs.h
index 3502c6d6e90c..148b03e14455 100644
--- a/defs.h
+++ b/defs.h
@@ -6488,7 +6488,7 @@ void mips64_dump_machdep_table(ulong);
#define display_idt_table() \
error(FATAL, "-d option is not applicable to MIPS64 architecture\n")
-/* from arch/mips/include/uapi/asm/ptrace.h */
+/* from arch/mips/include/asm/ptrace.h */
struct mips64_register {
ulong regs[45];
};
diff --git a/diskdump.c b/diskdump.c
index 3effb52771c6..668069585080 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -1700,7 +1700,7 @@ dump_note_offsets(FILE *fp)
qemu = FALSE;
if (machine_type("X86_64") || machine_type("S390X") ||
machine_type("ARM64") || machine_type("PPC64") ||
- machine_type("SPARC64")) {
+ machine_type("SPARC64") || machine_type("MIPS64")) {
note64 = (void *)dd->notes_buf + tot;
len = sizeof(Elf64_Nhdr);
if (STRNEQ((char *)note64 + len, "QEMU"))
diff --git a/ramdump.c b/ramdump.c
index 4c4a920a8281..a206fcbbab3c 100644
--- a/ramdump.c
+++ b/ramdump.c
@@ -184,7 +184,7 @@ char *ramdump_to_elf(void)
e_machine = EM_ARM;
else if (machine_type("ARM64"))
e_machine = EM_AARCH64;
- else if (machine_type("MIPS"))
+ else if (machine_type("MIPS") || machine_type("MIPS64"))
e_machine = EM_MIPS;
else if (machine_type("X86_64"))
e_machine = EM_X86_64;
--
2.30.2