From: openocd-gerrit <ope...@us...> - 2023-11-18 11:21:43
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ee96a95d44322aa109847e35b86aed5ad3066cf8 (commit) from 851d1ad87a6e9f1ae1b44b8ac395138031290488 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ee96a95d44322aa109847e35b86aed5ad3066cf8 Author: Peter Collingbourne <pc...@go...> Date: Wed Sep 27 17:02:03 2023 -0700 openocd: src/target: Correctly handle CCSIDR_EL1.Associativity=0 Associativity=0 means that only one CMO is needed for all ways. It could also mean that the cache is 1-way, but this is less likely. Currently Associativity=0 causes us to hang in the while loop in decode_cache_reg. Fix it by skipping the loop in this case. We can let way_shift be set to the arbitrary value of 0 because in the case where Associativity=0 we only ever shift 0 by it before ORing it into the CMO operand. Change-Id: I7c1de68d33f6b3ed627cbb1e2401d43185e4c1e3 Signed-off-by: Peter Collingbourne <pc...@go...> Reviewed-on: https://review.openocd.org/c/openocd/+/7916 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/armv8_cache.c b/src/target/armv8_cache.c index cf7111950..98f4b3f04 100644 --- a/src/target/armv8_cache.c +++ b/src/target/armv8_cache.c @@ -286,8 +286,9 @@ static struct armv8_cachesize decode_cache_reg(uint32_t cache_reg) size.index = (cache_reg >> 13) & 0x7fff; size.way = ((cache_reg >> 3) & 0x3ff); - while (((size.way << i) & 0x80000000) == 0) - i++; + if (size.way != 0) + while (((size.way << i) & 0x80000000) == 0) + i++; size.way_shift = i; return size; ----------------------------------------------------------------------- Summary of changes: src/target/armv8_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |