From b351b88aa91981c91d471241f00f9d478c741ace Mon Sep 17 00:00:00 2001 From: Xiaoguang Xing Date: Thu, 29 Aug 2024 20:51:23 +0800 Subject: [PATCH] lib: Invalid all tlb entries to workaroud c920 bug Signed-off-by: Xiaoguang Xing --- lib/sbi/sbi_tlb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/sbi/sbi_tlb.c b/lib/sbi/sbi_tlb.c index 1aaf686729..b0082ad81b 100644 --- a/lib/sbi/sbi_tlb.c +++ b/lib/sbi/sbi_tlb.c @@ -79,6 +79,7 @@ static void sbi_tlb_local_hfence_gvma(struct sbi_tlb_info *tinfo) static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo) { +#if 0 unsigned long start = tinfo->start; unsigned long size = tinfo->size; unsigned long i; @@ -96,6 +97,11 @@ static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo) : "r"(start + i) : "memory"); } +#else + sbi_pmu_ctr_incr_fw(SBI_PMU_FW_SFENCE_VMA_RCVD); + + tlb_flush_all(); +#endif } static void sbi_tlb_local_hfence_vvma_asid(struct sbi_tlb_info *tinfo)