Closed deepsrc closed 1 month ago
For CMO's to be at all usable on a given block address (i.e. to not always get an access fault), the PMP access control bits need to be as described. Conversely, if they are as you describe, then an access fault will always result (unless a higher priority exception occurred).
Though it can be inferred, I don't believe the spec explicitly states that the "access size" of a CBO is the size of the block. Do folks feel that a clarification is warranted?
To avoid any uncertainty at the expense of just a few extra words, it would probably be good to make "access size" explicit.
Addressed in https://github.com/riscv/riscv-isa-manual/pull/1431
Assuming grain size of 4 bytes and a cache line of 64 bytes divided into 2 contiguous PMP regions of 32 bytes each with same access permissions (say L=0 R=1 W=1 X=1), will a CBO.FLUSH result in an access fault exception?
See #1313
The answer is that
cbo.flush
can optionally be decomposed into more than one memory operation.If the cbo.flush
is performed as a single memory operation then it must fail. If it is decomposed into e.g. two 32 byte memory operations then it must succeed.
So either could happen. I'm not exactly sure what @gfavor was saying but hopefully the same thing!
I need clarification on how the CMO instructions are expected to behave in this particular scenario.
The CMO spec says the following -
while the PMP specification mandates that -
Assuming grain size of 4 bytes and a cache line of 64 bytes divided into 2 contiguous PMP regions of 32 bytes each with same access permissions (say L=0 R=1 W=1 X=1), will a CBO.FLUSH result in an access fault exception?