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-next>] [day] [month] [year] [list]
Message-Id: <1675768181-41518-1-git-send-email-carlo.bai@linux.alibaba.com>
Date:   Tue,  7 Feb 2023 19:09:41 +0800
From:   Kaihao Bai <carlo.bai@...ux.alibaba.com>
To:     catalin.marinas@....com, will@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:     anshuman.khandual@....com, baolin.wang@...ux.alibaba.com,
        carlo.bai@...ux.alibaba.com
Subject: [RFC PATCH 1/1] arm64: mm: remove unnecessary multiple tlb flush of contiguous hugetlb

In arm64, contiguous flag refers to the same TLB entry that shared by a
contiguous address range. If flush one entry of the address range, it
would cover the whole contiguous address range. Thus there's no need to
flush all contiguous range that CONT_PMD/PTE points to.

Signed-off-by: Kaihao Bai <carlo.bai@...ux.alibaba.com>
---
 arch/arm64/mm/hugetlbpage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index 95364e8bdc19..9213072ce9c7 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -213,7 +213,7 @@ static pte_t get_clear_contig_flush(struct mm_struct *mm,
 	pte_t orig_pte = get_clear_contig(mm, addr, ptep, pgsize, ncontig);
 	struct vm_area_struct vma = TLB_FLUSH_VMA(mm, 0);
 
-	flush_tlb_range(&vma, addr, addr + (pgsize * ncontig));
+	flush_tlb_page(&vma, addr);
 	return orig_pte;
 }
 
@@ -238,7 +238,7 @@ static void clear_flush(struct mm_struct *mm,
 	for (i = 0; i < ncontig; i++, addr += pgsize, ptep++)
 		pte_clear(mm, addr, ptep);
 
-	flush_tlb_range(&vma, saddr, addr);
+	flush_tlb_page(&vma, saddr);
 }
 
 static inline struct folio *hugetlb_swap_entry_to_folio(swp_entry_t entry)
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ