From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [Query] Flow of PCI device dedicated to a domU Date: Tue, 22 Jul 2014 10:53:50 +0100 Message-ID: <53CE34AE.9030500@citrix.com> References: <53C64AF8.90001@citrix.com> <53C79A7F.40304@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0480529388504536888==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xenbegn developer Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============0480529388504536888== Content-Type: multipart/alternative; boundary="------------040806040605060309060107" --------------040806040605060309060107 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On 22/07/14 10:43, Xenbegn developer wrote: > > > > On Thu, Jul 17, 2014 at 3:12 PM, Andrew Cooper > > wrote: > > On 17/07/14 07:34, Xenbegn developer wrote: > > On 7/16/14, Andrew Cooper > wrote: > >> On 16/07/14 07:12, Xenbegn developer wrote: > >>> Hi, > >>> I am trying to understand the flow of how a PCI device driver > in domU > >>> works after a PCI device is is assigned to a domU. > >>> > >>> a) If a PCI device is assigned to a domU, this device has to > be on a > >>> PCI bus. So as per my view xen would have to somehow provide a PCI > >>> Controller on which this device is attached. > >>> => Is my assumption correct ? If yes how it is done, No then > also How > >>> enumeration of this device happens in domU kernel > >> No. > >> > >> PV guests have no PCI root ports/bridges; they use devices as > single > >> entities knowing that Xen/dom0 takes care of the other bits. > HVM guests > >> have their PCI devices attached to the virtual southbridge > which is all > >> emulated by Qemu. > >> > > How would a then a PV guest know about existence of a PCI device > if it > > does not enumerate. Can you please elaborate on this. > > The pcifront driver is capable of finding any PCI devices offered by > pciback in dom0. It is all paravirtualised, and doesn't need explicit > hardware probing. > > So does this flow happens internally in xen for x86 > a) dom0 scans all the pci devices > b) Using libxl hypercalls a pci device is assigned to a domainU > c) When domU boots the pci front driver would talk to pci back driver > and discover the PCI devices >>From a basic point of view, yes. ~Andrew --------------040806040605060309060107 Content-Type: text/html; charset="UTF-8" Content-Length: 3914 Content-Transfer-Encoding: quoted-printable
On 22/07/14 10:43, Xenbegn developer wrote:



On Thu, Jul 17, 2014 at 3:12 PM, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
On 17/07/14 07:34, Xenbegn developer wrote:
> On 7/16/14, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 16/07/14 07:12, Xenbegn developer wrote:
>>> Hi,
>>> I am trying to understand the flow of how a PCI device driver in domU
>>> works after a PCI device is is assigned to a domU.
>>>
>>> a) If a PCI device is assigned to a domU, this device has to be on a
>>> PCI bus. So as per my view xen would have to somehow provide a PCI
>>> Controller on which this device is attached.
>>> =3D> Is my assumption correct =3F If yes how it is done, No then also How
>>> enumeration of this device happens in domU kernel
>> No.
>>
>> PV guests have no PCI root ports/bridges; they use devices as single
>> entities knowing that Xen/dom0 takes care of the other bits. HVM guests
>> have their PCI devices attached to the virtual southbridge which is all
>> emulated by Qemu.
>>
> How would a then a PV guest know about existence of a PCI device if it
> does not enumerate. Can you please elaborate on this.

The pcifront driver is capable of finding any PCI devices offered by
pciback in dom0. =C2=A0It is all paravirtualised, and doesn't need explicit
hardware probing.

So does this flow happens internally in xen for x86
a) dom0 scans all the pci devices
b) Using libxl hypercalls a pci device is assigned to a domainU
c) When=C2=A0 domU boots the pci front driver would talk to pci back driver and discover the PCI devices

From a basic point of view, yes.

~Andrew
--------------040806040605060309060107-- --===============0480529388504536888== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============0480529388504536888==--