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

Re: [Xen-devel] [PATCH v2 20/21] libxl: Add support for non-PCI passthrough

On 08/06/2014 05:58 PM, Stefano Stabellini wrote:
> On Wed, 6 Aug 2014, Julien Grall wrote:
>> Hi Stefano,
>> On 08/06/2014 05:44 PM, Stefano Stabellini wrote:
>>> On Thu, 31 Jul 2014, Julien Grall wrote:
>>>> On ARM, every non-PCI device are described in the device tree. Each of them
>>>> can be found via a path.
>>>> This path will be used to retrieved the different informations about the
>>>> device (compatible string, interrupts, MMIOs). Libxl will take care of:
>>>>     - Allocate the MMIOs regions for the device in the guest
>>>>     - Create the device node in the guest device tree
>>>>     - Map the IRQs and MMIOs range in the guest P2M
>>>> Note, that the device node won't contains specific properties for the node.
>>>> Only generic one (compatible, interrupts, regs) will be created by libxl.
>>>> In the future, per-device properties will be added. Maybe via a 
>>>> configuration
>>>> file listing what is needed.
>>>> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
>>>> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
>>>> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
>>>> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
>>>> ---
>>>>     Changes in v2:
>>>>         - Get DT infos earlier
>>>>         - Allocate/map IRQ in libxl__arch_domain_create rather than in
>>>>         libxl__device_dt_add
>>> I understand why you moved it earlier but if it is not too hard I would
>>> suggest to try to keep mmio and irq mapping all together, because it
>>> would make the code much easier to read and modify in the future, being
>>> all in one place.
>> I could fixup the device tree later. So we don't have to "map/retrieve"
>> the IRQ earlier.
>> But I don't much like this solution.
> Urgh, that's horrible. I'll leave it to Ian to decide what's best.

FWIW, we already fix up the device later for the initrd node and the
memory banks.

Thinking a bit more to this solution and it won't be easily possible.
The device tree is finalized and copy the guest memory in
xc_dom_build_image which is called by libxl__build_pv.

So unless we assign platform device very early (i.e between
libxl_build_pre call and libxl__build_pv call in
libxl__domain_build_pv), we will have to map/get the interrupt very
early in a hackish way.

This is because we have to get the virtual IRQ to create the DT node for
the device.

I'm open to any other ideas.


Julien Grall

Xen-devel mailing list



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