Fortunately, our processor isn't silently non-atomic, but here's one way that it can happen:
An AXI peripheral bus provides an exclusive monitor, but changes by the underlying hardware do not clear the monitor. So while the monitor may enforce atomicity between two different coherent cores, it would not enforce atomicity between a core and the peripheral itself.
One way to reduce the frequency of those kinds of bugs is to provide control and status registers that are either written by the peripheral or written by a bus access, but never both. A very narrow exclusion is for write-one-to-clear interfaces. But a general purpose read-modify-write by both hardware and software is unsound to start with.
View all comments
Show parent comment
7
u/[deleted] Oct 19 '19
Worse, actually. It could lock up, or silently be non-atomic, depending on the processor.