ruyisdk / linux-xuantie-kernel

Other
18 stars 26 forks source link

riscv: mm: Add support for Svinval extension #176

Closed guoren83 closed 1 month ago

guoren83 commented 1 month ago

The Svinval extension splits SFENCE.VMA instruction into finer-grained invalidation and ordering operations and is mandatory for RVA23S64 profile. When Svinval is enabled the local_flush_tlb_range_threshold_asid function should use the following sequence to optimize the tlb flushes instead of a simple sfence.vma:

sfence.w.inval svinval.vma . . svinval.vma sfence.inval.ir

The maximum number of consecutive svinval.vma instructions that can be executed in local_flush_tlb_range_threshold_asid function is limited to 64. This is required to avoid soft lockups and the approach is similar to that used in arm64.

Reviewed-by: Andrew Jones ajones@ventanamicro.com