[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [Query] Assigning PCI ranges to dom0 and domU
Please use plain text for emails, avoid HTML. On Sat, 9 Aug 2014, manish jaggi wrote: > On 1 August 2014 19:31, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> > wrote: > On Fri, 1 Aug 2014, manish jaggi wrote: > > Hi Stefano, > > > > I am working on accessing PCI nodes in the doms on ARM (cavium). If > there is the below device tree node > > pcie1@0x849000000000 { > >  Â compatible = "cavium,thunder-pcie"; > >   device_type = "pci"; > >   msi-parent = <&its>; > >   bus-range = <0 255>; > >   #size-cells = <2>; > >   #address-cells = <3>; > >   reg = <0x8490 0x00000000 0 0x40000000>; /* Configuration > space */ > >   ranges = <0x03000000 0x8310 0x00000000 0x8310 0x00000000 0x00 > 0x10000000>, /* mem ranges */ > >    <0x03000000 0x8100 0x00000000 0x8100 0x00000000 0x80 > 0x00000000>; > >  }; > >  > > > > How to assign ranges to guest dom0 / domU. Is there a well defined > api in xen OR I have to parse the device tree > > ranges and do a 1:1 mapping using map_mmio_regions. > > Firstly you just need to get PCI up and running in Dom0, and you can do > that by passing this device tree node to Dom0 and remapping the > appropriate memory ranges. See for example: > > That is working > > xen/arch/arm/platforms/xgene-storm.c:xgene_storm_specific_mapping > > I believe that is a static mapping, we are passing the PCI node in device > tree moreover cavium pcie uses MSI. > > Once that is done, it is time to look at pciback and pcifront and try to > get them running on ARM. > > > I would start by enabling PCI passthrough in the xl toolstack, look at > tools/libxl/libxl_pci.c:libxl__device_pci_add, called by > domcreate_attach_pci. It should be working on ARM following the PV path > (LIBXL_DOMAIN_TYPE_PV). > > Can you please elaborate more on this, does there needs to be some code which > is ARM specific in libxl I don't see anything x86 specific in libxl_pci.c but the code hasn't actually ever been run on Xen on ARM so I wouldn't be surprised if you'll need to fix a few things to get it going. > After the toolstack parts are in place, you should be able to see a pci > entry in xenstore (xenstore-ls to list everything that is present in > xenstore). That is the basic information needed by pcifront and pciback > to enstablish a communication channel. Pcifront is > drivers/pci/xen-pcifront.c and pciback is drivers/xen/xen-pciback: you > need to compile and initialize them on ARM. You might have to implement > a few ARM Âspecific missing pieces, corresponding to the x86 ones in > arch/x86/pci/xen.c. They are mostly about MSIs. > > > > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |