Skip to content

Commit

Permalink
target/arc: do not invalidate icache when (un)setting breakpoints
Browse files Browse the repository at this point in the history
Currently, instruction cache is being invalidated in
arc_{un,}set_breakpoint() regardless of whether the breakpoint's type is
HW or SW. For SW breakpoints, this has no net effect as the caches are
flushed as a by-product of overwriting instructions in main memory and
is thus merely unnecessary; but for HW breakpoints this invalidation is
not preceded by a flush and might lead to loss of data. This patch
removes the invalidate() call altogether to correct this undesired
behavior for HW breakpoints.

With this patch applied, all supported HW breakpoint tests from the gdb
testsuite are now passing with the arc-openocd backend.

Change-Id: I3d252b97f01f1a1e2bf0eb8fb257bdab0c544bc2
Signed-off-by: Artemiy Volkov <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/7767
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <[email protected]>
Reviewed-by: Antonio Borneo <[email protected]>
  • Loading branch information
artemiy-volkov authored and borneoa committed Oct 7, 2023
1 parent bdf7361 commit d20304b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/target/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,9 +1573,6 @@ static int arc_set_breakpoint(struct target *target,
return ERROR_FAIL;
}

/* core instruction cache is now invalid. */
CHECK_RETVAL(arc_cache_invalidate(target));

return ERROR_OK;
}

Expand Down Expand Up @@ -1658,9 +1655,6 @@ static int arc_unset_breakpoint(struct target *target,
return ERROR_FAIL;
}

/* core instruction cache is now invalid. */
CHECK_RETVAL(arc_cache_invalidate(target));

return retval;
}

Expand Down

0 comments on commit d20304b

Please sign in to comment.