This is an automated email from Gerrit.

Weijie Gao (hackpas...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/6052

-- gerrit

commit dd5e2fb9290628e21a90b6681e9318cdc79df5ca
Author: Weijie Gao <hackpas...@gmail.com>
Date:   Tue Feb 2 10:51:25 2021 +0800

    armv8: do not read ESR_EL3 in AArch32 state
    
    Currently reading ESR_EL3 in AArch32 state is not supported, and an error
    will br returned directly by armv8_read_reg32(). This error will cause
    the armv8_dpm_read_current_registers() to fail immediately.
    
    Everytime a core is halted in AArch32 state, openocd will behave
    abnormally with error "Failed to read ESR_EL3 register". For example the
    current core state, mode, PC, CPSR, cache and MMU state will not be shown.
    
    By just skipping reading ESR_EL3 in AArch32 state, this issue can be
    easily fixed with no side effect.
    
    Change-Id: I9993cf7f8ca63d5885e7a01886c461c9a13b700a
    Signed-off-by: Weijie Gao <hackpas...@gmail.com>

diff --git a/src/target/armv8_dpm.c b/src/target/armv8_dpm.c
index 1e88a44..702018d 100644
--- a/src/target/armv8_dpm.c
+++ b/src/target/armv8_dpm.c
@@ -802,6 +802,10 @@ int armv8_dpm_read_current_registers(struct arm_dpm *dpm)
                if (r->number == ARMV8_SPSR_EL1 && arm->core_mode == 
ARM_MODE_SYS)
                        continue;
 
+               /* Skip reading ESR_EL3 in AArch32 state */
+               if (r->number == ARMV8_ESR_EL3 && (arm->core_state != 
ARM_STATE_AARCH64))
+                       continue;
+
                retval = dpmv8_read_reg(dpm, r, i);
                if (retval != ERROR_OK)
                        goto fail;

-- 


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to