Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4237445imj; Tue, 12 Feb 2019 12:12:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IZPnZLvaY+LEeyeyZYZ5p3NxpctxKJr+IKiJghqpKuiWklhcOq0JFyfoqhVKvJy4Eybb0fj X-Received: by 2002:a63:3206:: with SMTP id y6mr5140278pgy.338.1550002369552; Tue, 12 Feb 2019 12:12:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550002369; cv=none; d=google.com; s=arc-20160816; b=QUSEbya+7ZCHpnN6i2m1U/3aQTThD9Vr3KTFkvi4UsNhjk9y9WYj0Kuagr5UUMp7k6 ZdURoIq1BKR/DaB9avX2UiVxoCD2ojpj6LIHmv0V+4FMoxv2jotWnYKJuIY+goLrqWoG HsIQsq+Jxgnpjuq25k749NgaR8JvU11dGxR04g5gpaJ5FXhwQJUG3pjBbh6qMvB+KVE1 jVb72/P22v1utUi4hIrk23Xs7Ptnn48fSnehoFzpDK/COYdPzTnqAnU7zOqiAXq2x74x p3JN56fqQ4xac/rPHbSbLjFkP5kvdvdIcDSE2UbTD3u4Tikck5ajmwV4YHOT+HgRI0Sk 1Jsw== 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=Bun+cvAdHIasxPqS/vNFHAp3EC4NvD/DWIC9oBLQ0+E=; b=C5ksCFgZIiqfj0pFCET4flt0yHa8HDO1jLr3AY2EdBvhqH2/liuYscYC7JkgnAwNHS l9sih0Hc5wtPuU7xPGybutqCtqJQMxDeNuUDu3HKfuL3MlkgEe4kHBUmwDeZvdPw3hLO TT48x9k+bqmLBt8d+c6sUUsXMOzpgVrwrPcMz6aqhVd8k0tW3MSsK7pkk/bw9PfJS8AH oz5vmYwuaORmQi0Fuxbkg/NljQW304Us+r1ZAfpQI0RPgcNOrhX3CCzpqV5opKJo++Ko lTQ+aCQjnQ5Kta7mkoH045Im6Xxqh4Ug7AcjO/bhOrQG02WxKYwCus/4iwKW7hwmhXkE KqcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=hME3mkaz; 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 b74si13439989pfe.47.2019.02.12.12.12.32; Tue, 12 Feb 2019 12:12:49 -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=hME3mkaz; 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 S1732395AbfBLUCZ (ORCPT + 99 others); Tue, 12 Feb 2019 15:02:25 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:43802 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730937AbfBLUB7 (ORCPT ); Tue, 12 Feb 2019 15:01:59 -0500 Received: from zyt.lan (unknown [IPv6:2a02:169:34b6::564]) by mail.kmu-office.ch (Postfix) with ESMTPSA id F340E5C0E10; Tue, 12 Feb 2019 21:01:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1550001718; 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=Bun+cvAdHIasxPqS/vNFHAp3EC4NvD/DWIC9oBLQ0+E=; b=hME3mkazxA/uN2rYhG6PjJfFHgpovUyK2UqrrxrEZ+CKhap4wiXYyE2SrMD5kp7qtSHpW5 VRuXPcsUg4FrnolQWFcpWT06Pikhi/BeppsKBjPfPHFC9F4jBbJ3YT63dxzuxmuXhexd4z 4xik/Z/5bZW3igCUOeJUEXju9IQiZY4= 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 , Nicolas Pitre Subject: [PATCH v3 4/5] ARM: use unified assembler in c files Date: Tue, 12 Feb 2019 21:02:00 +0100 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: 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 Use unified assembler syntax (UAL) in inline assembler. Divided syntax is considered deprecated. This will also allow to build the kernel using LLVM's integrated assembler. 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 Acked-by: Nicolas Pitre --- Changes in v2: - Force unified syntax for inline assembler using .syntax unified Changes in v3: - Describe reason for adding ".syntax unified" arch/arm/mm/copypage-v4mc.c | 3 ++- arch/arm/mm/copypage-v4wb.c | 3 ++- arch/arm/mm/copypage-v4wt.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c index b03202cddddb..f74cdce6d4da 100644 --- a/arch/arm/mm/copypage-v4mc.c +++ b/arch/arm/mm/copypage-v4mc.c @@ -45,6 +45,7 @@ static void mc_copy_user_page(void *from, void *to) int tmp; asm volatile ("\ + .syntax unified\n\ ldmia %0!, {r2, r3, ip, lr} @ 4\n\ 1: mcr p15, 0, %1, c7, c6, 1 @ 1 invalidate D line\n\ stmia %1!, {r2, r3, ip, lr} @ 4\n\ @@ -56,7 +57,7 @@ static void mc_copy_user_page(void *from, void *to) ldmia %0!, {r2, r3, ip, lr} @ 4\n\ subs %2, %2, #1 @ 1\n\ stmia %1!, {r2, r3, ip, lr} @ 4\n\ - ldmneia %0!, {r2, r3, ip, lr} @ 4\n\ + ldmiane %0!, {r2, r3, ip, lr} @ 4\n\ bne 1b @ " : "+&r" (from), "+&r" (to), "=&r" (tmp) : "2" (PAGE_SIZE / 64) diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c index cd3e165afeed..6d336740aae4 100644 --- a/arch/arm/mm/copypage-v4wb.c +++ b/arch/arm/mm/copypage-v4wb.c @@ -27,6 +27,7 @@ static void v4wb_copy_user_page(void *kto, const void *kfrom) int tmp; asm volatile ("\ + .syntax unified\n\ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ 1: mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\ stmia %0!, {r3, r4, ip, lr} @ 4\n\ @@ -38,7 +39,7 @@ static void v4wb_copy_user_page(void *kto, const void *kfrom) ldmia %1!, {r3, r4, ip, lr} @ 4\n\ subs %2, %2, #1 @ 1\n\ stmia %0!, {r3, r4, ip, lr} @ 4\n\ - ldmneia %1!, {r3, r4, ip, lr} @ 4\n\ + ldmiane %1!, {r3, r4, ip, lr} @ 4\n\ bne 1b @ 1\n\ mcr p15, 0, %1, c7, c10, 4 @ 1 drain WB" : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp) diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c index 8614572e1296..3851bb396442 100644 --- a/arch/arm/mm/copypage-v4wt.c +++ b/arch/arm/mm/copypage-v4wt.c @@ -25,6 +25,7 @@ static void v4wt_copy_user_page(void *kto, const void *kfrom) int tmp; asm volatile ("\ + .syntax unified\n\ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ 1: stmia %0!, {r3, r4, ip, lr} @ 4\n\ ldmia %1!, {r3, r4, ip, lr} @ 4+1\n\ @@ -34,7 +35,7 @@ static void v4wt_copy_user_page(void *kto, const void *kfrom) ldmia %1!, {r3, r4, ip, lr} @ 4\n\ subs %2, %2, #1 @ 1\n\ stmia %0!, {r3, r4, ip, lr} @ 4\n\ - ldmneia %1!, {r3, r4, ip, lr} @ 4\n\ + ldmiane %1!, {r3, r4, ip, lr} @ 4\n\ bne 1b @ 1\n\ mcr p15, 0, %2, c7, c7, 0 @ flush ID cache" : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp) -- 2.20.1