Loading arch/arm64/include/asm/debug-monitors.h +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ /* MDSCR_EL1 enabling bits */ #define DBG_MDSCR_KDE (1 << 13) #define DBG_MDSCR_HDE (1 << 14) #define DBG_MDSCR_MDE (1 << 15) #define DBG_MDSCR_MASK ~(DBG_MDSCR_KDE | DBG_MDSCR_MDE) Loading arch/arm64/kernel/hw_breakpoint.c +19 −0 Original line number Diff line number Diff line Loading @@ -933,6 +933,17 @@ void hw_breakpoint_thread_switch(struct task_struct *next) !next_debug_info->wps_disabled); } /* * Check if halted debug mode is enabled. */ static u32 hde_enabled(void) { u32 mdscr; asm volatile("mrs %0, mdscr_el1" : "=r" (mdscr)); return (mdscr & DBG_MDSCR_HDE); } /* * CPU initialisation. */ Loading @@ -940,6 +951,14 @@ static int hw_breakpoint_reset(unsigned int cpu) { int i; struct perf_event **slots; /* * When halting debug mode is enabled, break point could be already * set be external debugger. Don't reset debug registers here to * reserve break point from external debugger. */ if (hde_enabled()) return 0; /* * When a CPU goes through cold-boot, it does not have any installed * slot, so it is safe to share the same function for restoring and Loading Loading
arch/arm64/include/asm/debug-monitors.h +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ /* MDSCR_EL1 enabling bits */ #define DBG_MDSCR_KDE (1 << 13) #define DBG_MDSCR_HDE (1 << 14) #define DBG_MDSCR_MDE (1 << 15) #define DBG_MDSCR_MASK ~(DBG_MDSCR_KDE | DBG_MDSCR_MDE) Loading
arch/arm64/kernel/hw_breakpoint.c +19 −0 Original line number Diff line number Diff line Loading @@ -933,6 +933,17 @@ void hw_breakpoint_thread_switch(struct task_struct *next) !next_debug_info->wps_disabled); } /* * Check if halted debug mode is enabled. */ static u32 hde_enabled(void) { u32 mdscr; asm volatile("mrs %0, mdscr_el1" : "=r" (mdscr)); return (mdscr & DBG_MDSCR_HDE); } /* * CPU initialisation. */ Loading @@ -940,6 +951,14 @@ static int hw_breakpoint_reset(unsigned int cpu) { int i; struct perf_event **slots; /* * When halting debug mode is enabled, break point could be already * set be external debugger. Don't reset debug registers here to * reserve break point from external debugger. */ if (hde_enabled()) return 0; /* * When a CPU goes through cold-boot, it does not have any installed * slot, so it is safe to share the same function for restoring and Loading