module: fix build error when CONFIG_SMP is disabled
PATCH 1/1 module: fix build error when CONFIG_SMP is disabled
Fix build error when disable CONFIG_SMP:mm/pgtable-generic.o: In function `.L19':
pgtable-generic.c:(.text+0x42): undefined reference to flush_pmd_tlb_range' mm/pgtable-generic.o: In function pmdp_huge_clear_flush':
pgtable-generic.c:(.text+0x6c): undefined reference to flush_pmd_tlb_range' mm/pgtable-generic.o: In function pmdp_invalidate':
pgtable-generic.c:(.text+0x162): undefined reference to `flush_pmd_tlb_range'
--- arch/riscv/include/asm/tlbflush.h | 6 ++++++ 1 file changed, 6 insertions(+)
arch/riscv/include/asm/tlbflush.h +6 -0
@@ -44,6 +44,12 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, local_flush_tlb_all(); } +static inline void flush_pmd_tlb_range (struct vm_area_struct *vma, +unsigned long start,unsigned long end) +{ +local_flush_tlb_all (); +} +#define flush_tlb_mm (mm) flush_tlb_all()#endif /* !CONFIG_SMP || !CONFIG_MMU */
Signature · 1 line
2.17.1
Quoted 6 lines · Bixuan Cui
arch/riscv/include/asm/tlbflush.h +0
-0@@ -44,6 +44,12 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,local_flush_tlb_all ();
arch/riscv/include/asm/tlbflush.h static inline void flush_tlb_range(struct vm_area_struct *vma, · line 54
Quoted 10 lines
arch/riscv/include/asm/tlbflush.h +6
-0} +static inline void flush_pmd_tlb_range (struct vm_area_struct *vma, +unsigned long start,unsigned long end) +{ +local_flush_tlb_all (); +} +#define flush_tlb_mm (mm) flush_tlb_all()#endif /* !CONFIG_SMP || !CONFIG_MMU */
Move the prototype of flush_pmd_tlb_range from pgtable.h to tlbflush.h
can also fix this problem, and it seems that declare flush_pmd_tlb_range in tlbflush.h
is better.
We could
arch/riscv/include/asm/pgtable.h +0 -0
@@ -622,11 +622,6 @@ static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
{
return __pmd(atomic_long_xchg((atomic_long_t *)pmdp, pmd_val(pmd))); }
-
-#define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
-void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, - unsigned long end);
-
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
/*
arch/riscv/include/asm/tlbflush.h +0 -0
@@ -33,6 +33,11 @@ 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, unsigned long end);
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+#define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
+void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, + unsigned long end);
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
#else /* CONFIG_SMP && CONFIG_MMU */
#define flush_tlb_all() local_flush_tlb_all()
In this way , flush_p(m/u)d_tlb_range will be defined in include/linux/pgtable.h if
CONFIG_SMP is not set.
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 7 lines · Intelligent Computing Solution Development Dep)
Move the prototype of
flush_pmd_tlb_rangefrompgtable.htotlbflush.hcan also fix this problem, and it seems that declare
flush_pmd_tlb_rangeintlbflush.his better.
We could
Agree with you.
Thanks
Bixuan Cui