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]
Message-ID: <20250124114759.GB15996@noisy.programming.kicks-ass.net>
Date: Fri, 24 Jan 2025 12:47:59 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Qi Zheng <zhengqi.arch@...edance.com>
Cc: kevin.brodsky@....com, riel@...riel.com, vishal.moola@...il.com,
	david@...hat.com, jannh@...gle.com, hughd@...gle.com,
	willy@...radead.org, yuzhao@...gle.com, muchun.song@...ux.dev,
	akpm@...ux-foundation.org, will@...nel.org, aneesh.kumar@...nel.org,
	npiggin@...il.com, arnd@...db.de, dave.hansen@...ux.intel.com,
	rppt@...nel.org, alexghiti@...osinc.com, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, linux-csky@...r.kernel.org,
	linux-hexagon@...r.kernel.org, loongarch@...ts.linux.dev,
	linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org,
	linux-openrisc@...r.kernel.org, linux-sh@...r.kernel.org,
	linux-um@...ts.infradead.org, x86@...nel.org,
	linux-riscv@...ts.infradead.org
Subject: Re: [PATCH 0/5] remove tlb_remove_page_ptdesc()

On Thu, Jan 23, 2025 at 09:26:13PM +0800, Qi Zheng wrote:
> Hi all,
> 
> As suggested by Peter Zijlstra below [1], this series aims to remove
> tlb_remove_page_ptdesc().
> 
> : Fundamentally tlb_remove_page() is about removing *pages* as from a PTE,
> : there should not be a page-table anywhere near here *ever*.
> :
> : Yes, some architectures use tlb_remove_page() for page-tables too, but
> : that is more or less an implementation detail that can be fixed.
> 
> After this series, all architectures use tlb_remove_table() or tlb_remove_ptdesc()
> to remove the page table pages. In the future, once all architectures using
> tlb_remove_table() have also converted to using struct ptdesc (eg. powerpc), it
> may be possible to use only tlb_remove_ptdesc().

Right, so I don't think Sparc and Power care to use ptdesc, they're
using non page page-tables.

At the very least we should do something like this, the only point of
having tlb_remove_ptdesc() is type safety, there really is no benefit
from it in any other way.

---
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index dec030cb1210..a6731328db6f 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -504,7 +504,7 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
 	return tlb_remove_page_size(tlb, page, PAGE_SIZE);
 }
 
-static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt)
+static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt)
 {
 	tlb_remove_table(tlb, pt);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ