From ae921882db7e3113e97c0132b9f2b768e3786384 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 20 Oct 2017 15:05:27 +0900 Subject: [PATCH] ARM: hw_breakpoint: blacklist nexell CPUs On s5p4418 nexell soc, the kernel crashes in arch_hw_breakpoint_init when CONFIG_PERF_EVENTS option is enabled, taking an undefined instruction trap. Blacklist nexell CPUs as like Scorpion CPUs. Reference: ddc37832a134 ("ARM: 8634/1: hw_breakpoint: blacklist Scorpion CPUs") Change-Id: I2aa6f43467d2369e1d08ae02dd1b64fc4410a701 Signed-off-by: Seung-Woo Kim --- arch/arm/include/asm/cputype.h | 3 +++ arch/arm/kernel/hw_breakpoint.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index e9d04f4..ba52a71 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h @@ -84,6 +84,9 @@ /* Qualcomm implemented cores */ #define ARM_CPU_PART_SCORPION 0x510002d0 +/* Nexell implemented cores */ +#define ARM_CPU_PART_NEXELL 0x4100c090 + extern unsigned int processor_id; #ifdef CONFIG_CPU_CP15 diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index abcbea1..28a3eba 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c @@ -1082,6 +1082,11 @@ static int __init arch_hw_breakpoint_init(void) return 0; } + if (read_cpuid_part() == ARM_CPU_PART_NEXELL) { + pr_info("NEXELL CPU detected. Hardware breakpoints and watchpoints disabled\n"); + return 0; + } + has_ossr = core_has_os_save_restore(); /* Determine how many BRPs/WRPs are available. */ -- 2.7.4