Closed ingallsj closed 1 month ago
The RISC-V Privileged ISA spec says that
Accessing the same location using different cacheability attributes may cause loss of coherence. Executing the following sequence between such accesses prevents both loss of coherence and loss of memory ordering:
fence iorw, iorw
, followed bycbo.flush
to an address of that location, followed by afence iorw, iorw
.
It makes no requirement on the PBMT Cacheability of that address, therefore we can conclude that cbo.flush
must operate on that location ignoring PBMT overrides.
I agree, and the key idea is that CMOs ultimately respect the cacheability PMA, even if the PBMTs "downgrade" cacheability to non-cacheable.
Should CMOs (Clean/Flush/Inval) to memory that is PBMT-downgraded to NC or IO still search and manage the caches? Other contemporary ISAs say that yes, CMOs to operate on caches regardless of the PTE memory type, so there is precedent for what existing software device drivers will expect. I think we should re-open this question for RISC-V, and at least discuss and document the answer.
We do say for CBO.ZERO:
So should we also say something like this for CBO.CLEAN/FLUSH/INVAL?