[vbox-dev] Question regarding channel callbacks between guest and host

Jaeyong Yoo jaeyong.yoo at samsung.com
Mon Apr 28 04:06:02 GMT 2014


Hello Ramshankar,

> The way we do IO and MMIO access is a bit complicated to trace because of
> a lot of indirection but the structure of the overall design is quite
> logical.
> 
> When executing guest-code under hardware virtualization, we'll get VM-
> Exits/#VMEXIT (for VT-x, see VMMR0/HMVMXR0.cpp hmR0VmxExitIoInstr(),
> hmR0VmxExitXcptPF() etc., for AMD-V see VMMR0/HMSVMR0.cpp:
> hmR0SvmExitIOInstr(), hmR0SvmExitXcptPF() etc.) that end up calling into
> the PDM/PGM/IOM subsystem. That then based on the port and access will
> choose the access handler which was registered for the port/MMIO region.
> 
> Different devices register access handlers for IO ports using
> PDMDevHlpIOPortRegister() and MMIO using PDMDevHlpMMIORegister().
> Finding which access handler gets called can be a bit tricky. One of the
> easier ways is, to see what has been registered using the VM debugger
> ("info phys" and "info handlers").
> 
> Depending on whether the device can handle the access request in ring-0 or
> not, we may reschedule the work to be done in ring-3.

After reading your explanation and I read the code, it quite understandable.

I've got one more question: I expect that IO/MMIO is the only way of
interaction
from the guest to the host. In case of the host to the guest interaction,
does
VirtualBox rely on interrupt injection (supported by VT-x) or does it use
some
kind of software-emulated method (like Xen's event channel)?

> 
> Hope that helps.

Helped a lot. Thanks!

Regards,
Jaeyong





More information about the vbox-dev mailing list