Skip to content

Commit c901e45

Browse files
RISC-V: sfence.vma orderes the instruction cache
This is just a comment change, but it's one that bit me on the mailing list. It turns out that issuing a `sfence.vma` enforces instruction cache ordering in addition to TLB ordering. This isn't explicitly called out in the ISA manual, but Andrew will be making that more clear in a future revision. CC: Andrew Waterman <andrew@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
1 parent 21db403 commit c901e45

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/riscv/include/asm/tlbflush.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717

1818
#ifdef CONFIG_MMU
1919

20-
/* Flush entire local TLB */
20+
/*
21+
* Flush entire local TLB. 'sfence.vma' implicitly fences with the instruction
22+
* cache as well, so a 'fence.i' is not necessary.
23+
*/
2124
static inline void local_flush_tlb_all(void)
2225
{
2326
__asm__ __volatile__ ("sfence.vma" : : : "memory");

0 commit comments

Comments
 (0)