From: Ian Campbell <ian.campbell@citrix.com>
To: Frediano Ziglio <frediano.ziglio@huawei.com>
Cc: Tim Deegan <tim@xen.org>, Julien Grall <julien.grall@linaro.org>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
zoltan.kiss@huawei.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] xen/arm: Handle translated addresses for hardware domains in GICv2
Date: Tue, 24 Feb 2015 16:00:36 +0000 [thread overview]
Message-ID: <1424793636.27930.367.camel@citrix.com> (raw)
In-Reply-To: <1424425080-3927-1-git-send-email-frediano.ziglio@huawei.com>
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
{c,d}base.
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.
Ian.
next prev parent reply other threads:[~2015-02-24 16:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-20 9:38 [PATCH] xen/arm: Handle translated addresses for hardware domains in GICv2 Frediano Ziglio
2015-02-23 16:30 ` Julien Grall
2015-02-24 16:01 ` Ian Campbell
2015-02-24 16:21 ` Julien Grall
2015-02-24 17:00 ` Ian Campbell
2015-02-24 17:09 ` Julien Grall
2015-02-24 16:00 ` Ian Campbell [this message]
2015-02-25 11:14 ` Frediano Ziglio
2015-02-25 13:03 ` Julien Grall
2015-02-25 13:21 ` Frediano Ziglio
2015-02-27 13:53 ` Julien Grall
2015-02-27 13:57 ` Ian Campbell
2015-02-27 14:00 ` Julien Grall
2015-02-27 14:08 ` Frediano Ziglio
2015-03-02 14:50 ` Ian Campbell
2015-03-02 15:00 ` Frediano Ziglio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1424793636.27930.367.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=frediano.ziglio@huawei.com \
--cc=julien.grall@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
--cc=zoltan.kiss@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.