]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
RISC-V: `sfence.vma` orderes the instruction cache
authorPalmer Dabbelt <palmer@sifive.com>
Tue, 28 Nov 2017 22:06:17 +0000 (14:06 -0800)
committerPalmer Dabbelt <palmer@sifive.com>
Tue, 28 Nov 2017 22:06:17 +0000 (14:06 -0800)
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>
arch/riscv/include/asm/tlbflush.h

index 5ee4ae370b5e54d49f3c062d1a19c30ca3ddfec2..c79fab3d377d3d3eda77131feb3f681e09172e01 100644 (file)
 
 #ifdef CONFIG_MMU
 
-/* Flush entire local TLB */
+/*
+ * Flush entire local TLB.  'sfence.vma' implicitly fences with the instruction
+ * cache as well, so a 'fence.i' is not necessary.
+ */
 static inline void local_flush_tlb_all(void)
 {
        __asm__ __volatile__ ("sfence.vma" : : : "memory");