From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v8a 5/6] xen/arm: split vgic driver into generic and vgic-v2 driver Date: Thu, 03 Jul 2014 13:57:50 +0100 Message-ID: <53B5534E.5080509@linaro.org> References: <1404376489-25165-1-git-send-email-vijay.kilari@gmail.com> <1404376489-25165-6-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404376489-25165-6-git-send-email-vijay.kilari@gmail.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: vijay.kilari@gmail.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com, tim@xen.org, xen-devel@lists.xen.org Cc: Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org On 07/03/2014 09:34 AM, vijay.kilari@gmail.com wrote: > int domain_vgic_init(struct domain *d) > { > int i; > @@ -75,6 +67,15 @@ int domain_vgic_init(struct domain *d) > else > d->arch.vgic.nr_lines = 0; /* We don't need SPIs for the guest */ > > + switch ( gic_hw_version() ) > + { > + case GIC_V2: > + vgic_v2_init(d); 4th time: vgic_v2_init can return an error, even though it's not the case right now. Please check the return. [..] > diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h > index 7c71d16..d310ca1 100644 > --- a/xen/include/asm-arm/vgic.h > +++ b/xen/include/asm-arm/vgic.h [..] > +struct vgic_ops { > + /* Initialize vGIC */ > + int (*vcpu_init)(struct vcpu *v); > + /* Domain specific initialization of vGIC */ > + int (*domain_init)(struct domain *d); > + /* SGI handler of vGIC */ > + int (*send_sgi)(struct vcpu *v, register_t sgir); By reviewing the VGIC-v3 support, I still don't think this is the right callback to add. You bypass the VGIC common emulation with your vgic_emulate... I would introduce a callback to emulate_sysreg rather than this send_sgi. Regards, -- Julien Grall