From 5db4d232ee4769d4e0b6a24d461219103fdd4edf Mon Sep 17 00:00:00 2001 From: Alwin Joshy Date: Thu, 15 Feb 2024 17:58:17 +1100 Subject: [PATCH] found the problem, haven't figured out why Signed-off-by: Alwin Joshy --- include/arch/arm/arch/machine/debug.h | 10 ++++------ src/arch/arm/64/machine/debug.c | 2 -- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/arch/arm/arch/machine/debug.h b/include/arch/arm/arch/machine/debug.h index 164d2d4f391..598acf2701e 100644 --- a/include/arch/arm/arch/machine/debug.h +++ b/include/arch/arm/arch/machine/debug.h @@ -86,9 +86,7 @@ static inline void setHDCRTrapDebugExceptionState(bool_t enable_trapping) { word_t hdcr; #ifdef CONFIG_ARCH_AARCH64 - word_t hcr; MRS("mdcr_el2", hdcr); - MRS("hcr_el2", hcr); #else MRC(ARM_CP15_HDCR, hdcr); #endif @@ -102,7 +100,7 @@ static inline void setHDCRTrapDebugExceptionState(bool_t enable_trapping) | BIT(HDCR_DEBUG_TDOSA_SHIFT)); #ifdef CONFIG_ARCH_AARCH64 // @alwin: I think only this is necessary on aarch64 actually - hcr |= (HCR_TGE); + // hcr |= (HCR_TGE); #endif } else { @@ -111,14 +109,14 @@ static inline void setHDCRTrapDebugExceptionState(bool_t enable_trapping) | BIT(HDCR_DEBUG_TDA_SHIFT) | BIT(HDCR_DEBUG_TDRA_SHIFT) | BIT(HDCR_DEBUG_TDOSA_SHIFT)); - } #ifdef CONFIG_ARCH_AARCH64 // @alwin: I think only this is necessary on aarch64 actually - hcr &= ~HCR_TGE; + // hcr |= (HCR_TGE); #endif + + } #ifdef CONFIG_ARCH_AARCH64 MSR("mdcr_el2", hdcr); - MSR("hcr_el2", hcr); #else MCR(ARM_CP15_HDCR, hdcr); #endif diff --git a/src/arch/arm/64/machine/debug.c b/src/arch/arm/64/machine/debug.c index 595e623b81c..404bfce3ee4 100644 --- a/src/arch/arm/64/machine/debug.c +++ b/src/arch/arm/64/machine/debug.c @@ -42,7 +42,6 @@ */ bool_t configureSingleStepping(tcb_t *t, uint16_t bp_num, word_t n_instr, bool_t is_reply) { - if (n_instr > 0) { /* Enable single stepping */ t->tcbArch.tcbContext.breakpointState.single_step_enabled = true; @@ -57,7 +56,6 @@ bool_t configureSingleStepping(tcb_t *t, uint16_t bp_num, word_t n_instr, /* Guides the debug hardware initialization sequence. */ BOOT_CODE bool_t Arch_initHardwareBreakpoints(void) { - /* * ARMv8 Architecture Reference Manual for A-profile Architecture * D2.2: The Enable controls for each debug exception are: