From patchwork Tue Aug 19 04:48:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 35549 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6581B20676 for ; Tue, 19 Aug 2014 04:51:17 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id h18sf27454046igc.1 for ; Mon, 18 Aug 2014 21:51:16 -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=lshI0y1+xIlHfpiM2i8pWoBCiS3p2IaZH5FLrtzlDoI=; b=ZUe6yhBwhQnotfr9CiJW/era2Oj690YHCz4ET3skjPaWE8aPXfZlwJHPCW5jsebZcn torg3wO7NpjzRoK+BZNryaFtiqNlGUT2tlYiwRdL9Fy6vIshWRMCrDI7wZNgNFv9JwiB 0AEEooSrkLgEP90nr2wB6rqVn2Cw2Hcp8SDSXsUCabDXrLrJfLUWoinGk3gEgya8/r9N DdFXv7Bk5XoyFg014qVy8/2fmG79vPlM86IzvY2Wq7QViqTYg4OlXvss5USkevPDzt1L HncuSWp9QaypLzSAS1dQT6r1HjWPwdJ1b0Cc3ITAvHbLjKY3AthV2pxQDV8ypZ3mWQd1 iM5Q== X-Gm-Message-State: ALoCoQm+a54hke4E14VfobfJ14Hio8Skxqfycw0KjJRe3wJSPIyaWctf3HVr4mItcjAqEoeu0n3w X-Received: by 10.42.118.200 with SMTP id y8mr22117784icq.4.1408423876924; Mon, 18 Aug 2014 21:51:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.21 with SMTP id h21ls2733224qge.52.gmail; Mon, 18 Aug 2014 21:51:16 -0700 (PDT) X-Received: by 10.52.119.229 with SMTP id kx5mr7542086vdb.40.1408423876805; Mon, 18 Aug 2014 21:51:16 -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 ee14si8184524vcb.93.2014.08.18.21.51.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 21:51:16 -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 hq11so6838726vcb.38 for ; Mon, 18 Aug 2014 21:51:16 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr28206887vch.22.1408423876710; Mon, 18 Aug 2014 21:51:16 -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 tc5csp209399vcb; Mon, 18 Aug 2014 21:51:16 -0700 (PDT) X-Received: by 10.50.128.234 with SMTP id nr10mr3213814igb.3.1408423876143; Mon, 18 Aug 2014 21:51:16 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v8si10855718igd.31.2014.08.18.21.51.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Aug 2014 21:51:16 -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 1XJbM3-00079w-7m; Tue, 19 Aug 2014 04:49:07 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XJbM1-00079r-IP for xen-devel@lists.xen.org; Tue, 19 Aug 2014 04:49:05 +0000 Received: from [193.109.254.147:34929] by server-8.bemta-14.messagelabs.com id E2/CD-07074-047D2F35; Tue, 19 Aug 2014 04:49:04 +0000 X-Env-Sender: anup.patel@linaro.org X-Msg-Ref: server-9.tower-27.messagelabs.com!1408423742!13231662!1 X-Originating-IP: [209.85.192.176] 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 2893 invoked from network); 19 Aug 2014 04:49:03 -0000 Received: from mail-pd0-f176.google.com (HELO mail-pd0-f176.google.com) (209.85.192.176) by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 19 Aug 2014 04:49:03 -0000 Received: by mail-pd0-f176.google.com with SMTP id y10so8720776pdj.35 for ; Mon, 18 Aug 2014 21:48:59 -0700 (PDT) X-Received: by 10.70.134.140 with SMTP id pk12mr10153228pdb.165.1408423737108; Mon, 18 Aug 2014 21:48:57 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id u2sm17803608pbs.42.2014.08.18.21.48.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 21:48:56 -0700 (PDT) From: Anup Patel To: xen-devel@lists.xen.org Date: Tue, 19 Aug 2014 10:18:24 +0530 Message-Id: <1408423704-15059-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] xen/arm: 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. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar Acked-by: Julien Grall --- xen/arch/arm/smp.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c index 30203b8..c80c068 100644 --- a/xen/arch/arm/smp.c +++ b/xen/arch/arm/smp.c @@ -19,7 +19,19 @@ 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())); + + if ( cpumask_weight(&target_mask) ) + 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(); + } } /*