Skip to contentSkip to conversation

riscv: fix build error when CONFIG_SMP is disabled

PATCH In review Bixuan Cui 2 participants 2 messages May 29, 2021 – Jun 9, 2021 RISC-V

lore
Share & tools
lore

Bixuan Cui

author
#0 lore raw

PATCH v3 1/1 riscv: 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'

Fixes e88b333142e4 ("riscv: mm: add THP support on 64-bit")

---
Changes in v3:
Deleted the declaration of the flush_pmd_tlb_range() in the patch

Changes in v2:
Move the declaration of flush_pmd_tlb_rang to tlbflush.h

 arch/riscv/include/asm/pgtable.h  | 5 -----
 arch/riscv/include/asm/tlbflush.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/riscv/include/asm/pgtable.h +0 -5
index 29e2c836848d..eda31002c4b1 100644
@@ -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 +5 -0
index c84218ad7afc..801019381dea 100644
@@ -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
 #else /* CONFIG_SMP && CONFIG_MMU */
 
 #define flush_tlb_all() local_flush_tlb_all()
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 45 lines · On Sat, 29 May 2021 01:06:57 PDT (-0700), [email protected] wrote:

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'

Fixes e88b333142e4 ("riscv: mm: add THP support on 64-bit")

---
Changes in v3:
Deleted the declaration of the flush_pmd_tlb_range() in the patch

Changes in v2:
Move the declaration of flush_pmd_tlb_rang to tlbflush.h

 arch/riscv/include/asm/pgtable.h  | 5 -----
 arch/riscv/include/asm/tlbflush.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/riscv/include/asm/pgtable.h +0 -5
index 29e2c836848d..eda31002c4b1 100644
@@ -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
index c84218ad7afc..801019381dea 100644
@@ -33,6 +33,11 @@ void flush_tlb_mm(struct mm_struct *mm);
 void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr);

arch/riscv/include/asm/tlbflush.h void flush_tlb_mm(struct mm_struct *mm); · line 43

Quoted 10 lines
arch/riscv/include/asm/tlbflush.h +5 -0
 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
 #else /* CONFIG_SMP && CONFIG_MMU */
 
 #define flush_tlb_all() local_flush_tlb_all()

Thanks, this is on for-next.