From patchwork Thu Apr 3 08:59:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27666 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-bk0-f69.google.com (mail-bk0-f69.google.com [209.85.214.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4662620490 for ; Thu, 3 Apr 2014 09:01:47 +0000 (UTC) Received: by mail-bk0-f69.google.com with SMTP id mx12sf1401825bkb.4 for ; Thu, 03 Apr 2014 02:01:46 -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=Xg55+S3CrgOXQM2M4+HK+IsEkanSOznscXhA6a0Ku1w=; b=A/gw22qYnDzh0ozwHrpDvb9EVy9Zu4etwV7bxuzvaaK9+UZD8kzVUL3BOIiazc3XGY clptlhML7mJRUWQhBz1cwv4xZw3ZzRCpTDV5TBckLcJU/3fpPzmHXtOrzx4XHP+gnPME m4ZNtLwKauNCzCxAX7LFHyKgbzEL0+l+R1MdG2Cwe+ULxt6sWP8JOhnGwFgkBZ0c+iFq LHaUsICKzKcd4g8i3vyYkUfJj9c5wQ4PM6VNJwfnA7zMmq9CHLKN8vFJ7B5jgdt90aEX Zgi5+HD5w4s4v+kklW4jUrgbiU/kUeU1uOGXh6jNLrdTndrxbsFUd976YhUVjtj2HlBj 5uMA== X-Gm-Message-State: ALoCoQnOrRwVOtqF0EAfb/dmY6crOdudj3DU6xXGWTJ8D7rxpgnafRuLLqRUSCUPgboM3QrjJsZv X-Received: by 10.205.32.197 with SMTP id sl5mr65214bkb.8.1396515706113; Thu, 03 Apr 2014 02:01:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.33 with SMTP id c30ls616870qge.9.gmail; Thu, 03 Apr 2014 02:01:46 -0700 (PDT) X-Received: by 10.52.128.231 with SMTP id nr7mr5598585vdb.17.1396515705914; Thu, 03 Apr 2014 02:01:45 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id tm8si1130959vdc.170.2014.04.03.02.01.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 02:01:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id if17so1721582vcb.36 for ; Thu, 03 Apr 2014 02:01:45 -0700 (PDT) X-Received: by 10.220.237.146 with SMTP id ko18mr327865vcb.49.1396515705839; Thu, 03 Apr 2014 02:01:45 -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.12.8 with SMTP id v8csp11200vcv; Thu, 3 Apr 2014 02:01:44 -0700 (PDT) X-Received: by 10.220.159.4 with SMTP id h4mr1942709vcx.1.1396515702674; Thu, 03 Apr 2014 02:01:42 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id fc7si1145365vcb.24.2014.04.03.02.01.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 02:01:42 -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 1WVdV3-000593-9X; Thu, 03 Apr 2014 08:59:53 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVdV1-000578-HU for xen-devel@lists.xen.org; Thu, 03 Apr 2014 08:59:51 +0000 Received: from [85.158.143.35:42526] by server-1.bemta-4.messagelabs.com id 70/1F-09853-6032D335; Thu, 03 Apr 2014 08:59:50 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1396515589!6655328!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 3746 invoked from network); 3 Apr 2014 08:59:50 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 3 Apr 2014 08:59:50 -0000 X-IronPort-AV: E=Sophos;i="4.97,785,1389744000"; d="scan'208";a="116372302" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 03 Apr 2014 08:59:49 +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; Thu, 3 Apr 2014 04:59:46 -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 1WVdUw-0001BA-AX; Thu, 03 Apr 2014 08:59:46 +0000 From: Ian Campbell To: Date: Thu, 3 Apr 2014 09:59:43 +0100 Message-ID: <1396515585-5737-4-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396515560.4211.33.camel@kazak.uk.xensource.com> References: <1396515560.4211.33.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 v4 4/6] 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.177 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 ead6b97..3f2bdc9 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"); } /* Flush TLB of local processor for address va. */ 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 */