From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH V2 5/8] xen/arm: vGIC: Consider AFF1 when injecting SGI. Date: Tue, 26 May 2015 16:36:51 +0200 Message-ID: <55648503.7060909@citrix.com> References: <1432389153-28207-1-git-send-email-cbz@baozis.org> <1432389153-28207-6-git-send-email-cbz@baozis.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YxFz5-0008T4-70 for xen-devel@lists.xenproject.org; Tue, 26 May 2015 14:37:35 +0000 In-Reply-To: <1432389153-28207-6-git-send-email-cbz@baozis.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: Chen Baozi , xen-devel@lists.xenproject.org Cc: Julien Grall , Chen Baozi , Ian Campbell List-Id: xen-devel@lists.xenproject.org Hi Chen, On 23/05/2015 15:52, Chen Baozi wrote: > From: Chen Baozi > > Use the AFF1 value of ICC_SGI1R_EL1 when injecting SGI in vGIC, > which expands the number of supported vCPU more than 16 that > target list bitmap can hold independently. > > Signed-off-by: Chen Baozi > --- > xen/arch/arm/vgic.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c > index 7b387b7..27bd137 100644 > --- a/xen/arch/arm/vgic.c > +++ b/xen/arch/arm/vgic.c > @@ -367,13 +367,19 @@ int vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode, int > > for_each_set_bit( vcpuid, &vcpu_mask, d->max_vcpus ) > { > - if ( d->vcpu[vcpuid] != NULL && !is_vcpu_online(d->vcpu[vcpuid]) ) > + /* > + * XXX: We assumes that only AFF1 and target list are used in > + * ICC_SGI1R_EL1. > + */ > + int real_id = vcpuid + ((sgir >> 16) & 0xff) * 16; > + This is not the right way to do it. vgic_to_sgi is common with GICv2 and GICv3 and should stay like that. Even if we take aside the GICv2 problem, the code is buggy as it only works when the SGI is sent to a list of VCPUs (i.e SGI_TARGET_LIST). Overall this should be done in vgic_v3_to_sgi by setting the correct bit in vcpu_mask. Although this will require to find another type for vcpu_mask as it's only able to store 64 cpus. Regards, -- Julien Grall