Skip to content

Commit

Permalink
plat/common/arm: Do not use a barrier on every invalidation
Browse files Browse the repository at this point in the history
The current implementation of clean and invalidate by region uses
a barrier after every cache line. This is unnecessary and expensive.
Use a barrier once, at the end of the operation.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
  • Loading branch information
michpappas committed Aug 15, 2023
1 parent caba225 commit 74ce86b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions plat/common/arm/cache64.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,14 @@ ENTRY(clean_and_invalidate_dcache_range)
1:
/* clean and invalidate D cache by D cache line size */
dc civac, x0
dsb nsh

/* Move to next line and reduce the size */
add x0, x0, x3
subs x1, x1, x3

/* Check if all range has been invalidated */
b.hi 1b

isb

dsb sy
ret
END(clean_and_invalidate_dcache_range)

Expand Down Expand Up @@ -99,8 +96,6 @@ ENTRY(invalidate_dcache_range)

/* Check if all range has been invalidated */
b.hi 1b

isb

dsb sy
ret
END(invalidate_dcache_range)

0 comments on commit 74ce86b

Please sign in to comment.