Don't issue extra FENCE+FENCE.i for the current hart. (#439)

The original OpenOCD code issued FENCE & FENCE.i twice for the current
hart (which is harmless, but takes time).

Avoiding this extra FENCE is a slight performance improvement. Per my rough
measurements, this improves performance of certain debugger actions
(single-stepping) by approx. 20% in single-hart systems.
vector2
Jan Matyas 2020-01-10 21:29:10 +01:00 committed by Tim Newsome
parent 8b8db033ee
commit fcea4f79ba
1 changed files with 4 additions and 0 deletions

View File

@ -2010,6 +2010,10 @@ static int execute_fence(struct target *target)
if (!riscv_hart_enabled(target, i)) if (!riscv_hart_enabled(target, i))
continue; continue;
if (i == old_hartid)
/* Fence already executed for this hart */
continue;
riscv_set_current_hartid(target, i); riscv_set_current_hartid(target, i);
struct riscv_program program; struct riscv_program program;