User Details
- User Since
- Sun, Nov 15, 2:33 PM (3 d, 3 h)
Today
Just a note, amd64 and arm64 insert the 'context switching' fence in pmap_activateXXX(), not in cpu_switch.S
Those are two different issues from the MMIO case though, I think.
@kib Is it a case like this?
mmio op fence rely on the op being done
Which could be scheduled as
CPU1 CPU2
mmio op
---------- switch ----------
fence
rely on op being doneSo we haven't waited on the mmio op, which can be a write but also a read that has side effects (like fifos or read-to-ack mmio regs).
I guess we need a fence io, io too then on top of the current fences.
If I understand correctly, on arm64 a stronger barrier is certainly needed because ic and tlbi are asynchronous instructions, but the riscv equivalents are synchronous. The Svinval extension though might need it?
The io fence could be placed anywhere as long as there is no mmio crossing it, including at the top of cpu_switch I think.
I'll wait for more confirmation though, especially as I don't have riscv hardware to test the overhead.
