From patchwork Mon Aug 25 10:18:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 35893 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B3324203C0 for ; Mon, 25 Aug 2014 10:21:25 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id y10sf106740917pdj.4 for ; Mon, 25 Aug 2014 03:21:25 -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=WlPLVPR+q8wwkKv2xi/pD6u3mR5bnaQAdtmi0mZAyqQ=; b=RniKnDwXBD/GE0O5zmlz+/xK4Zqp71HAeYTheFr2gWrYYsGIE4OC7iu9UEXm6TymF4 uSJvrUnSP1yIEiCfa+jyGRku2ZLNyOIrUMr2WTJAy6sDVpMpiu/7M2C/co6LXD4wp4On b101xIOU+YiUUhgqBuv+DWOk+lggLuwylVRe75fJqPTsJgLj+Mnm6FxAkXkMZPA2mnGJ IEa92o3LZu6B+4uGMjkMa4seVUPLs0OQxD8fJ4HklwLZ60GaNva1UIfS3HEOgM5RWc6X DDod1GKYDbcA+oEPLy0SGIBq9xv16yQf/gPRIOYjXHhg22rA34L4xIFXdWywzHWk7e7/ WI4w== X-Gm-Message-State: ALoCoQlyVcqMkqKfzcLzOocal6e1g/FF+zk9lrR/kwXFXb+N+VTDBz8WmQZT/SP7CE8DpRh2lCKR X-Received: by 10.66.119.174 with SMTP id kv14mr13760563pab.23.1408962085028; Mon, 25 Aug 2014 03:21:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.41 with SMTP id 38ls2006056qgi.26.gmail; Mon, 25 Aug 2014 03:21:24 -0700 (PDT) X-Received: by 10.52.148.2 with SMTP id to2mr400819vdb.38.1408962084882; Mon, 25 Aug 2014 03:21:24 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id jv1si16358713vdb.16.2014.08.25.03.21.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Aug 2014 03:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so15030240vcb.10 for ; Mon, 25 Aug 2014 03:21:24 -0700 (PDT) X-Received: by 10.220.2.136 with SMTP id 8mr17833589vcj.17.1408962084798; Mon, 25 Aug 2014 03:21:24 -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.45.67 with SMTP id uj3csp105726vcb; Mon, 25 Aug 2014 03:21:24 -0700 (PDT) X-Received: by 10.50.115.73 with SMTP id jm9mr14339687igb.3.1408962084133; Mon, 25 Aug 2014 03:21:24 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id fs5si6107192igb.9.2014.08.25.03.21.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Aug 2014 03:21:24 -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 1XLrMu-0000oE-QX; Mon, 25 Aug 2014 10:19:20 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XLrMt-0000o9-RC for xen-devel@lists.xen.org; Mon, 25 Aug 2014 10:19:19 +0000 Received: from [85.158.143.35:58610] by server-3.bemta-4.messagelabs.com id 15/68-06192-7AD0BF35; Mon, 25 Aug 2014 10:19:19 +0000 X-Env-Sender: anup.patel@linaro.org X-Msg-Ref: server-3.tower-21.messagelabs.com!1408961956!12664522!1 X-Originating-IP: [209.85.192.174] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13405 invoked from network); 25 Aug 2014 10:19:18 -0000 Received: from mail-pd0-f174.google.com (HELO mail-pd0-f174.google.com) (209.85.192.174) by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 25 Aug 2014 10:19:18 -0000 Received: by mail-pd0-f174.google.com with SMTP id fp1so20049588pdb.19 for ; Mon, 25 Aug 2014 03:19:15 -0700 (PDT) X-Received: by 10.68.194.194 with SMTP id hy2mr9032728pbc.149.1408961953403; Mon, 25 Aug 2014 03:19:13 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id fl4sm70112091pab.31.2014.08.25.03.19.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Aug 2014 03:19:12 -0700 (PDT) From: Anup Patel To: xen-devel@lists.xen.org Date: Mon, 25 Aug 2014 15:48:40 +0530 Message-Id: <1408961920-3729-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, patches@apm.com, stefano.stabellini@citrix.com, Pranavkumar Sawargaonkar Subject: [Xen-devel] [PATCH v2] xen arm/arm64: minor improvement in smp_send_call_function_mask() 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.179 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: Currently, smp_send_call_function_mask() function implemented by xen arm/arm64 will use IPI to call function on current CPU. This means that current smp_send_call_function_mask() will do the following on current CPU: Trigger SGI for current CPU => Xen takes interrupt on current CPU => IPI interrupt handler will call smp_call_function_interrupt() This patch improves the above by straight away calling smp_call_function_interrupt() for current CPU. This is very similar to smp_send_call_function_mask() implemented by Xen x86. Changes since v1: - Drop the check protecting send_SGI_mask() call Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar Acked-by: Julien Grall --- xen/arch/arm/smp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c index 30203b8..917d490 100644 --- a/xen/arch/arm/smp.c +++ b/xen/arch/arm/smp.c @@ -19,7 +19,18 @@ 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); + cpumask_t target_mask; + + cpumask_andnot(&target_mask, mask, cpumask_of(smp_processor_id())); + + send_SGI_mask(&target_mask, GIC_SGI_CALL_FUNCTION); + + if ( cpumask_test_cpu(smp_processor_id(), mask) ) + { + local_irq_disable(); + smp_call_function_interrupt(); + local_irq_enable(); + } } /*