From: Ian Campbell Subject: Re: Question about apic ipi interface Date: Thu, 9 May 2013 09:56:34 +0100 Message-ID: <1368089794.17285.111.camel@zakaz.uk.xensource.com> References: <51765D56.1000906@canonical.com> <518A7CC0.6030504@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <518A7CC0.6030504@canonical.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: Stefan Bader Cc: "xen-devel@lists.xensource.com" , Ben Guthro , Konrad Rzeszutek Wilk , Lin Ming List-Id: xen-devel@lists.xenproject.org On Wed, 2013-05-08 at 17:26 +0100, Stefan Bader wrote: > On 23.04.2013 12:07, Stefan Bader wrote: > > I was looking at some older patch and there is one thing I do not understand. > > > > commit f447d56d36af18c5104ff29dcb1327c0c0ac3634 > > xen: implement apic ipi interface > > > > Specifically there the implementation of xen_send_IPI_mask_allbutself(). > > > > void xen_send_IPI_mask_allbutself(const struct cpumask *mask, > > int vector) > > { > > unsigned cpu; > > unsigned int this_cpu = smp_processor_id(); > > > > if (!(num_online_cpus() > 1)) > > return; > > > > for_each_cpu_and(cpu, mask, cpu_online_mask) { > > if (this_cpu == cpu) > > continue; > > > > xen_smp_send_call_function_single_ipi(cpu); > > } > > } > > > > Why is this using xen_smp_send_call_function_single_ipi()? This dumps the > > supplied vector and always uses XEN_CALL_FUNCTION_SINGLE_VECTOR. In contrast the > > xen_send_IPI_all() and xen_send_IPI_self() keep the (mapped) vector. > > > > Mildly wondering about whether call function would need special casing (just > > because xen_smp_send_call_function_ipi() is special). But I don't have the big > > picture there. > > > > This never got really answered, so lets try this: Does the following patch seem > to make sense? It certainly seems too. Although I traced the call chain back to default_send_IPI_allbutself() which nothing actually seems to call. Or my grep is faulty... There is a call path via send_IPI_allbutself which looks to only potentially be called as: apic->send_IPI_allbutself(APIC_DM_NMI); apic->send_IPI_allbutself(NMI_VECTOR); (the other calls are in native_smp_foo which I assume doesn't apply). xen_map_vector( doesn't seem to handle those two, I'm not sure if that will constitute a regression since it doesn't seem likely that either of those would have worked properly with the current code either. Ian.