From patchwork Mon Mar 17 13:52:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 26359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 13AA7202FA for ; Mon, 17 Mar 2014 13:53:37 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf13074930qgd.1 for ; Mon, 17 Mar 2014 06:53:36 -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:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=g+5tVzyxgk7sNla62zT+SZL/DpIkBbBWItV1PvxyV70=; b=RFNXoKSTCxal+HXDggLrgW3DFGhDz6q5Siv2YPhXLjt5wMPr9IkyM/Dx5lKwcxscGh fpIvterxs4HeujIh0tJzK6p/w4CXigB6oeVi6K4HMAXenWi84Z9iax4nzmsHKvtoGdvp 1OOYsXcaWSjdruOfiLIodXTDv9jh+NlYZVXbbKHzqiuFZZJPQ0FEWJRqzS7GodUaVfZ0 JtnWgi4PN1rroKSGq3WFCEu7c3IaEyrog7vsKSqPA5vUzXtG9IoRMNmCxjOqg7D6i2ue /4wtMW9U46YJxSnzXNiuNoxkMytR4JU6c8IEBkAGMO70KBBuxCB4uZn7SA+QkWNntVzA YkuA== X-Gm-Message-State: ALoCoQnNa3DVSE36TfyF3tb+PbWyiuKBjltRdHsPuqc5anv8rZUNtz97rVY19uxX5MombAP7KLAh X-Received: by 10.236.4.101 with SMTP id 65mr259499yhi.57.1395064416799; Mon, 17 Mar 2014 06:53:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.169 with SMTP id j38ls1652481qgd.10.gmail; Mon, 17 Mar 2014 06:53:36 -0700 (PDT) X-Received: by 10.58.200.168 with SMTP id jt8mr711069vec.30.1395064416514; Mon, 17 Mar 2014 06:53:36 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id u5si1761245vdo.148.2014.03.17.06.53.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 06:53:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lg15so5774280vcb.16 for ; Mon, 17 Mar 2014 06:53:36 -0700 (PDT) X-Received: by 10.221.61.210 with SMTP id wx18mr982538vcb.27.1395064416436; Mon, 17 Mar 2014 06:53:36 -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.220.78.9 with SMTP id i9csp129136vck; Mon, 17 Mar 2014 06:53:36 -0700 (PDT) X-Received: by 10.52.157.8 with SMTP id wi8mr43029vdb.46.1395064416113; Mon, 17 Mar 2014 06:53:36 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id sv2si4616600vdc.3.2014.03.17.06.53.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 06:53:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) 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 1WPXy2-00013p-HQ; Mon, 17 Mar 2014 13:52:38 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPXy0-000128-Am for xen-devel@lists.xen.org; Mon, 17 Mar 2014 13:52:36 +0000 Received: from [85.158.137.68:64743] by server-16.bemta-3.messagelabs.com id C3/F7-13481-32EF6235; Mon, 17 Mar 2014 13:52:35 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1395064353!1031400!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12701 invoked from network); 17 Mar 2014 13:52:34 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 17 Mar 2014 13:52:34 -0000 X-IronPort-AV: E=Sophos;i="4.97,670,1389744000"; d="scan'208";a="110706446" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 17 Mar 2014 13:52:33 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Mon, 17 Mar 2014 09:52:32 -0400 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WPXxw-0000jH-Bb; Mon, 17 Mar 2014 13:52:32 +0000 From: Ian Campbell To: Date: Mon, 17 Mar 2014 13:52:32 +0000 Message-ID: <1395064352-2128-4-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395064315.18221.26.camel@kazak.uk.xensource.com> References: <1395064315.18221.26.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 4/4] xen: arm32: don't force the compiler to allocate a dummy register 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: , 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: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: TLBIALLH, ICIALLU and BPIALL make no use of their register argument. Instead of making the compiler allocate a dummy register just hardcode r0, there is no need to represent this in the inline asm since the register is neither clobbered nor used in any way. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/include/asm-arm/arm32/page.h | 14 ++++++-------- xen/include/asm-arm/arm32/processor.h | 4 ++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h index 27027d8..beebe8b 100644 --- a/xen/include/asm-arm/arm32/page.h +++ b/xen/include/asm-arm/arm32/page.h @@ -37,15 +37,14 @@ static inline void write_pte(lpae_t *p, lpae_t pte) */ static inline void flush_xen_text_tlb_local(void) { - register unsigned long r0 asm ("r0"); asm volatile ( "isb;" /* Ensure synchronization with previous changes to text */ - STORE_CP32(0, TLBIALLH) /* Flush hypervisor TLB */ - STORE_CP32(0, ICIALLU) /* Flush I-cache */ - STORE_CP32(0, BPIALL) /* Flush branch predictor */ + CMD_CP32(TLBIALLH) /* Flush hypervisor TLB */ + CMD_CP32(ICIALLU) /* Flush I-cache */ + CMD_CP32(BPIALL) /* Flush branch predictor */ "dsb;" /* Ensure completion of TLB+BP flush */ "isb;" - : : "r" (r0) /*dummy*/ : "memory"); + : : : "memory"); } /* @@ -55,12 +54,11 @@ static inline void flush_xen_text_tlb_local(void) */ static inline void flush_xen_data_tlb_local(void) { - register unsigned long r0 asm ("r0"); asm volatile("dsb;" /* Ensure preceding are visible */ - STORE_CP32(0, TLBIALLH) + CMD_CP32(TLBIALLH) "dsb;" /* Ensure completion of the TLB flush */ "isb;" - : : "r" (r0) /* dummy */: "memory"); + : : : "memory"); } /* diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h index 8a35cee..f41644d 100644 --- a/xen/include/asm-arm/arm32/processor.h +++ b/xen/include/asm-arm/arm32/processor.h @@ -69,6 +69,10 @@ struct cpu_user_regs #define LOAD_CP64(r, name...) "mrrc " __stringify(CP64(%r, %H##r, name)) ";" #define STORE_CP64(r, name...) "mcrr " __stringify(CP64(%r, %H##r, name)) ";" +/* Issue a CP operation which takes no argument, + * uses r0 as a placeholder register. */ +#define CMD_CP32(name...) "mcr " __stringify(CP32(r0, name)) ";" + #ifndef __ASSEMBLY__ /* C wrappers */