Page MenuHomeFreeBSD

lorenzodlaurito_gmail.com
User

Projects

User is not a member of any projects.

User Details

User Since
Sun, Nov 15, 2:33 PM (3 d, 3 h)

Recent Activity

Today

lorenzodlaurito_gmail.com added a comment to D61690: riscv: Add missing barriers to cpu_switch.

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.

Wed, Nov 18, 12:02 PM
lorenzodlaurito_gmail.com added a comment to D61690: riscv: Add missing barriers to cpu_switch.

@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 done

So 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.

Wed, Nov 18, 9:37 AM

Yesterday

lorenzodlaurito_gmail.com requested review of D61690: riscv: Add missing barriers to cpu_switch.
Tue, Nov 17, 10:32 PM