linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: futex: preserve oldval in SMP __futex_atomic_op
Date: Thu, 22 Sep 2011 21:14:56 +0100	[thread overview]
Message-ID: <20110922201456.GA10140@e102144-lin.cambridge.arm.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1109221449470.12663@xanadu.home>

On Thu, Sep 22, 2011 at 08:09:41PM +0100, Nicolas Pitre wrote:
> On Thu, 22 Sep 2011, Will Deacon wrote:
> 
> > The SMP implementation of __futex_atomic_op clobbers oldval with the
> > status flag from the exclusive store. This causes it to always read as
> > zero when performing the FUTEX_OP_CMP_* operation.
> > 
> > This patch updates the ARM __futex_atomic_op implementations to take a
> > tmp argument, allowing us to store the strex status flag without
> > overwriting the register containing oldval.
> > 
> > Cc: stable at kernel.org
> > Reported-by: Minho Ben <mhban@samsung.com>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
> 
> Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>

Thanks Nicolas, I'll put this into the patch system tomorrow.

> > ---
> > 
> > Following up on:
> > 
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/066348.html
> > 
> > it turns out that we don't need to use named arguments after all,
> > although it might be nice to add that as a later patch. For now, I'm
> > trying to keep this as small as possible for -stable.
> 
> Agreed that named arguments would make this code more obvious, 
> especially with the insn argument of __futex_atomic_op() which uses 
> numbered registers away from the actual inline asm statement where it is 
> used.

Yup, I'll post this as a separate patch in the future.

> I'm a bit worried that the LTP tests still passed though.  In theory it 
> shouldn't have worked at all except if you were lucky with test values.

Urgh, I just looked at the implementation of the tests I ran; all they do is
check that the {set,get}_robust_list system calls return -1 when passed
invalid argument combinations. No wonder they passed...

Will

      reply	other threads:[~2011-09-22 20:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 18:35 [PATCH] ARM: futex: preserve oldval in SMP __futex_atomic_op Will Deacon
2011-09-22 19:09 ` Nicolas Pitre
2011-09-22 20:14   ` Will Deacon [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=20110922201456.GA10140@e102144-lin.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).