[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1438145496-5932-4-git-send-email-indou.takao@jp.fujitsu.com>
Date: Wed, 29 Jul 2015 13:51:36 +0900
From: Takao Indoh <indou.takao@...fujitsu.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Vivek Goyal <vgoyal@...hat.com>
CC: <linux-kernel@...r.kernel.org>, <x86@...nel.org>
Subject: [PATCH RFC 3/3] x86: Stop Intel PT and save its registers when panic occurs
When panic occurs, Intel PT logging is stopped to prevent it from
overwrite its log buffer. The registers of Intel PT are saved in the
memory on panic, they are needed for debugger to find the last position
where Intel PT wrote data.
Signed-off-by: Takao Indoh <indou.takao@...fujitsu.com>
---
arch/x86/include/asm/intel_pt.h | 2 ++
arch/x86/kernel/crash.c | 9 +++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/intel_pt.h b/arch/x86/include/asm/intel_pt.h
index 7cb16e1..71bcd8d 100644
--- a/arch/x86/include/asm/intel_pt.h
+++ b/arch/x86/include/asm/intel_pt.h
@@ -79,4 +79,6 @@ u32 pt_cap_get(enum pt_capabilities cap);
const char *pt_cap_name(enum pt_capabilities cap);
int pt_cap_num(void);
+void save_intel_pt_registers(void);
+
#endif /* __INTEL_PT_H__ */
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index e068d66..953c086 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -35,6 +35,7 @@
#include <asm/cpu.h>
#include <asm/reboot.h>
#include <asm/virtext.h>
+#include <asm/intel_pt.h>
/* Alignment required for elf header segment */
#define ELF_CORE_HEADER_ALIGN 4096
@@ -127,6 +128,10 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs)
cpu_emergency_vmxoff();
cpu_emergency_svm_disable();
+#ifdef CONFIG_X86_INTEL_PT_LOG
+ save_intel_pt_registers();
+#endif
+
disable_local_APIC();
}
@@ -172,6 +177,10 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
cpu_emergency_vmxoff();
cpu_emergency_svm_disable();
+#ifdef CONFIG_X86_INTEL_PT_LOG
+ save_intel_pt_registers();
+#endif
+
#ifdef CONFIG_X86_IO_APIC
/* Prevent crash_kexec() from deadlocking on ioapic_lock. */
ioapic_zap_locks();
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists