From 7b27f4745d50e6e89c6d91da014506afe40b3644 Mon Sep 17 00:00:00 2001 From: Jeongtae Park Date: Fri, 1 Jun 2018 09:14:14 +0900 Subject: [PATCH] [HACK] arm64: add cpu information log Change-Id: I052697b4a5bfa77f9351a5659989d522fba1ab18 Signed-off-by: Jeongtae Park --- arch/arm64/include/asm/fpsimd.h | 1 + arch/arm64/kernel/fpsimd.c | 1 + arch/arm64/kernel/process.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index 82760fc0cd3e..0c784246a5dd 100644 --- a/arch/arm64/include/asm/fpsimd.h +++ b/arch/arm64/include/asm/fpsimd.h @@ -45,6 +45,7 @@ struct fpsimd_kernel_state { __uint128_t vregs[32]; u32 fpsr; u32 fpcr; + unsigned int cpu; /* * indicate the depth of using FP/SIMD registers in kernel mode. * above kernel state should be preserved at first time diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index b81abcc6d836..805b9c746e55 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -153,6 +153,7 @@ void fpsimd_thread_switch(struct task_struct *next) if (atomic_read(&nxt_kst->depth)) { fpsimd_load_state((struct fpsimd_state *)nxt_kst); this_cpu_write(fpsimd_last_state, (struct fpsimd_state *)nxt_kst); + nxt_kst->cpu = smp_processor_id(); } if (next->mm) { diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index a91a40232c01..f9dddce3720f 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -264,6 +264,10 @@ void __show_regs(struct pt_regs *regs) dbg_snapshot_set_enable("log_kevents", false); } + pr_info("TIF_FOREIGN_FPSTATE: %d, FP/SIMD depth %d, cpu: %d\n", + atomic_read(¤t->thread.fpsimd_kernel_state.depth), + current->thread.fpsimd_kernel_state.cpu); + show_regs_print_info(KERN_DEFAULT); print_symbol("PC is at %s\n", instruction_pointer(regs)); print_symbol("LR is at %s\n", lr); -- 2.20.1