<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/arch/parisc/include/asm/spinlock.h, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-08-16T16:32:18Z</updated>
<entry>
<title>parisc: Fix lightweight spinlock checks to not break futexes</title>
<updated>2023-08-16T16:32:18Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2023-08-09T07:21:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=24555c3794bcb8f3b93f88105972848a4f0888aa'/>
<id>urn:sha1:24555c3794bcb8f3b93f88105972848a4f0888aa</id>
<content type='text'>
commit a0f4b7879f2e14986200747d1b545e5daac8c624 upstream.

The lightweight spinlock checks verify that a spinlock has either value
0 (spinlock locked) and that not any other bits than in
__ARCH_SPIN_LOCK_UNLOCKED_VAL is set.

This breaks the current LWS code, which writes the address of the lock
into the lock word to unlock it, which was an optimization to save one
assembler instruction.

Fix it by making spinlock_types.h accessible for asm code, change the
LWS spinlock-unlocking code to write __ARCH_SPIN_LOCK_UNLOCKED_VAL into
the lock word, and add some missing lightweight spinlock checks to the
LWS path. Finally, make the spinlock checks dependend on DEBUG_KERNEL.

Noticed-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Tested-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Cc: stable@vger.kernel.org # v6.4+
Fixes: 15e64ef6520e ("parisc: Add lightweight spinlock checks")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>parisc: Add lightweight spinlock checks</title>
<updated>2023-05-24T12:23:07Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2023-05-22T13:11:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=15e64ef6520ea8702998db05b87fa5c3d3d40710'/>
<id>urn:sha1:15e64ef6520ea8702998db05b87fa5c3d3d40710</id>
<content type='text'>
Add a lightweight spinlock check which uses only two instructions
per spinlock call. It detects if a spinlock has been trashed by
some memory corruption and then halts the kernel. It will not detect
uninitialized spinlocks, for which CONFIG_DEBUG_SPINLOCK needs to
be enabled.

This lightweight spinlock check shouldn't influence runtime, so it's
safe to enable it by default.

The __ARCH_SPIN_LOCK_UNLOCKED_VAL constant has been choosen small enough
to be able to be loaded by one LDI assembler statement.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>locking: Remove spin_lock_flags() etc</title>
<updated>2021-10-30T14:37:28Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-10-22T11:59:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f98a3dccfcb0b9b9c3bef8df9edd61cda80ad937'/>
<id>urn:sha1:f98a3dccfcb0b9b9c3bef8df9edd61cda80ad937</id>
<content type='text'>
parisc, ia64 and powerpc32 are the only remaining architectures that
provide custom arch_{spin,read,write}_lock_flags() functions, which are
meant to re-enable interrupts while waiting for a spinlock.

However, none of these can actually run into this codepath, because
it is only called on architectures without CONFIG_GENERIC_LOCKBREAK,
or when CONFIG_DEBUG_LOCK_ALLOC is set without CONFIG_LOCKDEP, and none
of those combinations are possible on the three architectures.

Going back in the git history, it appears that arch/mn10300 may have
been able to run into this code path, but there is a good chance that
it never worked. On the architectures that still exist, it was
already impossible to hit back in 2008 after the introduction of
CONFIG_GENERIC_LOCKBREAK, and possibly earlier.

As this is all dead code, just remove it and the helper functions built
around it. For arch/ia64, the inline asm could be cleaned up, but
it seems safer to leave it untouched.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Helge Deller &lt;deller@gmx.de&gt;  # parisc
Link: https://lore.kernel.org/r/20211022120058.1031690-1-arnd@kernel.org
</content>
</entry>
<entry>
<title>parisc: Improve spinlock handling</title>
<updated>2020-10-15T06:10:39Z</updated>
<author>
<name>John David Anglin</name>
<email>dave.anglin@bell.net</email>
</author>
<published>2020-10-02T19:41:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f173e3a751708b7f5e0b77dcdd4ac3c2287b735e'/>
<id>urn:sha1:f173e3a751708b7f5e0b77dcdd4ac3c2287b735e</id>
<content type='text'>
Use READ_ONCE() to check if spinlock is locked.
The other changes are cleanups.

Signed-off-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>Revert "parisc: Revert "Release spinlocks using ordered store""</title>
<updated>2020-07-28T16:56:14Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2020-07-28T16:56:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=157e9afcc4fa25068b0e8743bc254a9b56010e13'/>
<id>urn:sha1:157e9afcc4fa25068b0e8743bc254a9b56010e13</id>
<content type='text'>
This reverts commit 86d4d068df573a8c2105554624796c086d6bec3d.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v5.0+
</content>
</entry>
<entry>
<title>Revert "parisc: Use ldcw instruction for SMP spinlock release barrier"</title>
<updated>2020-07-28T16:54:40Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2020-07-28T16:54:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6e9f06ee6c9566f3606d93182ac8f803a148504b'/>
<id>urn:sha1:6e9f06ee6c9566f3606d93182ac8f803a148504b</id>
<content type='text'>
This reverts commit 9e5c602186a692a7e848c0da17aed40f49d30519.
No need to use the ldcw instruction as SMP spinlock release barrier.
Revert it to gain back speed again.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v5.2+
</content>
</entry>
<entry>
<title>Revert "parisc: Improve interrupt handling in arch_spin_lock_flags()"</title>
<updated>2020-07-28T16:49:45Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2020-07-28T16:49:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3d05b8aebc5f10ee3ab129b61100196855dd7249'/>
<id>urn:sha1:3d05b8aebc5f10ee3ab129b61100196855dd7249</id>
<content type='text'>
This reverts commit 2772f0efd5bbd5413db3d22e363b779ca0fa5310.
It turns out that we want to implement the spinlock code differently.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v5.7+
</content>
</entry>
<entry>
<title>parisc: Rework arch_rw locking functions</title>
<updated>2020-04-05T20:29:55Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2020-04-05T20:29:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fbdc8f0f4891df7b5eb643ec0a509a4ac7dcfc2e'/>
<id>urn:sha1:fbdc8f0f4891df7b5eb643ec0a509a4ac7dcfc2e</id>
<content type='text'>
Clean up the arch read/write locking functions based on the arc
implemenation. This improves readability of those functions.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: Improve interrupt handling in arch_spin_lock_flags()</title>
<updated>2020-04-05T20:16:38Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2020-04-05T20:08:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2772f0efd5bbd5413db3d22e363b779ca0fa5310'/>
<id>urn:sha1:2772f0efd5bbd5413db3d22e363b779ca0fa5310</id>
<content type='text'>
Rewrite arch_spin_lock() and arch_spin_lock_flags() to not re-enable and
disable the PSW_SM_I interrupt flag too often.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: Use ldcw instruction for SMP spinlock release barrier</title>
<updated>2019-05-03T21:47:40Z</updated>
<author>
<name>John David Anglin</name>
<email>dave.anglin@bell.net</email>
</author>
<published>2019-04-14T23:20:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9e5c602186a692a7e848c0da17aed40f49d30519'/>
<id>urn:sha1:9e5c602186a692a7e848c0da17aed40f49d30519</id>
<content type='text'>
There are only a couple of instructions that can function as a memory
barrier on parisc.  Currently, we use the sync instruction as a memory
barrier when releasing a spinlock.  However, the ldcw instruction is a
better barrier when we have a handy memory location since it operates in
the cache on coherent machines.

This patch updates the spinlock release code to use ldcw.  I also
changed the "stw,ma" instructions to "stw" instructions as it is not an
adequate barrier.

Signed-off-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
</feed>
