Skip to contentSkip to conversation

Does sfence.vma implicitly cover what fence.i does?

DISCUSSION Alan Kao 2 participants 2 messages Oct 9, 2019 – Oct 16, 2019 RISC-V

lore
Share & tools
lore

Alan Kao

author
#0 lore raw

Hi Paul, Palmer,

In arch/riscv/include/asm/tlbflush.h, the comment says

Quoted 2 lines

Flush entire local TLB. 'sfence.vma' implicitly fences with the instruction cache as well, so a 'fence.i' is not necessary.

and in the privileged spec, it is stated that

Quoted 3 lines

Executing an SFENCE.VMA instruction guarantees that any previous stores already visible to the current RISC-V hart are ordered before all subsequent implicit references from that hart to the memory-management data structures.

So my question is straightforward. Is I-cache a kind of memory-management data structure? am I missing something here?

Thanks for any clarification.

Alan

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#1 lore raw

Hi Alan,

Quoted 7 lines · Alan Kao

In arch/riscv/include/asm/tlbflush.h, the comment says

Quoted 2 lines

Flush entire local TLB. 'sfence.vma' implicitly fences with the instruction cache as well, so a 'fence.i' is not necessary.

and in the privileged spec, it is stated that

Quoted 8 lines
Quoted 3 lines

Executing an SFENCE.VMA instruction guarantees that any previous stores already visible to the current RISC-V hart are ordered before all subsequent implicit references from that hart to the memory-management data structures.

So my question is straightforward. Is I-cache a kind of memory-management data structure? am I missing something here?

Thanks for any clarification.

We just had a discussion about this with Andrew. He clarified that SFENCE.VMA does not imply a FENCE.I, and we concluded that the comment in tlbflush.h is more confusing than helpful. So we'll remove it:

https://lore.kernel.org/linux-riscv/[email protected]/T/#u

Thanks for bringing this up,

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv