Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp1426620imb; Sat, 2 Mar 2019 15:09:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxi/la3jdUxsLan1mKPz8Tt4fW6OzCYYIdogsBkwXA6iRidwKfWqCLDFTOsSAet9QMVVGHT X-Received: by 2002:a63:ea48:: with SMTP id l8mr11439360pgk.431.1551568198063; Sat, 02 Mar 2019 15:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551568198; cv=none; d=google.com; s=arc-20160816; b=PrM2a0cGre/PWDtlXxbAVoi0rY/SAslzIOa9PXqoC36ZbOM7GdExKPn/dsyPZECfzY 0Mn99cZFnHwRHwPGfeTPNKHEHjHhGzq+7VRWX0/mC9eBUOtno8OChrgIas9P5XTWxFvN ltgeT/XBPLjbVKN+z7qU61FVBphcuhfAKpHyHS/6+JKEc0sKmWkFmtOlW7IyliOIwoBW hxLZeQVrhx0cWwM1qfxzoiBzsZdm5jF3AfLYr7XASSGpWfP1znMsP/ufebjpdHE02JPW 16f9sxVgj72QACrwDNY5AMwtT8V3MjK+8I4ZXzZ8kig4uO94FZRCPkZy5XCgyG0LVr3L n3YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CXhK/FBjan7/N7CuPcIKHePaIsXcmL2rMJadcisJ42g=; b=a78p6Gmg+mn5tvzSVIZ9/njn1xtoAYS3t/VQOsrz7KHpf7RoHK3bDS2DmzkXTPcIly ePgKLsCJMt8vcUBWVTSJOqvT9ifQRkiCGCLlQLYlOiB6TTzG7UI2OEAwFGc0gZW0O6MS eVGmWfI2eWHsW/bcnMSSu5Qi1RUyWuWVSABqZ0hrntxb+LRDD//sHrpnlUKNkqe8ourd geMWlEoHX9JGnTsEPrTcXS1T8nWBI/RF7X00LFzYwazrdcWLJmbmf8BJAAk8AHQAwL20 yWaXQDqZJ3/YYQPuGVV15y4HeyUmFSniNS41uOXP9FA3n/M7JnNHDqbmKwaDH+dcul5+ 2Q1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=FbW1sLSU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g32si1566140pgg.223.2019.03.02.15.09.42; Sat, 02 Mar 2019 15:09:58 -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; dkim=pass header.i=@agner.ch header.s=dkim header.b=FbW1sLSU; 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 S1727047AbfCBXHj (ORCPT + 99 others); Sat, 2 Mar 2019 18:07:39 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:42858 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726592AbfCBXHi (ORCPT ); Sat, 2 Mar 2019 18:07:38 -0500 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 Cc: ndesaulniers@google.com, natechancellor@gmail.com, arnd@arndb.de, ard.biesheuvel@linaro.org, nicolas.pitre@linaro.org, thierry.reding@gmail.com, will.deacon@arm.com, julien.thierry@arm.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Agner 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.20.1