From patchwork Mon Feb 8 14:25:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102831 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1469892lbl; Mon, 8 Feb 2016 06:28:04 -0800 (PST) X-Received: by 10.98.42.10 with SMTP id q10mr42653276pfq.73.1454941684810; Mon, 08 Feb 2016 06:28:04 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id eg4si46934894pac.40.2016.02.08.06.28.04; Mon, 08 Feb 2016 06:28:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375AbcBHO15 (ORCPT + 30 others); Mon, 8 Feb 2016 09:27:57 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:54809 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653AbcBHO1x (ORCPT ); Mon, 8 Feb 2016 09:27:53 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0M4VfU-1a5dhE0ec8-00yfNu; Mon, 08 Feb 2016 15:27:28 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ARM: kprobes: use "I" constraint for inline assembly offsets Date: Mon, 8 Feb 2016 15:25:58 +0100 Message-Id: <1454941613-2775081-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454941613-2775081-1-git-send-email-arnd@arndb.de> References: <1454941613-2775081-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:7HY6f6aOuoh/Q55AQUHikvL6Z/MPLNLFogtydXNmpdb24bXj3x9 kcwpi3UcLXqzIG4/yTXXaDrHmcVDFDSmL2zzC4iDYG8yYCecRO4Yq1AtDFXhbKIaibiZvi/ pjp8/S13zcSI7z4ZQ0BkGKzs05b1IYH6W/p9QGn7/QBV8kHOw5bsZRzRyzrwJlSrbyaZXvx npoUd7WhPHut6UXflkF/w== X-UI-Out-Filterresults: notjunk:1; V01:K0:W6Dv3+ejjgM=:7ryqDpSpSbxltznPdQTcsF q5o580gKxpMRq5tatu8088ppDsoERiB7S/hEJezEkl/H2RUChBmsK84S4RQU0jpLM1WTyz27v UdtYLtUhswUHq/blNXGkVMHz8gCGLbOPwRSRtIx03l6JDLwICJSPni74icFrqzP6mlquWWvun vWxX3ai2q1dlxWAtmVGe8z7I12e1uKE3hiM61TK5pv3LyR880opC4IdNabc7CyBxgLo0KYTDD pLiwuM8GncL1/C9QQdtmZsRnxvdavKA7/BFcQ7A8rOaGa8R2aqf0PearOWtbwoj2TCiVqYXgB CHvNvpzM0OSzho+ekTVI99aSsFqDaM8hMCAcKrjot+DDX6a7iuGTEgte014Yol7h94N1MsR1K dz86KrTZrDRphuXc2WyjSODRUTeWX0/EATQ1ulP6h6zrD0phEqEwpWzDlYr2F9Shiy+j397C4 +RU+Zsz5AjXH8NSJXolXv1M+yqGVv3duzGsU0Kw6FkoASrulvEfpyPHRC3Q/OS/EF5kzVFCVJ cF2O/NxA3YyN2bBNrYeE6az24hs86TzcexhvMrIkr9j6D9WzmQ55qEkvFwM/Xy/NbeNG45KAd HE/aOqXD2o0QKL3t6f2ZbFBOmVrQB5CtvrVKx45fa32NRyCQHHhb1C+93kmursYjdxWdbKOkt xLc2p7ClQmxMrgLGZXmV6LY1nWyLg0Ph6HdAa1RxSGKU2HzKi2GvTvY9RmKIV7O7odFA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org build-testing with clang showed that the "J" constraint does not take positive arguments on clang when building in for Thumb-2: core.c:540:3: error: invalid operand for inline asm constraint 'J' This has been reported as llvm bug https://llvm.org/bugs/show_bug.cgi?id=26061 However, looking at the source code in depth, I found that the kernel is also wrong, and it should not use "J" at all, but should use "I" to pass an immediate argument to the inline assembly when that is used as an offset to an 'ldr' instruction rather than the 'sub' argument. Signed-off-by: Arnd Bergmann --- arch/arm/probes/kprobes/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/arch/arm/probes/kprobes/core.c b/arch/arm/probes/kprobes/core.c index a4ec240ee7ba..4b34b40ca917 100644 --- a/arch/arm/probes/kprobes/core.c +++ b/arch/arm/probes/kprobes/core.c @@ -570,10 +570,10 @@ void __kprobes jprobe_return(void) : : "r" (kcb->jprobe_saved_regs.ARM_sp), "I" (sizeof(struct pt_regs) * 2), - "J" (offsetof(struct pt_regs, ARM_sp)), - "J" (offsetof(struct pt_regs, ARM_pc)), - "J" (offsetof(struct pt_regs, ARM_cpsr)), - "J" (offsetof(struct pt_regs, ARM_lr)) + "I" (offsetof(struct pt_regs, ARM_sp)), + "I" (offsetof(struct pt_regs, ARM_pc)), + "I" (offsetof(struct pt_regs, ARM_cpsr)), + "I" (offsetof(struct pt_regs, ARM_lr)) : "memory", "cc"); }