> From: Jintack Lim > Sent: Friday, June 1, 2018 11:47 AM > > Hi, > > I'm implementing Posted-interrupt functionality in vIOMMU. According > to Vt-d spec 5.2.3, IOMMU performs a coherent atomic read-modify-write > operation of the posted-interrupt descriptor. I wonder how can we > achieve this considering the guest can modify the same > posted-interrupt descriptor anytime. Is there any existing mechanism > that I can use in QEMU? >
I don't think it's possible to emulate such operation in software, unless you want to change guest to be cooperative. Actually it is not necessary. VT-d does so due to some hardware implementation consideration. Since you are emulating on CPU, could just follow how CPU posted interrupt is conducted. If you look at SDM (29.6 Posted-Interrupt Processing): "There is a requirement, however, that such modifications be done using locked read-modify-write instructions." [instructions] means you can do update multiple times when posting an interrupt, as long as each update is atomic. Thanks Kevin