From patchwork Wed Jan 28 21:30:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 43890 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A934223FFF for ; Wed, 28 Jan 2015 21:32:09 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id f15sf13000672lbj.2 for ; Wed, 28 Jan 2015 13:32:08 -0800 (PST) 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:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=kk38HjDWUYCW7KBTkZH1zrImEpvsOh4IBnKWFjel0/I=; b=Go1oEGO2xqkrLZYE/QJDwvtto7VOdVPl3zsIJboNU7v1OYvBdXwIBzFag5FYG+5X1E eNOzgV2ylPYde3cnocYjVqI8qcUuAFks4okHsB8Pbhz1sBf/xb9j/f+ZArdNq/QReUvy etgdGxUAjXfcHaKJtIk/HfYj1Pc5GNfG5ARYaGf5Q5Lq1VRbya528mGWXfvDRyrC1aIE nkAOi59xLPaAL5hG2rHGy4apY8F3niPJeWIuwVhMv40HFDRoIVWQZtZf4pUK++U71Cli 9AJx7CAO19G2a32rryHARjv8D0lf0e5KqR3qPKZ9CS5UJAPphAW4AAkMDAUCeIJ5SIb+ lGqw== X-Gm-Message-State: ALoCoQmf7iNPwk9BFmygkkp+RS8XyrceNqWYNggUSl9tjF9X8VSzSah1ah20ySut8Rinp9gLKLJ3 X-Received: by 10.152.37.71 with SMTP id w7mr694237laj.5.1422480728659; Wed, 28 Jan 2015 13:32:08 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.99 with SMTP id s3ls251011lag.79.gmail; Wed, 28 Jan 2015 13:32:08 -0800 (PST) X-Received: by 10.112.183.197 with SMTP id eo5mr10762275lbc.81.1422480728440; Wed, 28 Jan 2015 13:32:08 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id t1si5642783laz.36.2015.01.28.13.32.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Jan 2015 13:32:08 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id f15so21707698lbj.0 for ; Wed, 28 Jan 2015 13:32:08 -0800 (PST) X-Received: by 10.112.90.170 with SMTP id bx10mr10823321lbb.69.1422480728283; Wed, 28 Jan 2015 13:32:08 -0800 (PST) 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.112.35.133 with SMTP id h5csp1569625lbj; Wed, 28 Jan 2015 13:32:07 -0800 (PST) X-Received: by 10.68.242.8 with SMTP id wm8mr9284040pbc.32.1422480725801; Wed, 28 Jan 2015 13:32:05 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ot2si7361249pbb.53.2015.01.28.13.32.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jan 2015 13:32:05 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGaCD-0001rY-PJ; Wed, 28 Jan 2015 21:30:45 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGaCB-0001kU-Hk for linux-arm-kernel@lists.infradead.org; Wed, 28 Jan 2015 21:30:44 +0000 Received: by mail-wi0-f177.google.com with SMTP id r20so15819403wiv.4 for ; Wed, 28 Jan 2015 13:30:25 -0800 (PST) X-Received: by 10.180.39.175 with SMTP id q15mr11440498wik.50.1422480625471; Wed, 28 Jan 2015 13:30:25 -0800 (PST) Received: from ards-macbook-pro.local ([197.129.10.112]) by mx.google.com with ESMTPSA id ud4sm4463502wib.0.2015.01.28.13.30.23 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Jan 2015 13:30:24 -0800 (PST) From: Ard Biesheuvel To: elder@linaro.org, behanw@converseincode.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: teach __asmeq that r12 and ip are the same register Date: Wed, 28 Jan 2015 21:30:18 +0000 Message-Id: <1422480618-25371-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150128_133043_737690_D752154B X-CRM114-Status: GOOD ( 10.01 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.177 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ard Biesheuvel , will.deacon@arm.com, nico@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@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.217.169 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 The __asmeq macro is used inside inline asm statements to ensure that register asm variables that explicitly specify a register are mapped correctly onto those registers when used in inline asm input and output constraints. However, the string based matching fails to take into account that 'ip' may also be referred to as 'r12', (e.g., by clang), causing false negatives. Fix this by making __asmeq consider the ("ip","r12") and ("r12","ip") cases specifically. Signed-off-by: Ard Biesheuvel --- Even though clang shouldn't be susceptible to the same bug, there is still value in retaining these assertions there, so instead of just turning __asmeq into a nop if __clang__ is defined, let's make it work correctly. arch/arm/include/asm/compiler.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/compiler.h b/arch/arm/include/asm/compiler.h index 8155db2f7fa1..c3a316a59710 100644 --- a/arch/arm/include/asm/compiler.h +++ b/arch/arm/include/asm/compiler.h @@ -8,8 +8,11 @@ * This string is meant to be concatenated with the inline asm string and * will cause compilation to stop on mismatch. * (for details, see gcc PR 15089) + * For compatibility with clang, we have to explicitly take the equivalence + * of 'r12' and 'ip into account as well. */ -#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t" +#define __asmeq(x, y) ".ifnc " x "," y " ; .ifnc " x y ",ipr12 ; " \ + ".ifnc " x y ",r12ip ; .err ; .endif ; .endif ; .endif\n\t" #endif /* __ASM_ARM_COMPILER_H */