From: Ian Campbell Subject: Re: [PATCH v5 03/21] xen/arm: make sgi handling generic Date: Tue, 17 Jun 2014 12:52:04 +0100 Message-ID: <1403005924.16844.65.camel@kazak.uk.xensource.com> References: <1402580192-13937-1-git-send-email-vijay.kilari@gmail.com> <1402580192-13937-4-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: <1402580192-13937-4-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 Cc: stefano.stabellini@eu.citrix.com, Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com, julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-06-12 at 19:06 +0530, vijay.kilari@gmail.com wrote: > void send_SGI_allbutself(enum gic_sgi sgi) > { > + cpumask_t all_others_mask; > ASSERT(sgi < 16); /* There are only 16 SGIs */ > > + cpumask_andnot(&all_others_mask, &cpu_possible_map, cpumask_of(smp_processor_id())); > dsb(sy); > > - GICD[GICD_SGIR] = GICD_SGI_TARGET_OTHERS > - | sgi; > + send_SGI(&all_others_mask, sgi, SGI_TARGET_OTHERS); What is all_others_mask for here? send_sgi doesn't reference that argument when SGI_TARGET_OTHERS is used. Ah, I see Stefano asked in v4 and you explained (hint: when someone has to ask it often indicates that it is worth explaining in the commit message next time around). You said: In GICv2 the mask is not used in some cases. However mask value is used in GICv3. To make it generic mask value is always computed. I think the right answer here is for the gicv3 implementation of send_SGI to calculate the mask for SGI_TARGET_OTHERS and SGI_TARGET_SELF internally. I'd also be inclined to put the mask as the last argument, i..e static void send_SGI(enum gic_sgi sgi, enum gic_sgi_mode irqmode, const cpumask_t *cpu_mask) That seems like a more natural argument order to me. (i.e. what, where to, more detailed target when required). Ian.