
Chapter 8. System Considerations
8-7
The
stwcx.
instruction cannot be allowed to complete until the operation (write with flush
atomic) gains access to main memory. This requires any L2 cache to delay acknowledgment
of completion of the operation until it is globally performed. Buffering cannot be provided
unless it is after the completion point with respect to main memory.
8.8.1.2 Cacheable Reservations
If a read to a cacheable semaphore misses, it is fetched with a read atomic bus operation.
This places the data in the cache as S or E, depending upon the state of the SHD signal. The
read may hit in the cache with states M, E, or S for write-back cacheable space, or E or S
for write-through cacheable space. It is recommended that the processor notify the external
world of the address of the reservation when setting a reservation on an address in the
cache. See Section 8.8.2, “Filtering Options for Reservations.”
8.8.1.3 Read Snooping Requirements
A processor with a reservation on a cacheable semaphore must ensure that any subsequent
reads (both read and read atomic) by any other processor do not take the address into their
cache in the exclusive state (E). This prevents semaphores that are write-back, cacheable
from being modified by a write that is invisible to the processor holding the reservation (that
is, going from the E state to M state within the other cache). For the MESI protocol used
by the 604, this involves asserting SHD whenever another processor executes a read to the
reservation address. This assertion of SHD for reservation purposes is independent of
whether the data associated with the address is in the cache.
This requirement also extends to an L2 cache. If a reservation is held, it must selectively or
freely assert SYS_SHD for read operations that may occur to the semaphore address. See
Section 8.8.2, “Filtering Options for Reservations.”
8.8.1.4 Write-Back Reservation-Canceling Snoops
In addition to snooping to ensure that reads do not take exclusive ownership of a reservation
address, the processor must also snoop for operations that would cancel the reservation.
This snooping is in addition to that required to maintain cache coherency. The following
operations cancel a reservation held on a semaphore that is write-back cacheable as they
involve transfer of ownership of the address to another processor:
RWITM—another processor gains ownership before completing a store
RWITM atomic—another processor gains ownership before completing an
stwcx.
Kill block—another processor stores into a shared block or a
dcbz
instruction is
executed
A write-with-kill operation cannot occur since it would imply that another processor has
gained ownership, in which case a reservation would have been lost.