From: "Måns Rullgård" <mans@mansr.com>
To: linux-kernel@vger.kernel.org
Cc: linux-alpha@vger.kernel.org
Subject: Re: [PATCH] alpha: spinlock: don't perform memory access in locked critical section
Date: Mon, 06 May 2013 22:28:38 +0100 [thread overview]
Message-ID: <yw1xmws74x2x.fsf@unicorn.mansr.com> (raw)
In-Reply-To: 20130506211238.GA24282@mudshark.cambridge.arm.com
Will Deacon <will.deacon@arm.com> writes:
> Hi Al, Matt,
>
> On Mon, May 06, 2013 at 09:53:30PM +0100, Al Viro wrote:
>> On Mon, May 06, 2013 at 01:19:51PM -0700, Matt Turner wrote:
>>
>> > I'm not sure of the interpretation that LDA counts as a memory access.
>> >
>> > The manual says it's Ra <- Rbv + SEXT(disp).
>> >
>> > It's not touching memory that I can see.
>>
>> More to the point, the same manual gives explicit list of instructions
>> that shouldn't occur between LDx_L and STx_C, and LDA does not belong to any
>> of those. I suspect that Will has misparsed the notations in there - LDx is
>> present in the list, but it's _not_ "all instructions with mnemonics starting
>> with LD", just the 4 "load integer from memory" ones. FWIW, instructions
>> with that encoding (x01xxx<a:5><b:5><offs:16>) are grouped so:
>> LDAx - LDA, LDAH; load address
>> LDx - LDL, LDQ, LDBU, LDWU; load memory data into integer register
>> LDQ_U; load unaligned
>> LDx_L - LDL_L, LDQ_L; load locked
>> STx_C - STL_C, STQ_C; store conditional
>> STx - STL, STQ, STB, STW; store
>> STQ_U; store unaligned
>
> Your suspicions are right! I did assume that LDA fell under the LDx class,
> so apologies for the false alarm. I suspect I should try and get out more,
> rather than ponder over this reference manual.
LDA uses the address generation circuitry from the load/store unit, but
it does not actually access memory. It is merely a convenient way of
performing certain arithmetic operations, be it for scheduling reasons
or for the different range of immediate values available.
--
Måns Rullgård
mans@mansr.com
next prev parent reply other threads:[~2013-05-06 21:29 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 [this message]
2013-05-06 22:11 ` Will Deacon
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=yw1xmws74x2x.fsf@unicorn.mansr.com \
--to=mans@mansr.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox