* AArch64 arch_spin_unlock not signaling global event?
@ 2013-07-31 20:19 Andrei E. Warkentin
2013-07-31 21:25 ` Christopher Covington
2013-08-01 8:48 ` Will Deacon
0 siblings, 2 replies; 5+ messages in thread
From: Andrei E. Warkentin @ 2013-07-31 20:19 UTC (permalink / raw)
To: linux-arm-kernel
Hiya,
I've noticed the AArch64 arch_spin_unlock is implemented with the
'stlr' instruction.
Shouldn't that be followed by a 'sev'?
The AArch64 ISA doc says this about 'sev' - "A memory transaction
which clears a processor?s global exclusive monitor also implicitly
generates an event for that processor, as held in the Event register
and used by the WFE instruction."
...but 'stlr' is not an exclusive function. So an 'stlr' would not
generate the event. This means that a arch_spin_lock sitting inside
the 'wfe' would not unblock.
I ran into this doing some kernel-less SMP experiments with the
Foundation Model, where two cpus would play 'ping-pong' acquiring the
same lock and releasing it after a delay, letting the other CPU
acquire it. In the case of the Linux kernel, the core running
arch_spin_unlock likely manipulates a dozen other locks afterwards or
performs other activities which result in a global event (clrex, wfe),
or the other core gets an event because of an interrupt (or timer used
as wfe source). This is why I'm guessing no one has run into this yet.
Cheers,
--
A
^ permalink raw reply [flat|nested] 5+ messages in thread
* AArch64 arch_spin_unlock not signaling global event?
2013-07-31 20:19 AArch64 arch_spin_unlock not signaling global event? Andrei E. Warkentin
@ 2013-07-31 21:25 ` Christopher Covington
2013-08-01 8:48 ` Will Deacon
1 sibling, 0 replies; 5+ messages in thread
From: Christopher Covington @ 2013-07-31 21:25 UTC (permalink / raw)
To: linux-arm-kernel
Hi Andrei,
On 07/31/2013 04:19 PM, Andrei E. Warkentin wrote:
> Hiya,
>
> I've noticed the AArch64 arch_spin_unlock is implemented with the
> 'stlr' instruction.
>
> Shouldn't that be followed by a 'sev'?
Check the git log and go through silver to make sure you're looking at the
latest documentation. I believe the link from infocenter is stale.
Regards,
Christopher
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.
^ permalink raw reply [flat|nested] 5+ messages in thread
* AArch64 arch_spin_unlock not signaling global event?
2013-07-31 20:19 AArch64 arch_spin_unlock not signaling global event? Andrei E. Warkentin
2013-07-31 21:25 ` Christopher Covington
@ 2013-08-01 8:48 ` Will Deacon
2013-08-01 10:23 ` Andrei E. Warkentin
1 sibling, 1 reply; 5+ messages in thread
From: Will Deacon @ 2013-08-01 8:48 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 31, 2013 at 09:19:13PM +0100, Andrei E. Warkentin wrote:
> Hiya,
>
> I've noticed the AArch64 arch_spin_unlock is implemented with the
> 'stlr' instruction.
>
> Shouldn't that be followed by a 'sev'?
No. In ARMv8, When the exclusive is cleared for a processor, an event is
generated.
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
* AArch64 arch_spin_unlock not signaling global event?
2013-08-01 8:48 ` Will Deacon
@ 2013-08-01 10:23 ` Andrei E. Warkentin
2013-08-02 10:11 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Andrei E. Warkentin @ 2013-08-01 10:23 UTC (permalink / raw)
To: linux-arm-kernel
2013/8/1 Will Deacon <will.deacon@arm.com>:
> On Wed, Jul 31, 2013 at 09:19:13PM +0100, Andrei E. Warkentin wrote:
>> Hiya,
>>
>> I've noticed the AArch64 arch_spin_unlock is implemented with the
>> 'stlr' instruction.
>>
>> Shouldn't that be followed by a 'sev'?
>
> No. In ARMv8, When the exclusive is cleared for a processor, an event is
> generated.
>
> Will
But 'stlr' doesn't appear to be an exclusive instruction. It's filed
under 5.2.8.1 - Non-exclusive load-acquire/store-release in the ISA
doc.
The Foundation_v8 sim behavior seems to confirm that as well.
--
A
^ permalink raw reply [flat|nested] 5+ messages in thread
* AArch64 arch_spin_unlock not signaling global event?
2013-08-01 10:23 ` Andrei E. Warkentin
@ 2013-08-02 10:11 ` Will Deacon
0 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2013-08-02 10:11 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 01, 2013 at 11:23:55AM +0100, Andrei E. Warkentin wrote:
> 2013/8/1 Will Deacon <will.deacon@arm.com>:
> > On Wed, Jul 31, 2013 at 09:19:13PM +0100, Andrei E. Warkentin wrote:
> >> Shouldn't that be followed by a 'sev'?
> >
> > No. In ARMv8, When the exclusive is cleared for a processor, an event is
> > generated.
> >
>
> But 'stlr' doesn't appear to be an exclusive instruction. It's filed
> under 5.2.8.1 - Non-exclusive load-acquire/store-release in the ISA
> doc.
That doesn't matter -- any write will clear the monitor state for that
location.
`Any successful write to the tagged address by any other observer in the
shareability domain of the memory location is guaranteed to clear the tag.'
Please read section 3.4. "Synchronization and semaphores" of the ARM ARM.
> The Foundation_v8 sim behavior seems to confirm that as well.
If that's true, please can you report a bug against the model?
Cheers,
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-02 10:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-31 20:19 AArch64 arch_spin_unlock not signaling global event? Andrei E. Warkentin
2013-07-31 21:25 ` Christopher Covington
2013-08-01 8:48 ` Will Deacon
2013-08-01 10:23 ` Andrei E. Warkentin
2013-08-02 10:11 ` Will Deacon
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).