|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [Query] Assigning PCI ranges to dom0 and domU
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:
>
> xen/arch/arm/platforms/xgene-storm.c:xgene_storm_specific_mapping
>
>
> 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).
>
>
> 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.
I am getting this output, cmd 30 in do_physdev_op is commented though
linux:~ # xl pci-assignable-add 01:10.1
(XEN) do_physdev_op cmd=30
linux:~ # xl pci-assignable-list
0000:01:10.1
linux:~ # xenstore-list
xenstore-list: Usage: xenstore-list [-h] [-p] [-s] key [...]
linux:~ # xenstore-list /local/domain/0
name
domid
linux:~ # xenstore-ls
tool = ""
xenstored = ""
local = ""
domain = ""
0 = ""
name = "Domain-0"
domid = "0"
libxl = ""
pciback = ""
0000-01-10-1 = ""
driver_path = "/sys/bus/pci/drivers/thunder-BGX"
Does it look good ?
Can you please send a log or point to one, which shows something
similar for x86 so that I can use that as a reference.
> 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 |