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] [day] [month] [year] [list]
Message-ID: <CA+G9fYuND9eW5qBEvcfjPuW=wobQq5bu5Bzr3QOX3YUT-Qsviw@mail.gmail.com>
Date:   Fri, 27 May 2022 14:39:01 +0530
From:   Naresh Kamboju <naresh.kamboju@...aro.org>
To:     Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc:     torvalds@...ux-foundation.org, catalin.marinas@....com,
        will@...nel.org, akpm@...ux-foundation.org,
        anshuman.khandual@....com, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64/hugetlb: Fix building errors in huge_ptep_clear_flush()

On Fri, 27 May 2022 at 10:21, Baolin Wang <baolin.wang@...ux.alibaba.com> wrote:
>
> Fix below building errors which was caused by commit ae07562909f3
> ("mm: change huge_ptep_clear_flush() to return the original pte")
> interacting with commit fb396bb459c1 ("arm64/hugetlb: Drop TLB flush
> from get_clear_flush()").
>
> Due to the new get_clear_contig() has dropped TLB flush, we should
> add an explicit TLB flush in huge_ptep_clear_flush() to keep original
> semantics when changing to use new get_clear_contig().
>
> "
> arch/arm64/mm/hugetlbpage.c: In function ‘huge_ptep_clear_flush’:
> arch/arm64/mm/hugetlbpage.c:515:9: error: implicit declaration of
> function ‘get_clear_flush’; did you mean ‘ptep_clear_flush’?
> [-Werror=implicit-function-declaration]
>   515 |  return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
>       |         ^~~~~~~~~~~~~~~
>       |         ptep_clear_flush
> "
>

This patch tested on arm, arm64, i386 and x86 with gcc-11 and clang-14.

> Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
> Suggested-by: Catalin Marinas <catalin.marinas@....com>
> Signed-off-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Anshuman Khandual <anshuman.khandual@....com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>

Tested-by: Linux Kernel Functional Testing <lkft@...aro.org>

> ---
>  arch/arm64/mm/hugetlbpage.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> index 0f0c17dfeb9c..e2a5ec9fdc0d 100644
> --- a/arch/arm64/mm/hugetlbpage.c
> +++ b/arch/arm64/mm/hugetlbpage.c
> @@ -507,12 +507,15 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>         size_t pgsize;
>         int ncontig;
> +       pte_t orig_pte;
>
>         if (!pte_cont(READ_ONCE(*ptep)))
>                 return ptep_clear_flush(vma, addr, ptep);
>
>         ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
> -       return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
> +       orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
> +       flush_tlb_range(vma, addr, addr + pgsize * ncontig);
> +       return orig_pte;
>  }
>
>  static int __init hugetlbpage_init(void)
> --
> 2.27.0
>


--
Linaro LKFT
https://lkft.linaro.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ