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: <20241025095425.GI14555@noisy.programming.kicks-ass.net>
Date: Fri, 25 Oct 2024 11:54:25 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Antoine Tenart <atenart@...nel.org>, Ingo Molnar <mingo@...hat.com>,
	Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>,
	Boqun Feng <boqun.feng@...il.com>,
	Nathan Chancellor <nathan@...nel.org>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>, linux-crypto@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	llvm@...ts.linux.dev, upstream@...oha.com
Subject: Re: [PATCH v4 1/3] spinlock: extend guard with spinlock_bh variants

On Fri, Oct 25, 2024 at 11:47:22AM +0200, Christian Marangi wrote:
> Extend guard APIs with missing raw/spinlock_bh variants.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>

Feel free to take this through whatever tree the rest of the patches are
targeted at. I don't think I've seen conflicting 'demand' so far.

Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>

> ---
> Changes v4:
> - Out of RFC
> Changes v2:
> - Add this patch
> 
>  include/linux/spinlock.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
> index 63dd8cf3c3c2..d3561c4a080e 100644
> --- a/include/linux/spinlock.h
> +++ b/include/linux/spinlock.h
> @@ -548,6 +548,12 @@ DEFINE_LOCK_GUARD_1(raw_spinlock_irq, raw_spinlock_t,
>  
>  DEFINE_LOCK_GUARD_1_COND(raw_spinlock_irq, _try, raw_spin_trylock_irq(_T->lock))
>  
> +DEFINE_LOCK_GUARD_1(raw_spinlock_bh, raw_spinlock_t,
> +		    raw_spin_lock_bh(_T->lock),
> +		    raw_spin_unlock_bh(_T->lock))
> +
> +DEFINE_LOCK_GUARD_1_COND(raw_spinlock_bh, _try, raw_spin_trylock_bh(_T->lock))
> +
>  DEFINE_LOCK_GUARD_1(raw_spinlock_irqsave, raw_spinlock_t,
>  		    raw_spin_lock_irqsave(_T->lock, _T->flags),
>  		    raw_spin_unlock_irqrestore(_T->lock, _T->flags),
> @@ -569,6 +575,13 @@ DEFINE_LOCK_GUARD_1(spinlock_irq, spinlock_t,
>  DEFINE_LOCK_GUARD_1_COND(spinlock_irq, _try,
>  			 spin_trylock_irq(_T->lock))
>  
> +DEFINE_LOCK_GUARD_1(spinlock_bh, spinlock_t,
> +		    spin_lock_bh(_T->lock),
> +		    spin_unlock_bh(_T->lock))
> +
> +DEFINE_LOCK_GUARD_1_COND(spinlock_bh, _try,
> +			 spin_trylock_bh(_T->lock))
> +
>  DEFINE_LOCK_GUARD_1(spinlock_irqsave, spinlock_t,
>  		    spin_lock_irqsave(_T->lock, _T->flags),
>  		    spin_unlock_irqrestore(_T->lock, _T->flags),
> -- 
> 2.45.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ