Was quite a head scratcher until I took a look at the code on the other side.
In virtualbox's DevAHCI.cpp, access to the CI register is handled by the following code (only copied the relavent parts):
Code: Select all
PortCmdIssue_w(...)
{
...
pAhciPort->regCI &= ~uCIValue;
...
}
PortCmdIssue_r(...)
{
...
pAhciPort->regCI &= ~uCIValue;
...
}
Adding serialization in my code for accesses to this register seems to have resolved the hang, sort of proving that there's no general MMIO serialization in virtualbox protecting the 2 functions above.
Now, as in the title, the question is, is it okay to perform MMIO accesses to the same register in parallel?