WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Sharing PCI devices

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Sharing PCI devices
From: Didier Trosset <didier_trosset@xxxxxxxxxxx>
Date: Fri, 08 Jun 2007 10:13:24 +0200
Cc: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Delivery-date: Fri, 08 Jun 2007 01:11:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <907625E08839C4409CE5768403633E0B02561D20@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <907625E08839C4409CE5768403633E0B02561D20@xxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Icedove 1.5.0.10 (X11/20070329)
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

<Prev in Thread] Current Thread [Next in Thread>