From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: ian.campbell@citrix.com, Ian Jackson <ian.jackson@eu.citrix.com>,
Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>,
tim@xen.org, stefano.stabellini@citrix.com,
Jan Beulich <jbeulich@suse.com>,
xen-devel@lists.xenproject.org,
Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH for Xen 4.5] xen/arm: Add support for GICv3 for domU
Date: Fri, 31 Oct 2014 18:15:34 +0000 [thread overview]
Message-ID: <5453D1C6.5060802@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1410311732280.22875@kaball.uk.xensource.com>
Hi Stefano,
On 31/10/2014 17:45, Stefano Stabellini wrote:
>> static int make_timer_node(libxl__gc *gc, void *fdt, const struct arch_info *ainfo)
>> {
>> int res;
>> @@ -454,6 +539,7 @@ out:
>>
>> int libxl__arch_domain_init_hw_description(libxl__gc *gc,
>> libxl_domain_build_info *info,
>> + libxl__domain_build_state *state,
>> struct xc_dom_image *dom)
>> {
>> void *fdt = NULL;
>
> Can't you just call xc_configure_domain from here? Why do you need to
> introduce libxl__arch_domain_create_pre?
The DOMCTL was initially created to defer the VGIC initialization which
has to be done before the toolstack set the number of VCPUs.
Even though, the current implementation of the DOMCTL only returns the
version of the VGIC, I think it's still better to call it in the right
place for now.
I don't really want to justify on the latter patch why we have to move
the call earlier.
>> long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
>> @@ -30,6 +32,39 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
>>
>> return p2m_cache_flush(d, s, e);
>> }
>> + case XEN_DOMCTL_configure_domain:
>> + {
>> + uint8_t gic_version;
>> +
>> + /*
>> + * Xen 4.5: The vGIC is emulating the same version of the
>> + * hardware GIC. Only the value XEN_DOMCTL_CONFIG_GIC_DEFAULT
>> + * is allowed. The DOMCTL will return the actual version of the
>> + * GIC.
>> + */
>> + if ( domctl->u.configuredomain.gic_version != XEN_DOMCTL_CONFIG_GIC_DEFAULT )
>> + return -EINVAL;
>
> -EOPNOTSUPP is a better choice I think
I will use it in the next version.
>> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
>> index 91161a2..076aa62 100644
>> --- a/xen/arch/arm/gic-v3.c
>> +++ b/xen/arch/arm/gic-v3.c
>> @@ -906,7 +906,21 @@ static int gicv_v3_init(struct domain *d)
>> d->arch.vgic.rdist_count = gicv3.rdist_count;
>> }
>> else
>> - d->arch.vgic.dbase = GUEST_GICD_BASE;
>> + {
>> + d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE;
>> + d->arch.vgic.dbase_size = GUEST_GICV3_GICD_SIZE;
>> +
>> + /* XXX: Only one Re-distributor region mapped for the guest */
>> + BUILD_BUG_ON(GUEST_GICV3_RDIST_REGIONS != 1);
>
> I think that the comment is enough: GUEST_GICV3_RDIST_REGIONS is already
> #define to be 1.
I would prefer to keep this compilation-time check.
If someone decides to bump the number of re-distributor without
implementing the hyp side, it will be able to know quickly.
>> + d->arch.vgic.rdist_count = GUEST_GICV3_RDIST_REGIONS;
>> + d->arch.vgic.rdist_stride = GUEST_GICV3_RDIST_STRIDE;
>> +
>> + /* The first redistributor should contain enough space for all CPUs */
>> + BUILD_BUG_ON((GUEST_GICV3_GICR0_SIZE / GUEST_GICV3_RDIST_STRIDE) < MAX_VIRT_CPUS);
>> + d->arch.vgic.rbase[0] = GUEST_GICV3_GICR0_BASE;
>> + d->arch.vgic.rbase_size[0] = GUEST_GICV3_GICR0_SIZE;
>> + }
>>
>> d->arch.vgic.nr_lines = 0;
>>
>> diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
>> index 787e93c..4b81e70 100644
>> --- a/xen/include/asm-arm/domain.h
>> +++ b/xen/include/asm-arm/domain.h
>> @@ -47,7 +47,6 @@ struct arch_domain
>> #ifdef CONFIG_ARM_64
>> enum domain_type type;
>> #endif
>> -
>> /* Virtual MMU */
>> struct p2m_domain p2m;
>> uint64_t vttbr;
>
> spurious change
Oops, it was a leftover after melting the 2 patches. I will drop it in
the next version.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-10-31 18:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 18:51 [PATCH for Xen 4.5] xen/arm: Add support for GICv3 for domU Julien Grall
2014-10-31 9:02 ` Jan Beulich
2014-10-31 11:23 ` Julien Grall
2014-10-31 13:37 ` Jan Beulich
2014-10-31 13:53 ` Julien Grall
2014-10-31 15:12 ` Jan Beulich
2014-11-01 18:56 ` Julien Grall
2014-11-18 15:00 ` Julien Grall
2014-11-18 15:10 ` Ian Jackson
2014-11-18 15:26 ` Julien Grall
2014-11-18 15:35 ` Ian Jackson
2014-11-18 15:49 ` Empty struct in public headers Was: " Julien Grall
2014-11-18 16:21 ` Ian Campbell
2014-11-18 16:29 ` Julien Grall
2014-11-18 16:31 ` Ian Campbell
2014-11-18 16:15 ` Jan Beulich
2014-11-18 16:19 ` Julien Grall
2014-11-18 16:43 ` Jan Beulich
2014-10-31 17:45 ` Stefano Stabellini
2014-10-31 18:15 ` Julien Grall [this message]
2014-10-31 18:24 ` Stefano Stabellini
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=5453D1C6.5060802@linaro.org \
--to=julien.grall@linaro.org \
--cc=Vijaya.Kumar@caviumnetworks.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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.