All of lore.kernel.org
 help / color / mirror / Atom feed
* [stable] x86/atomic functions missing memory clobber
@ 2020-01-07 17:48 Ben Hutchings
  2020-01-07 18:14 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2020-01-07 17:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sasha Levin, Jari Ruusu
  Cc: stable, Peter Zijlstra (Intel), Thomas Gleixner, Ingo Molnar

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

I noticed that backports of commit 69d927bba395 "x86/atomic: Fix
smp_mb__{before,after}_atomic()" didn't touch atomic_or_long() (present
in 3.16) or atomic_inc_short() (present in 4.9 and earlier).

These functions were only implemented on x86 and not actually used in-
tree.  But it's possible they are used by some out-of-tree module, and
that commit removed compiler barriers for them.

Would it might make sense to either
1. Add the memory clobber to these functions, or
2. Delete them
on the affected stable branches?

Ben.

-- 
Ben Hutchings
Larkinson's Law: All laws are basically false.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [stable] x86/atomic functions missing memory clobber
  2020-01-07 17:48 [stable] x86/atomic functions missing memory clobber Ben Hutchings
@ 2020-01-07 18:14 ` Greg Kroah-Hartman
  2020-01-07 18:59   ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-07 18:14 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Sasha Levin, Jari Ruusu, stable, Peter Zijlstra (Intel),
	Thomas Gleixner, Ingo Molnar

On Tue, Jan 07, 2020 at 05:48:55PM +0000, Ben Hutchings wrote:
> I noticed that backports of commit 69d927bba395 "x86/atomic: Fix
> smp_mb__{before,after}_atomic()" didn't touch atomic_or_long() (present
> in 3.16) or atomic_inc_short() (present in 4.9 and earlier).
> 
> These functions were only implemented on x86 and not actually used in-
> tree.  But it's possible they are used by some out-of-tree module, and
> that commit removed compiler barriers for them.
> 
> Would it might make sense to either
> 1. Add the memory clobber to these functions, or
> 2. Delete them
> on the affected stable branches?

Looks like we can drop atomic_inc_short for 4.9 as there are no users,
same for 4.4.  I'll go do that now.  It's not like the "fix" is really
needed here because of that :)

Good catch!

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [stable] x86/atomic functions missing memory clobber
  2020-01-07 18:14 ` Greg Kroah-Hartman
@ 2020-01-07 18:59   ` Ben Hutchings
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2020-01-07 18:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Sasha Levin, Jari Ruusu, stable, Peter Zijlstra (Intel),
	Thomas Gleixner, Ingo Molnar

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

On Tue, 2020-01-07 at 19:14 +0100, Greg Kroah-Hartman wrote:
> On Tue, Jan 07, 2020 at 05:48:55PM +0000, Ben Hutchings wrote:
> > I noticed that backports of commit 69d927bba395 "x86/atomic: Fix
> > smp_mb__{before,after}_atomic()" didn't touch atomic_or_long() (present
> > in 3.16) or atomic_inc_short() (present in 4.9 and earlier).
> > 
> > These functions were only implemented on x86 and not actually used in-
> > tree.  But it's possible they are used by some out-of-tree module, and
> > that commit removed compiler barriers for them.
> > 
> > Would it might make sense to either
> > 1. Add the memory clobber to these functions, or
> > 2. Delete them
> > on the affected stable branches?
> 
> Looks like we can drop atomic_inc_short for 4.9 as there are no users,
> same for 4.4.  I'll go do that now.  It's not like the "fix" is really
> needed here because of that :)

Upstream commit for this is:

commit 31b35f6b4d5285a311e10753f4eb17304326b211
Author: Dmitry Vyukov <dvyukov@google.com>
Date:   Fri May 26 19:29:00 2017 +0200

    locking/x86: Remove the unused atomic_inc_short() methd

Ben.

-- 
Ben Hutchings
Larkinson's Law: All laws are basically false.



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-07 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-07 17:48 [stable] x86/atomic functions missing memory clobber Ben Hutchings
2020-01-07 18:14 ` Greg Kroah-Hartman
2020-01-07 18:59   ` Ben Hutchings

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.