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

Re: [Xen-devel] [PATCH v3 4/5] xen: arm: map child MMIO and IRQs to dom0 for PCI bus DT nodes.



Hi Ian,

On 20/04/15 13:16, Ian Campbell wrote:
> +static int map_interrupt_to_domain(const struct dt_device_node *dev,
> +                                   const struct dt_raw_irq *dt_raw_irq,
> +                                   void *data)
> +{

[..]

> +    res = route_irq_to_guest(d, dt_irq.irq, dt_irq.irq, dt_node_name(dev));
> +    if ( res < 0 )
> +    {
> +        printk(XENLOG_ERR "Unable to map IRQ%"PRId32" to dom%d\n",
> +               dt_irq.irq, d->domain_id);
> +        return res;
> +    }

You forgot to give the IRQ permission to the domain.

Also I'm wondering if we should care about passthrough the PCI
controller to a guest. If so, you would need to check need_mapping as we
do in handle_device.

If not, I would add a warning if the property "xen,passthrough" exists
in the node telling that we won't honor it.

> +    DPRINT("  - IRQ: %u\n", dt_irq.irq);
> +
> +    return 0;
> +}
> +
> +static int map_range_to_domain(const struct dt_device_node *dev,
> +                               u64 addr, u64 len,
> +                               void *data)
> +{
> +    struct domain *d = data;
> +    int res;
> +
> +    res = map_mmio_regions(d,
> +                           paddr_to_pfn(addr & PAGE_MASK),
> +                           DIV_ROUND_UP(len, PAGE_SIZE),
> +                           paddr_to_pfn(addr & PAGE_MASK));
> +    if ( res < 0 )
> +    {
> +        printk(XENLOG_ERR "Unable to map 0x%"PRIx64
> +               " - 0x%"PRIx64" in domain %d\n",
> +               addr & PAGE_MASK, PAGE_ALIGN(addr + len) - 1,
> +               d->domain_id);
> +        return res;
> +    }
> +
> +    DPRINT("  - MMIO: %010"PRIx64" - %010"PRIx64"\n", addr, addr+len);

NIT: mising space "addr + len"

And same question as for the interrupt.

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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