From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anup Patel Subject: [PATCH] xen/arm: Fix smp_send_call_function_mask() for current CPU Date: Thu, 14 Aug 2014 17:17:26 +0530 Message-ID: <1408016846-12149-1-git-send-email-anup.patel@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian.Campbell@citrix.com, Anup Patel , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, stefano.stabellini@citrix.com, Pranavkumar Sawargaonkar List-Id: xen-devel@lists.xenproject.org The smp_send_call_function_mask() does not work on Foundation v8 model with one CPU. The reason being gicv2_send_SGI() is called with irqmode==SGI_TARGET_LIST and *cpu_mask=0x1 on CPU0 which does not work on Foundation v8 model. Further, it is really strange that smp_send_call_function_mask() depends on GIC SGIs for calling function on current CPU. This patch fixes smp_send_call_function_mask() for current CPU by directly calling smp_call_function_interrupt() on current CPU. This is very similar to what Xen x86 does. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar --- xen/arch/arm/smp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c index 30203b8..4fde3f9 100644 --- a/xen/arch/arm/smp.c +++ b/xen/arch/arm/smp.c @@ -20,6 +20,13 @@ void smp_send_event_check_mask(const cpumask_t *mask) void smp_send_call_function_mask(const cpumask_t *mask) { send_SGI_mask(mask, GIC_SGI_CALL_FUNCTION); + + if ( cpumask_test_cpu(smp_processor_id(), mask) ) + { + local_irq_disable(); + smp_call_function_interrupt(); + local_irq_enable(); + } } /* -- 1.7.9.5