Skip to content

Commit

Permalink
ARM64 icache flush: Don't bother with the minimum cache line size, ju…
Browse files Browse the repository at this point in the history
…st use the current.
  • Loading branch information
hrydgard committed Sep 10, 2016
1 parent cc8f66b commit 0b8a3e8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Common/Arm64Emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,10 @@ void ARM64XEmitter::FlushIcacheSection(u8* start, u8* end)
// icache/dcache cache line sizes, that can vary between cores on
// big.LITTLE architectures.
u64 addr, ctr_el0;
static size_t icache_line_size = 0xffff, dcache_line_size = 0xffff;
size_t isize, dsize;

__asm__ volatile("mrs %0, ctr_el0" : "=r"(ctr_el0));
isize = 4 << ((ctr_el0 >> 0) & 0xf);
dsize = 4 << ((ctr_el0 >> 16) & 0xf);

// use the global minimum cache line size
icache_line_size = isize = icache_line_size < isize ? icache_line_size : isize;
dcache_line_size = dsize = dcache_line_size < dsize ? dcache_line_size : dsize;
size_t isize = 4 << ((ctr_el0 >> 0) & 0xf);
size_t dsize = 4 << ((ctr_el0 >> 16) & 0xf);

addr = (u64)start & ~(u64)(dsize - 1);
for (; addr < (u64)end; addr += dsize)
Expand Down

0 comments on commit 0b8a3e8

Please sign in to comment.