All of lore.kernel.org
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: Helge Deller <deller@gmx.de>, linux-parisc@vger.kernel.org
Subject: Re: [PATCH] parisc: Fix lightweight spinlock checks to not break futexes
Date: Thu, 10 Aug 2023 10:57:54 -0400	[thread overview]
Message-ID: <a28de2c8-edce-0f2b-0d2a-075fcbf05e3f@bell.net> (raw)
In-Reply-To: <ZNM8Rz5f5/d/ZAI8@p100>

On 2023-08-09 3:12 a.m., Helge Deller wrote:
> 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<dave.anglin@bell.net>
> Signed-off-by: Helge Deller<deller@gmx.de>
> Cc:stable@vger.kernel.org  # v6.4+
> Fixes: 15e64ef6520e ("parisc: Add lightweight spinlock checks")
Fixes system crash in glibc testsuite.

Tested-by: John David Anglin <dave.anglin@bell.net>

-- 
John David Anglin  dave.anglin@bell.net


      reply	other threads:[~2023-08-10 14:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  7:12 [PATCH] parisc: Fix lightweight spinlock checks to not break futexes Helge Deller
2023-08-10 14:57 ` John David Anglin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a28de2c8-edce-0f2b-0d2a-075fcbf05e3f@bell.net \
    --to=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.