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

Re: [Xen-devel] [PATCH] xen/arm: Handle translated addresses for hardware domains in GICv2

On Fri, 2015-02-20 at 09:38 +0000, Frediano Ziglio wrote:
> Translated address could have an offset applied to them.
> Replicate same value for device node to avoid improper address
> computation in the OS.

I don't think this adequately explains what is going on here.

AIUI the issue is that the values in d->arch.vgic.{c,d}base have already
been translated to host level addresses from whatever bus address
applied to them in the DT.

By copying the original address from the DT directly we then get the
original untranslated reg property, which the guest will then apply the
translations to and, presumably, retrieve the same answer we have in

This relies on us putting our GIC node at the same place as the
platforms DTB, which is indeed the case.

Please can you rewrite the commit message to explain this more clearly.

One minor comment on the code:

> +    /* copy GICC and GICD regions */
> +    regs = dt_get_property(gic, "reg", &len);
> +    if ( !regs )
> +    {
> +        dprintk(XENLOG_ERR, "Can't find reg property for the gic node\n");
> +        return -FDT_ERR_XEN(ENOENT);
> +    }
> +
>      len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
>      len *= 2; /* GIC has two memory regions: Distributor + CPU interface */

It takes a second to figure out why we aren't just using the length
retrieved from the dt. Please add a comment.


Xen-devel mailing list



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