All of lore.kernel.org
 help / color / mirror / Atom feed
* Disk IO using QEMU
@ 2007-04-19  4:18 Alkesh Shah
  2007-04-19 10:08 ` Petersson, Mats
  0 siblings, 1 reply; 2+ messages in thread
From: Alkesh Shah @ 2007-04-19  4:18 UTC (permalink / raw)
  To: xen-devel

Hi,

I am trying to understand how Disk I/O actually works in HVM. From what 
I understand, whenever a disk i/o takes place in a guest OS, a VMEXIT 
occurs. The hypervisor than executes some handler, which sets up an 
event pending bit for the event channel communicating with the QEMU-DM 
in the Domain 0. QEMU-DM than emulates these I/O instructions.

Specifically, I wanted to know -
1. The functions that are called in this process....  or the files that 
I need to look at in order to understand the exact flow.
2. Since, QEMU-DM handles both the display as well as the disk I/O, is 
the same event channel port used for communication between hypervisor 
and qemu-dm for both display and disk i/o?

Thank you for you help.

Regards,
Alkesh Shah

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

* RE: Disk IO using QEMU
  2007-04-19  4:18 Disk IO using QEMU Alkesh Shah
@ 2007-04-19 10:08 ` Petersson, Mats
  0 siblings, 0 replies; 2+ messages in thread
From: Petersson, Mats @ 2007-04-19 10:08 UTC (permalink / raw)
  To: Alkesh Shah, xen-devel

 

> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com 
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of 
> Alkesh Shah
> Sent: 19 April 2007 05:18
> To: xen-devel@lists.xensource.com
> Subject: [Xen-devel] Disk IO using QEMU
> 
> Hi,
> 
> I am trying to understand how Disk I/O actually works in HVM. 
> From what 
> I understand, whenever a disk i/o takes place in a guest OS, a VMEXIT 
> occurs. The hypervisor than executes some handler, which sets up an 
> event pending bit for the event channel communicating with 
> the QEMU-DM 
> in the Domain 0. QEMU-DM than emulates these I/O instructions.
> 
> Specifically, I wanted to know -
> 1. The functions that are called in this process....  or the 
> files that 
> I need to look at in order to understand the exact flow.

The IO instruction is intercepted by the hardware in the processor,
which forms a IOIO vmexit, which ends up in the relevant part of
vmexit_handler in .../xen/arch/x86/hvm/{vmx/vmx.c,svm/svm.c}. Form there
it goes to generic hvm-code (hvm_send_pio or some such), which does some
parsing and then does the event stuff. 

In QEMU it comes in to .../tools/ioemu/target-i386-dm/helper2.c, which
then (after some function calls) does the IO operation - that's
essentially a function table of 65536 entries (times 3 for different
sized), and eventually ends up in .../tools/ioemu/hw/ide.c. 

> 2. Since, QEMU-DM handles both the display as well as the 
> disk I/O, is 
> the same event channel port used for communication between hypervisor 
> and qemu-dm for both display and disk i/o?

To quote Little Britain's Vicky Pollard, "Yeah, but no, but yeah, but
..." 

Yes, qemu-dm is responsible for the video output too. But it's (for most
parts) not using the event-channel to display the data - it's using a
shared memory buffer that is just compared to see if it's changed since
last time every few milliseconds. If it's changed, it gets redrawn. So
the event-channel used for IO operations isn't involved in the display
updates [other than when there is a mode-change or some other IO
operation to the graphics processor, but that's a rare occurrence
relatively speaking]. 

--
Mats
> 
> Thank you for you help.
> 
> Regards,
> Alkesh Shah
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 
> 
> 

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

end of thread, other threads:[~2007-04-19 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-19  4:18 Disk IO using QEMU Alkesh Shah
2007-04-19 10:08 ` Petersson, Mats

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.