qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] about correctness of IDE emulation
@ 2016-03-13 19:37 Huaicheng Li (coperd)
  2016-03-14  1:42 ` Fam Zheng
  2016-03-14 10:15 ` Stefan Hajnoczi
  0 siblings, 2 replies; 8+ messages in thread
From: Huaicheng Li (coperd) @ 2016-03-13 19:37 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi, Fam Zheng

Hi all, 

I meet some trouble in understanding IDE emulation:

(1) IDE I/O Down Path (In VCPU thread): 
upon KVM_EXIT_IO, corresponding disk ioport write function will write IO info to IDEState, then ide read callback function will eventually split it into **several DMA transfers** and eventually submit them to the AIO request list for handling. 

(2). I/O Up Path (worker thread —>  QEMU main loop thread)
when the request in AIO request list has been successfully handled, the worker thread will signal the QEMU main thread this I/O completion event, which is later handled by its callback (posix_aio_read). posix_aio_read will then eventually return to IDE callback function, where virtual interrupt is generated to signal guest about I/O completion.

What I’m confused about is that:

If one I/O is too large and may need several rounds (say 2) of DMA transfers, it seems the second round transfer begins only after the completion of the first part, by reading data from **IDEState**. But the IDEState info may have been changed by VCPU threads (by writing new I/Os to it) when the first transfer finishes. From the code, I see that IDE r/w call back function will continue the second transfer by referencing IDEState’s information. Wouldn’t this be problematic? Am I missing anything here?

Thanks.

Best,
Huaicheng

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-04-13 21:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13 19:37 [Qemu-devel] about correctness of IDE emulation Huaicheng Li (coperd)
2016-03-14  1:42 ` Fam Zheng
2016-03-15  3:09   ` Huaicheng Li
2016-03-15 12:59     ` Stefan Hajnoczi
2016-04-13  7:25     ` Huaicheng Li (coperd)
2016-04-13 18:07       ` John Snow
2016-04-13 21:12         ` Huaicheng Li
2016-03-14 10:15 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).