|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH v2 17/22] xen/arm: its: Map ITS translation space
Hello Vijay,
On 19/03/15 14:38, vijay.kilari@xxxxxxxxx wrote:
> +/*
> + * Map the 64K ITS translation space in guest.
> + * This is required purely for device smmu writes.
> +*/
Could this be avoid if the SMMU is not present?
> +
> +static int vgic_map_translation_space(uint32_t nr_its, struct domain *d)
> +{
> + uint64_t addr, size;
> + int ret;
> +
> + addr = d->arch.vits[nr_its].phys_base + SZ_64K;
> + size = SZ_64K;
> + ret = map_mmio_regions(d,
> + paddr_to_pfn(addr & PAGE_MASK),
> + DIV_ROUND_UP(size, PAGE_SIZE),
> + paddr_to_pfn(addr & PAGE_MASK));
The translation space may not be mapped 1:1 to the guest.
> +
> + if ( ret )
> + {
> + printk(XENLOG_ERR "Unable to map to dom%d access to"
> + " 0x%"PRIx64" - 0x%"PRIx64"\n",
> + d->domain_id,
> + addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
> + }
> +
> + return ret;
> +}
> +
> int vgic_its_domain_init(struct domain *d)
> {
> uint32_t num_its;
> @@ -1420,6 +1448,8 @@ int vgic_its_domain_init(struct domain *d)
> register_mmio_handler(d, &vgic_gits_mmio_handler,
> d->arch.vits[i].phys_base,
> SZ_64K);
> +
> + return vgic_map_translation_space(i, d);
With this you can't support multiple ITS as the loop will return just
after mapping the translation space.
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |