From patchwork Thu Aug 14 11:47:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 35401 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 77B35203C5 for ; Thu, 14 Aug 2014 11:50:10 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wn1sf6364813obc.6 for ; Thu, 14 Aug 2014 04:50:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive :content-type:content-transfer-encoding; bh=ZUtNDmrDq8eGsH1NoQnsP0cWKmMMdHSm3OHq8tLDx3M=; b=K04T7pTERT7uxEJuKDstW2YdSCBzYmTmjr+phGMbjLgWNY39Ak4U4kmUYXdvBT1gKI AGEay7cAwcW5ZwteHkT3c5E15chcMz2IiGqgZRpx2k6y2qUnoEAj2MIEoFXW4ujFoie5 gyLZ3hA8p47la2ogk2X8Ft+yb4d3Pfh9fFAKZgI+OzbS4T9F0TP6hSAX/m/hkF6o0Yxg hyLGTLQ8ED7lrkG6DGZpZK2Cd+sNsudWPWcEMbjFNunH3DBqJWhDvRiYcto7fsQv4E7e Reo8Pts1Uuvlz0gV4ZgaUq49r+AjD6C9oXuOaBgZKdD6oIHliQn58W6WlDMsq+I1jGRG Xj0w== X-Gm-Message-State: ALoCoQk1t3fS1UHDBAH1/tuD8gtgX21ooK6VsK2RFeDtcab3tJQg2eyZKq8ZwL8NnVbdrF5yNFyt X-Received: by 10.182.60.36 with SMTP id e4mr5863412obr.3.1408017010003; Thu, 14 Aug 2014 04:50:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.228 with SMTP id b91ls873518qge.88.gmail; Thu, 14 Aug 2014 04:50:09 -0700 (PDT) X-Received: by 10.220.182.1 with SMTP id ca1mr3154795vcb.21.1408017009840; Thu, 14 Aug 2014 04:50:09 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id fx7si832714vec.92.2014.08.14.04.50.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Aug 2014 04:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so1198908vcb.40 for ; Thu, 14 Aug 2014 04:50:09 -0700 (PDT) X-Received: by 10.220.164.198 with SMTP id f6mr820409vcy.51.1408017009756; Thu, 14 Aug 2014 04:50:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp27225vcb; Thu, 14 Aug 2014 04:50:09 -0700 (PDT) X-Received: by 10.50.111.167 with SMTP id ij7mr56872369igb.49.1408017009020; Thu, 14 Aug 2014 04:50:09 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id fs5si9279586igb.9.2014.08.14.04.50.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 14 Aug 2014 04:50:08 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XHtVR-0007XB-Mp; Thu, 14 Aug 2014 11:47:45 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XHtVQ-0007X6-Fg for xen-devel@lists.xen.org; Thu, 14 Aug 2014 11:47:44 +0000 Received: from [85.158.139.211:34869] by server-5.bemta-5.messagelabs.com id 7F/82-11546-FD1ACE35; Thu, 14 Aug 2014 11:47:43 +0000 X-Env-Sender: anup.patel@linaro.org X-Msg-Ref: server-10.tower-206.messagelabs.com!1408016861!6036440!1 X-Originating-IP: [209.85.192.170] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9965 invoked from network); 14 Aug 2014 11:47:43 -0000 Received: from mail-pd0-f170.google.com (HELO mail-pd0-f170.google.com) (209.85.192.170) by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 14 Aug 2014 11:47:43 -0000 Received: by mail-pd0-f170.google.com with SMTP id g10so1446396pdj.29 for ; Thu, 14 Aug 2014 04:47:41 -0700 (PDT) X-Received: by 10.66.141.7 with SMTP id rk7mr3759896pab.31.1408016861159; Thu, 14 Aug 2014 04:47:41 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ui8sm5034863pbc.84.2014.08.14.04.47.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Aug 2014 04:47:39 -0700 (PDT) From: Anup Patel To: xen-devel@lists.xen.org Date: Thu, 14 Aug 2014 17:17:26 +0530 Message-Id: <1408016846-12149-1-git-send-email-anup.patel@linaro.org> X-Mailer: git-send-email 1.7.9.5 Cc: Ian.Campbell@citrix.com, Anup Patel , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, stefano.stabellini@citrix.com, Pranavkumar Sawargaonkar Subject: [Xen-devel] [PATCH] xen/arm: Fix smp_send_call_function_mask() for current CPU X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anup.patel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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(); + } } /*