[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Sharing PCI devices



Petersson, Mats wrote:
-----Original Message-----
From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Didier Trosset
Sent: 23 May 2007 13:21
To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Sharing PCI devices


I'd like to know if there is a prefered way to go for sharing a PCI device between a couple of domUs. Is it better going para-virtualized, or full-virtualized ?

It is not (currently) possible to use hardware PCI devices inside a HVM
domain without major changes to the driver (and I'm not even sure if
there's sufficient support in the Hypercall interface to support the
necessary operations as it is today - but for certain, the driver needs
to be AWARE that it's in a virtual machine rather than a regular
"bare-metal" OS).
This is basically because Xen hides the actual memory layout of the
guest's memory from the guest, and thus when the guest THINKS it knows
the physical address (which is necessary to pass through to a PCI device
for it's bus mastering operations) it will not be able to give the right
information (but rather tell the same lies that it was told by Xen).
This leads to completely incorrect memory accesses from the device,
which in turn will lead to major mishaps in the device operation itself
(e.g. it sends the wrong data out on the line, reads "garbage"
instructions from memory, or overwrites the wrong area of memory with
it's data [network packet, disk data or whatever it may be]). In the
end, you'll probably end up with a VERY corrupted system that doesn't
behave anywhere like the right way.

This means that I could make my device working in a kind of degraded mode, where it would only be slave on the PCI bus (i.e. no DMA with bus mastering, in either direction, and no interrupts) within a HVM. Is this correct (leaving aside the concurrent access problems) ?

In the future, hardware with IOMMU (I/O Device Memory mapping) will be
able to "redirect" the "believed" memory address to the actual physical
location known by Xen. But this will not happen very soon.
So the answer here is that you NEED to have a Para-virtual kernel, at
least until IOMMU is available.
---- 8< ----



--
Didier Trosset-Moreau
Agilent Technologies
Geneva, Switzerland

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.