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: <20250306132343.6b902a3d@mordecai.tesarici.cz>
Date: Thu, 6 Mar 2025 13:23:43 +0100
From: Petr Tesarik <ptesarik@...e.com>
To: Mark Rutland <mark.rutland@....com>
Cc: Valentin Schneider <vschneid@...hat.com>, Catalin Marinas
 <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-rt-users@...r.kernel.org, Mike Galbraith <efault@....de>, Peter
 Collingbourne <pcc@...gle.com>, Thomas Gleixner <tglx@...utronix.de>,
 Neeraj Upadhyay <neeraj.upadhyay@...nel.org>, Thiago Jung Bauermann
 <thiago.bauermann@...aro.org>, Mark Brown <broonie@...nel.org>, Kristina
 Martsenko <kristina.martsenko@....com>, Sebastian Andrzej Siewior
 <bigeasy@...utronix.de>, Jinjie Ruan <ruanjinjie@...wei.com>, Juri Lelli
 <juri.lelli@...hat.com>, Phil Auld <pauld@...hat.com>
Subject: Re: [PATCH 1/1] arm64: enable PREEMPT_LAZY

On Wed, 5 Mar 2025 12:15:35 +0000
Mark Rutland <mark.rutland@....com> wrote:

> On Wed, Mar 05, 2025 at 11:49:25AM +0100, Valentin Schneider wrote:
> > From: Mark Rutland <mark.rutland@....com>
> > 
> > For an architecture to enable CONFIG_ARCH_HAS_RESCHED_LAZY, two things are
> > required:
> > 1) Adding a TIF_NEED_RESCHED_LAZY flag definition
> > 2) Checking for TIF_NEED_RESCHED_LAZY in the appropriate locations
> > 
> > 2) is handled in a generic manner by CONFIG_GENERIC_ENTRY, which isn't
> > (yet) implemented for arm64. However, outside of core scheduler code,
> > TIF_NEED_RESCHED_LAZY only needs to be checked on a kernel exit, meaning:
> > o return/entry to userspace.
> > o return/entry to guest.
> > 
> > The return/entry to a guest is all handled by xfer_to_guest_mode_handle_work()
> > which already does the right thing, so it can be left as-is.
> > 
> > arm64 doesn't use common entry's exit_to_user_mode_prepare(), so update its
> > return to user path to check for TIF_NEED_RESCHED_LAZY and call into
> > schedule() accordingly.
> > 
> > Link: https://lore.kernel.org/linux-rt-users/20241216190451.1c61977c@mordecai.tesarici.cz/
> > Link: https://lore.kernel.org/all/xhsmh4j0fl0p3.mognet@vschneid-thinkpadt14sgen2i.remote.csb/
> > Signed-off-by: Mark Rutland <mark.rutland@....com>
> > [testdrive, _TIF_WORK_MASK fixlet and changelog.]
> > Signed-off-by: Mike Galbraith <efault@....de>
> > [Another round of testing; changelog faff]
> > Signed-off-by: Valentin Schneider <vschneid@...hat.com>
> > ---
> >  arch/arm64/Kconfig                   |  1 +
> >  arch/arm64/include/asm/thread_info.h | 16 +++++++++-------
> >  arch/arm64/kernel/entry-common.c     |  2 +-
> >  3 files changed, 11 insertions(+), 8 deletions(-)  
> 
> Catalin, Will, given this is small and self-contained, I reckon it makes
> sense to pick this up ahead of Jinjie's series to move arm64 over to the
> generic entry library (which is on my queue of things to review). Even
> if we pick up both, it'll be easier to bisect and debug issues caused by
> this patch alone.
> 
> The fixes/cleanups from Mike and Valentin look right to me, so FWIW:
> 
> Acked-by: Mark Rutland <mark.rutland@....com>

Thank you, all. Much appreciated.

Petr T

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ