From patchwork Sat Mar 2 23:08:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 10836789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 232B81390 for ; Sat, 2 Mar 2019 23:08:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BF5D2A604 for ; Sat, 2 Mar 2019 23:08:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F38A22A76E; Sat, 2 Mar 2019 23:07:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B31F2A604 for ; Sat, 2 Mar 2019 23:07:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gd2J0ONXzruaE6NCrApNqYOC5kG0eXWzoZd5by7+quo=; b=rQcYOyfIH/lqKU QA5EWN5WCj1BS31e93bJL+qMPoT6TVuyFRhcvwktMJjuV+0wJ77UJ/BDl+i87lPDM7rteGgQs80en 6Ita/bm96RYcFNXkaK/JWHWOL2z71c/qbuJ9Je+4TzOQWIbCWo+RW/H81H1/cjBoGMmIi6KKB/l7g 0vM/yLvsHesQ6jvoHZMQ5wWbd3YfxQ1j7CUNPZ5J+A4yVGKRHKFZCOZqEVNvNCieHdVZk76Hi1Lk/ vIeS8duwHe40zL3B1r4rKq6I9RxQMm77/3lLAOHzsxTzzG8A1/xxEar8VSGomJ89YWVXq+8ALLomj 9v7Q1cTOc9mQRC0NXbIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0DjX-00040B-Mo; Sat, 02 Mar 2019 23:07:55 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0DjN-0003sQ-DN for linux-arm-kernel@lists.infradead.org; Sat, 02 Mar 2019 23:07:47 +0000 Received: from zyt.lan (unknown [IPv6:2a02:169:3465:0:5054:ff:fe4f:85bd]) by mail.kmu-office.ch (Postfix) with ESMTPSA id E5CA95C23AE; Sun, 3 Mar 2019 00:07:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1551568057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CXhK/FBjan7/N7CuPcIKHePaIsXcmL2rMJadcisJ42g=; b=FbW1sLSUZGB/5mcjEJfKLD7zYpxDuuVZ4e+4JuvLMitiiIh/1sba4g7fwe3of70c+PsKeN TGR9JaWyZSezbHQR/hivsxJ7ZwAWpGsxFtCPLHlZ1OcqMld7g5YWI/oy9NaRKjmw6F2l2R y+Pb4m7e0Ms9JdrjLh4Hx54OcsYD7wg= From: Stefan Agner To: linux@armlinux.org.uk Subject: [PATCH 2/2] ARM: uaccess: use unified assembler language syntax Date: Sun, 3 Mar 2019 00:08:19 +0100 Message-Id: <9a4f9da0615ec658512dd334d931b5acd947ac5d.1551567941.git.stefan@agner.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <1ed0a317c3e9ae1cdd1b05fad5e1bd13a58a9036.1551567941.git.stefan@agner.ch> References: <1ed0a317c3e9ae1cdd1b05fad5e1bd13a58a9036.1551567941.git.stefan@agner.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190302_150745_605643_B51FB7E0 X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas.pitre@linaro.org, mark.rutland@arm.com, arnd@arndb.de, ard.biesheuvel@linaro.org, will.deacon@arm.com, julien.thierry@arm.com, ndesaulniers@google.com, linux-kernel@vger.kernel.org, Stefan Agner , thierry.reding@gmail.com, natechancellor@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Convert the conditional infix to a postfix to make sure this inline assembly is unified syntax. Since gcc assumes non-unified syntax when emitting ARM instructions, make sure to define the syntax as unified. This allows to use LLVM's integrated assembler. Additionally, for GCC ".syntax unified" for inline assembly. When compiling non-Thumb2 GCC always emits a ".syntax divided" at the beginning of the inline assembly which makes the assembler fail. Since GCC 5 there is the -masm-syntax-unified GCC option which make GCC assume unified syntax asm and hence emits ".syntax unified" even in ARM mode. However, the option is broken since GCC version 6 (see GCC PR88648 [1]). Work around by adding ".syntax unified" as part of the inline assembly. [0] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-masm-syntax-unified [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88648 Signed-off-by: Stefan Agner --- I missed this instance in my previous commits and realized only after running some randconfig. arch/arm/include/asm/uaccess.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 89a28680934b..18303bcc9990 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -113,10 +113,11 @@ static inline void __user *__uaccess_mask_range_ptr(const void __user *ptr, unsigned long tmp; asm volatile( + " .syntax unified\n" " sub %1, %3, #1\n" " subs %1, %1, %0\n" " addhs %1, %1, #1\n" - " subhss %1, %1, %2\n" + " subshs %1, %1, %2\n" " movlo %0, #0\n" : "+r" (safe_ptr), "=&r" (tmp) : "r" (size), "r" (current_thread_info()->addr_limit)