From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [RFC 20/22] xen/arm: gic: Expose the vGIC versions suported by GIC Date: Fri, 5 Jun 2015 13:35:39 +0100 Message-ID: <1433507739.7108.264.camel@citrix.com> References: <1431091783-29090-1-git-send-email-julien.grall@citrix.com> <1431091783-29090-21-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z0qqe-0004VN-Ne for xen-devel@lists.xenproject.org; Fri, 05 Jun 2015 12:35:44 +0000 In-Reply-To: <1431091783-29090-21-git-send-email-julien.grall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2015-05-08 at 14:29 +0100, Julien Grall wrote: > Some version of the GIC are able so support multiple versions of the > vGIC. > > For instance, some version of the GICv3 can as well support GICv2. > > Signed-off-by: Julien Grall --- > xen/arch/arm/gic-v2.c | 1 + > xen/arch/arm/gic-v3.c | 1 + > xen/include/asm-arm/gic.h | 6 ++++-- > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c > index f53560e..4719bc8 100644 > --- a/xen/arch/arm/gic-v2.c > +++ b/xen/arch/arm/gic-v2.c > @@ -737,6 +737,7 @@ const static struct gic_hw_operations gicv2_ops = { > static int __init gicv2_preinit(struct dt_device_node *node, const void *data) > { > gicv2_info.hw_version = GIC_V2; > + gicv2_info.vgic_versions = GIC_V2; > gicv2_info.node = node; > register_gic_ops(&gicv2_ops); > dt_irq_xlate = gic_irq_xlate; > diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c > index 7603a2c..329d6ca 100644 > --- a/xen/arch/arm/gic-v3.c > +++ b/xen/arch/arm/gic-v3.c > @@ -1249,6 +1249,7 @@ static const struct gic_hw_operations gicv3_ops = { > static int __init gicv3_preinit(struct dt_device_node *node, const void *data) > { > gicv3_info.hw_version = GIC_V3; > + gicv3_info.vgic_versions = GIC_V3; > gicv3_info.node = node; > register_gic_ops(&gicv3_ops); > dt_irq_xlate = gic_irq_xlate; > diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h > index 4319ac4..5f791b4 100644 > --- a/xen/include/asm-arm/gic.h > +++ b/xen/include/asm-arm/gic.h > @@ -207,8 +207,8 @@ struct gic_lr { > }; > > enum gic_version { > - GIC_V2, > - GIC_V3, > + GIC_V2 = 1 << 0, > + GIC_V3 = 1 << 1, > }; > > extern enum gic_version gic_hw_version(void); > @@ -282,6 +282,8 @@ void gic_clear_lrs(struct vcpu *v); > struct gic_info { > /* GIC version */ > enum gic_version hw_version; > + /* vGIC versions supported */ > + uint32_t vgic_versions; > /* Number of GIC lines supported */ > unsigned int nr_lines; > /* Number of LR registers */