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]
Date:   Fri, 13 May 2022 17:18:38 +1000
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Catalin Marinas <catalin.marinas@....com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Will Deacon <will@...nel.org>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: Re: linux-next: build failure after merge of the mm tree

Hi Catalin,

On Thu, 12 May 2022 12:07:41 +0100 Catalin Marinas <catalin.marinas@....com> wrote:
>
> Note that after the arm64 commit, get_clear_contig() no longer flushes
> the TLB. So maybe something like:
> 
> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> index 30f5b76aabe9..9a999550df8e 100644
> --- a/arch/arm64/mm/hugetlbpage.c
> +++ b/arch/arm64/mm/hugetlbpage.c
> @@ -485,12 +485,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_contig(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)

I have modified my merge resolution patch to as in the above so it
looks like this now:

From: Stephen Rothwell <sfr@...b.auug.org.au>
Date: Fri, 13 May 2022 17:08:07 +1000
Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte"

It interacts with commit

  fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

from the arm64 tree

Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
---
 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 5bdf913dedc7..10b4a19ed6a2 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -485,12 +485,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.35.1

-- 
Cheers,
Stephen Rothwell

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ