
B2 The AArch64 Application Level Memory Model
B2.9 Synchronization and semaphores
B2-142 Copyright © 2013-2018 ARM Limited or its affiliates. All rights reserved. ARM DDI 0487D.a
Non-Confidential ID103018
The following notes describe the use of a
LoadExcl
/
StoreExcl
instruction pair, to indicate the use of any of the
Load-Exclusive/Store-Exclusive instruction pairs shown in Table B2-3 on page B2-135. In this context, a
LoadExcl
/
StoreExcl
pair comprises two instructions in the same thread of execution:
• The exclusives support a single outstanding exclusive access for each PE thread that is executed. The
architecture makes use of this by not requiring an address or size check as part of the
IsExclusiveLocal()
function. If the target VA of a
StoreExcl
is different from the VA of the preceding
LoadExcl
instruction in the
same thread of execution, behavior can be
CONSTRAINED UNPREDICTABLE with the following behavior:
— The
StoreExcl
either passes or fails, the status value returned by the
StoreExcl
is UNKNOWN, and the
states of the local and global monitors for that PE are UNKNOWN.
This means the
StoreExcl
might pass for some instances of a
LoadExcl
/
StoreExcl
pair with mismatched
addresses, and fail for other instances of a
LoadExcl
/
StoreExcl
pair with mismatched addresses.
— The data at the address accessed by the
LoadExcl
, and at the address accessed by the
StoreExcl
, is
UNKNOWN.
This means software can rely on a
LoadExcl
/
StoreExcl
pair to eventually succeed only if the
LoadExc
l and the
StoreExcl
are executed with the same VA.
• An implementation of the Load-Exclusive and Store-Exclusive instructions can require that, in any thread of
execution, the transaction size of a
StoreExcl
instruction is the same as the transaction size of the preceding
LoadExcl
instruction executed in that thread. If the transaction size of a
StoreExcl
instruction is different from
the preceding
LoadExcl
instruction in the same thread of execution, behavior can be CONSTRAINED
UNPREDICTABLE with the following behavior:
— The
StoreExcl
either passes or fails, and the status value returned by the
StoreExcl
is UNKNOWN.
This means the
StoreExcl
might pass for some instances of a
LoadExcl
/
StoreExcl
pair with mismatched
transaction sizes, and fail for other instances of a
LoadExcl
/
StoreExcl
pair with mismatched transaction
sizes.
— The block of data of the size of the larger of the transaction sizes used by the
LoadExcl
/
StoreExcl
pair
at the address accessed by the
LoadExcl
/
StoreExcl
pair, is UNKNOWN.
This means software can rely on a
LoadExcl
/
StoreExcl
pair to eventually succeed only if the
LoadExc
l and the
StoreExcl
have the same transaction size.
• An implementation of the
LoadExcl
and
StoreExcl
instructions can require that, in any thread of execution,
the
StoreExcl
instruction accesses the same number of registers as the preceding
LoadExcl
instruction
executed in that thread. If the
StoreExcl
instruction accesses a different number of registers than the preceding
LoadExcl
instruction in the same thread of execution, behavior is CONSTRAINED UNPREDICTABLE. As a result,
software can rely on an
LoadExcl/StoreExcl
pair to eventually succeed only if they access the same number
of registers. For more information, see CONSTRAINED UNPREDICTABLE behavior when
Load-Exclusive/Store-Exclusive access a different number of registers on page B2-144.
•
LoadExcl
/
StoreExcl
loops are guaranteed to make forward progress only if, for any
LoadExcl
/
StoreExcl
loop
within a single thread of execution, the software meets all of the following conditions:
1 Between the Load-Exclusive and the Store-Exclusive, there are no explicit memory accesses,
preloads, direct or indirect System register writes, address translation instructions, cache or TLB
maintenance instructions, exception generating instructions, exception returns, or indirect
branches.
2 Between the Store-Exclusive returning a failing result and the retry of the corresponding
Load-Exclusive:
• There are no stores or
PRFM
instructions to any address within the Exclusives reservation
granule accessed by the Store-Exclusive.
• There are no loads or preloads to any address within the Exclusives reservation granule
accessed by the Store-Exclusive that use a different VA alias to that address.