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: <d8d27cb97e49f071e528759124818f9625184cbc.camel@surriel.com>
Date: Mon, 06 Jan 2025 10:47:09 -0500
From: Rik van Riel <riel@...riel.com>
To: Borislav Petkov <bp@...en8.de>, Peter Zijlstra <peterz@...radead.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, kernel-team@...a.com, 
	dave.hansen@...ux.intel.com, luto@...nel.org, tglx@...utronix.de,
 mingo@...hat.com, 	hpa@...or.com, akpm@...ux-foundation.org,
 nadav.amit@...il.com, 	zhengqi.arch@...edance.com, linux-mm@...ck.org
Subject: Re: [PATCH 01/12] x86/mm: make MMU_GATHER_RCU_TABLE_FREE
 unconditional

On Fri, 2025-01-03 at 13:18 +0100, Borislav Petkov wrote:
> On Thu, Jan 02, 2025 at 08:56:09PM +0100, Peter Zijlstra wrote:
> > Well, I've already answered why we need this in the previous thread
> > but
> > it wasn't preserved :-(
> 
> ... and this needs to be part of the commit message. And there's a
> similar
> comment over tlb_remove_table_smp_sync() in mm/mmu_gather.c which
> pretty much
> explains the same thing.
> 
> > Currently GUP-fast serializes against table-free by disabling
> > interrupts, which in turn holds of the TLBI-IPIs.
> > 
> > Since you're going to be doing broadcast TLBI -- without IPIs, this
> > no
> > longer works and we need other means of serializing GUP-fast vs
> > table-free.
> > 
> > MMU_GATHER_RCU_TABLE_FREE is that means.
> > 
> > So where previously paravirt implementations of tlb_flush_multi
> > might
> > require this (because of virt optimizations that avoided the TLBI-
> > IPI),
> > this broadcast invalidate now very much requires this for native.
> 
> Right, so this begs the question: we probably should do this
> dynamically only
> on TLBI systems - not on everything native - due to the overhead of
> this
> batching - I'm looking at tlb_remove_table().
> 
> Or should we make this unconditional on all native because we don't
> care about
> the overhead and would like to have simpler code. I mean, disabling
> IRQs vs
> batching and allocating memory...?

Given the cost of IPIs on systems where we don't
technically need MMU_GATHER_RCU_TABLE_FREE, the
batching might still be cheaper.

-- 
All Rights Reversed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ