lib: sbi: Allow custom local TLB flush function
authorAnup Patel <anup.patel@wdc.com>
Tue, 29 Dec 2020 08:21:06 +0000 (13:51 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 7 Jan 2021 04:23:19 +0000 (09:53 +0530)
commit12394a269b8b60e2d37b56afb2fa39fde6a3a4b8
tree39e2d783172cf53f62c368d1daa0cfcc0d3502db
parentb7df5e4392d34d8b8d5290d5b857676e672d4c96
lib: sbi: Allow custom local TLB flush function

Currently, we have fixed TLB flush types supported by the
remote TLB library. This approach is not flexible and does
not allow custom local TLB flush function. For example,
after updating PMP entries on a set of HARTs at runtime,
we have to flush TLB on these HARTs as well.

To support custom local TLB flush function, we replace the
"type" field of "struct sbi_tlb_info" with a local TLB flush
function pointer. We also provide definitions of standard TLB
flush operations (such as fence_i, sfence.vma, hfence.vvma,
hfence.gvma, etc).

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
include/sbi/sbi_tlb.h
lib/sbi/sbi_ecall_legacy.c
lib/sbi/sbi_ecall_replace.c
lib/sbi/sbi_tlb.c