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: <45b4a0db-dab6-4b9d-9ee8-f564eaa202bf@amd.com>
Date: Wed, 10 Sep 2025 10:52:50 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Thomas Gleixner <tglx@...utronix.de>, LKML <linux-kernel@...r.kernel.org>
CC: Peter Zijlstra <peterz@...radead.org>, Mathieu Desnoyers
	<mathieu.desnoyers@...icios.com>, "Paul E. McKenney" <paulmck@...nel.org>,
	Boqun Feng <boqun.feng@...il.com>, Jonathan Corbet <corbet@....net>, Prakash
 Sangappa <prakash.sangappa@...cle.com>, Madadi Vineeth Reddy
	<vineethr@...ux.ibm.com>, Steven Rostedt <rostedt@...dmis.org>, Sebastian
 Andrzej Siewior <bigeasy@...utronix.de>, Arnd Bergmann <arnd@...db.de>,
	<linux-arch@...r.kernel.org>
Subject: Re: [patch 07/12] rseq: Implement syscall entry work for time slice
 extensions

Hello Thomas,

On 9/9/2025 4:30 AM, Thomas Gleixner wrote:
> +static inline void rseq_slice_set_need_resched(struct task_struct *curr)
> +{
> +	/*
> +	 * The interrupt guard is required to prevent inconsistent state in
> +	 * this case:
> +	 *
> +	 * set_tsk_need_resched()
> +	 * --> Interrupt
> +	 *       wakeup()
> +	 *        set_tsk_need_resched()
> +	 *	  set_preempt_need_resched()
> +	 *     schedule_on_return()
> +	 *        clear_tsk_need_resched()
> +	 *	  clear_preempt_need_resched()
> +	 * set_preempt_need_resched()		<- Inconsistent state
> +	 *
> +	 * This is safe vs. a remote set of TIF_NEED_RESCHED because that
> +	 * only sets the already set bit and does not create inconsistent
> +	 * state.
> +	 */
> +	scoped_guard(irq)
> +		set_need_resched_current();

nit. any specific reason for using a scoped_guard() instead of just a
guard() here (and in rseq_cancel_slice_extension_timer()) other than to
prominently highlight what is being guarded?

> +}

-- 
Thanks and Regards,
Prateek


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ