From: Will Deacon <will.deacon@arm.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Matt Turner <mattst88@gmail.com>,
"linux-alpha@vger.kernel.org" <linux-alpha@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Richard Henderson <rth@twiddle.net>,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Subject: Re: [PATCH] alpha: spinlock: don't perform memory access in locked critical section
Date: Mon, 6 May 2013 23:11:52 +0100 [thread overview]
Message-ID: <20130506221152.GA24639@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20130506211238.GA24282@mudshark.cambridge.arm.com>
On Mon, May 06, 2013 at 10:12:38PM +0100, Will Deacon wrote:
> The other (hopefully also wrong) worry that I had was when the manual
> states that:
>
> `If the virtual and physical addresses for a LDx_L and STx_C sequence are
> not within the same naturally aligned 16-byte sections of virtual and
> physical memory, that sequence may always fail, or may succeed despite
> another processor’s store to the lock range; hence, no useful program
> should do this'
>
> This seems like it might have a curious interaction with CoW paging if
> userspace is trying to use these instructions for a lock, since the
> physical address for the conditional store might differ from the one which
> was passed to the load due to CoW triggered by a different thread. Anyway,
> I was still thinking about that one and haven't got as far as TLB
> invalidation yet :)
In case anybody is interested, the software broadcasting of TLB maintenance
solves this problem because the PAL_rti on the ret_to_user path will clear
the lock flag.
Will
next prev parent reply other threads:[~2013-05-06 22:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 20:01 [PATCH] alpha: spinlock: don't perform memory access in locked critical section Will Deacon
2013-05-06 20:19 ` Matt Turner
2013-05-06 20:53 ` Al Viro
2013-05-06 21:12 ` Will Deacon
2013-05-06 21:28 ` Måns Rullgård
2013-05-06 22:11 ` Will Deacon [this message]
2013-05-06 20:26 ` Al Viro
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=20130506221152.GA24639@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=ink@jurassic.park.msu.ru \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=rth@twiddle.net \
--cc=viro@ZenIV.linux.org.uk \
/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