lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 29 May 2021 12:43:05 +0800
From:   "Sunnanyong (Nanyong Sun, Intelligent Computing Solution Development
        Dep)" <sunnanyong@...wei.com>
To:     Bixuan Cui <cuibixuan@...wei.com>, <paul.walmsley@...ive.com>,
        <palmer@...belt.com>, <aou@...s.berkeley.edu>
CC:     <vincent.chen@...ive.com>, <linux-riscv@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] module: fix build error when CONFIG_SMP is disabled

On 2021/5/29 10:03, Bixuan Cui wrote:

> diff --git a/arch/riscv/include/asm/tlbflush.h b/arch/riscv/include/asm/tlbflush.h
> index c84218ad7afc..9d5801f6e2c3 100644
> --- a/arch/riscv/include/asm/tlbflush.h
> +++ b/arch/riscv/include/asm/tlbflush.h
> @@ -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 */

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

diff --git a/arch/riscv/include/asm/pgtable.h 
b/arch/riscv/include/asm/pgtable.h
index 29e2c836848d..eda31002c4b1 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -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 */

  /*
diff --git a/arch/riscv/include/asm/tlbflush.h 
b/arch/riscv/include/asm/tlbflush.h
index c84218ad7afc..b9b9c64ac974 100644
--- a/arch/riscv/include/asm/tlbflush.h
+++ b/arch/riscv/include/asm/tlbflush.h
@@ -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.

Powered by blists - more mailing lists