diff mbox series

RISC-V: Fix implicit definition of flush_tlb_all()

Message ID 20231026145516.25866-1-palmer@rivosinc.com (mailing list archive)
State Not Applicable, archived
Headers show
Series RISC-V: Fix implicit definition of flush_tlb_all() | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail merge-conflict

Commit Message

Palmer Dabbelt Oct. 26, 2023, 2:55 p.m. UTC
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@rivosinc.com>
---
 arch/riscv/include/asm/tlbflush.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

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,