From: Ian Campbell Subject: Re: [PATCH v8a 5/6] xen/arm: split vgic driver into generic and vgic-v2 driver Date: Thu, 3 Jul 2014 14:02:35 +0100 Message-ID: <1404392555.19893.12.camel@kazak.uk.xensource.com> References: <1404376489-25165-1-git-send-email-vijay.kilari@gmail.com> <1404376489-25165-6-git-send-email-vijay.kilari@gmail.com> <53B5534E.5080509@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53B5534E.5080509@linaro.org> 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: vijay.kilari@gmail.com, stefano.stabellini@eu.citrix.com, Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com, tim@xen.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-07-03 at 13:57 +0100, Julien Grall wrote: > > +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. Why? The vgic will either be v2 or v3, so either MMIO or sysreg, once the thing has been decoded then you want to send an SGI I think, hence the callback. Passing a register_t does seem odd though, I'd have thought it would take an SGI number and any other flags which would then be interpreted for either v2 or v3 as appropriate. Although thinking about it now: Given that a guest can't mix gic v2 and v3 why is the send sgi exposed outside of the respective files at all? I suppose it's because it goes via the core gic code? Ian.