
8-6
PowerPC Microprocessor Family: The Bus Interface for 32-Bit microprocessors
8.8 lwarx/stwcx. Considerations
The
lwarx
and
stwcx.
instructions are used to synchronize multiple processors. Operation
of these instructions is described in the following sections.
8.8.1 Coherency Participation
This section describes the 604 MESI coherency mechanism. There are three legal
WIM
encodings that define coherency-required regions:
x11—Noncacheable
001—Write-back
101—Write-through
This discussion assumes that any semaphore (the address used for an
lwarx/stwcx.
operation) addressed by different processors, has the same WIM encodings regardless of
which processor accesses it. Additionally, some of the discussion of write-back cacheable
and write-through cacheable are combined as they have similar requirements.
8.8.1.1 Noncacheable Reservations
Regardless of whether they are associated with reservations, load and store operations to
noncacheable semaphores must access main memory. Loads for noncacheable semaphores
occur as read atomic bus operations. Typically, noncacheable writes (write-with-flush
operations) can be buffered at various stages. However, these writes must be broadcast to
all processors holding reservations so they can be compared against reservation addresses.
Note that this is not strictly true. If a memory system implemented a directory of
reservations (entry per processor), it would need only direct noncacheable writes to the
appropriate processor when a match is detected. It could directly reset the reservation if
another input signal existed, although there is not one present on the 604.
Because it appears to be required for memory coherence for these writes to be broadcast
(rather than for reservation reasons), it can be assumed that
lwarx
/
stwcx.
will follow this
requirement. Noncacheable writes would not be required to be broadcast, if no processor
could have a cached copy of the data. This is not specified by the PowerPC architecture.
Snooping by the processor for write-with-flush (normal and atomic) operations to the
reservation address must begin as soon as the
lwarx
address is acknowledged. This is
because a write to that address can occur between the address and data phase of an
lwarx
instruction. If a snooped write operation matches, the reservation is cleared. Snooping for
writes by an L2 cache must begin as soon as the
lwarx
address is acknowledged on its
system bus. L2 snoop filtering for reservations may be simple or complex (see
Section 8.8.2, “Filtering Options for Reservations,” for alternatives). In either case,
snooping must be able to start as soon as the L2 system bus side sees an acknowledgment,
which may constrain when the processor can assert RSRV.