[PATCH] RISC-V: Fix implicit definition of flush_tlb_all()

Palmer Dabbelt palmer at rivosinc.com
Thu Oct 26 07:55:16 PDT 2023


Without this I get allnoconfig builds failing with

      CC      arch/riscv/kernel/asm-offsets.s
    In file included from /scratch/merges/ko-linux-next/linux/arch/riscv/include/asm/pgtable.h:117,
                     from /scratch/merges/ko-linux-next/linux/include/linux/pgtable.h:6,
                     from /scratch/merges/ko-linux-next/linux/include/linux/mm.h:29,
                     from /scratch/merges/ko-linux-next/linux/arch/riscv/kernel/asm-offsets.c:10:
    /scratch/merges/ko-linux-next/linux/arch/riscv/include/asm/tlbflush.h: In function 'flush_tlb_kernel_range':
    /scratch/merges/ko-linux-next/linux/arch/riscv/include/asm/tlbflush.h:60:9: error: implicit declaration of function 'flush_tlb_all' [-Werror=implicit-function-declaration]
       60 |         flush_tlb_all();

Signed-off-by: Palmer Dabbelt <palmer at rivosinc.com>
---
 arch/riscv/include/asm/tlbflush.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/riscv/include/asm/tlbflush.h b/arch/riscv/include/asm/tlbflush.h
index a947ae3afd28..440cf8f176d4 100644
--- a/arch/riscv/include/asm/tlbflush.h
+++ b/arch/riscv/include/asm/tlbflush.h
@@ -11,6 +11,12 @@
 #include <asm/smp.h>
 #include <asm/errata_list.h>
 
+#ifdef CONFIG_SMP
+void flush_tlb_all(void);
+#else
+#define flush_tlb_all() local_flush_tlb_all()
+#endif
+
 #ifdef CONFIG_MMU
 static inline void local_flush_tlb_all(void)
 {
@@ -34,11 +40,6 @@ static inline void local_flush_tlb_page_asid(unsigned long addr,
 	ALT_SFENCE_VMA_ADDR_ASID(addr, asid);
 }
 
-#ifdef CONFIG_SMP
-void flush_tlb_all(void);
-#else
-#define flush_tlb_all() local_flush_tlb_all()
-#endif
 void flush_tlb_mm(struct mm_struct *mm);
 void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr);
 void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
-- 
2.42.0




More information about the linux-riscv mailing list