Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3951685imb; Wed, 6 Mar 2019 01:24:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzbMy63cBXw9pTgv6muXZyC29YjPxZriCt6AY24RIoNAQmAI8xrnDSa8DBXS8Jc1HxP5mTU X-Received: by 2002:a63:6a48:: with SMTP id f69mr5377166pgc.7.1551864260047; Wed, 06 Mar 2019 01:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551864260; cv=none; d=google.com; s=arc-20160816; b=Lf8MRRUwSBBLG8PdrA5taj8o6rRlhByfYQ3bCcZ9M8kp8BYYRtNi28dApEGc74avKn WwthH1xxUDapMhif2noPR4JDDSqnx1fAFUoXsVIo/sCSgeN4GvyDyFLv660h7RAi4R0D S12L27fci050mFKgXUBPT4OsgKg0zt1bsSsXVQ6/CErjFGNJpRIS/xXVykdP5J9Kq5R5 Ud7DmvIybVUnKaotlTdV0SL22RNFmuHNi5YT0Z+VMOuiuZmLaY96vbha+7H0O6EyO7ED s1Z7abcQ4JGKDKO5/9W0IqOiZOjOLeTWui5IRrI0bon7Zb0suuOo+kaRfSO3qtX/TazX FgVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=j62psRips7w+AV5XkJWTeBZt6Uz5zCpP5GEzVKosuGE=; b=NzPfggiw7jy3UMayeGYZC2Fg5/Dm7LGEGH2OUNsg9IiG9fZZmrgJzqD7Tor8RV1h1k XS47hWQr8zM61sKxlybZvy5r2ORuB76K5aR1IvSI4/t5Fgp6qGZAgPSpyiI+mkX1x3xW iac/QgGkvna70tuuhZ49A9KNbQg12wA0JIShVA9g6WAlEXsuzON+ZxRR/Mu8smfu3PXV iL4VQ8Hn4pkCyjqn1VkS/8Jmx2ELyT08irA2eshJESbKrNColb7VdhpiaosQ7oRv2HXK ak9y845CsEyuVbB6/c90MUkS1kG7XbOw2+yPMVpSjcyYcpBdNfPlpIt9WWotD+ZhevD4 IjIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="fT/td5/5"; 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 n66si1199077pfb.62.2019.03.06.01.23.53; Wed, 06 Mar 2019 01:24:19 -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="fT/td5/5"; 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 S1729548AbfCFH6s (ORCPT + 99 others); Wed, 6 Mar 2019 02:58:48 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:35666 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfCFH6r (ORCPT ); Wed, 6 Mar 2019 02:58:47 -0500 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id CFCCE5C0878; Wed, 6 Mar 2019 08:58:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1551859123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j62psRips7w+AV5XkJWTeBZt6Uz5zCpP5GEzVKosuGE=; b=fT/td5/5Cwpf0st+1O1UdOMaIGjPRdDF6S/ctObGmKvIHA4XW8WWjdxTWtuvQREFHb3Q1w IR9tHxkHeUVrmwp7oHretImEvMuFR+PvYKkM9UwBYSPAK0dRz9FV68v4UssvkUVTORW6Mg SwER9EV3qAeKla9uiGJSUQrKHJRYYRo= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Wed, 06 Mar 2019 08:58:43 +0100 From: Stefan Agner To: Robin Murphy Cc: linux@armlinux.org.uk, 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, thierry.reding@gmail.com, natechancellor@gmail.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/2] ARM: drop unnecessary WASM In-Reply-To: References: <13835555f8ef44b21d1b7ddfe1c4203d0981f77e.1551824161.git.stefan@agner.ch> Message-ID: <1a23b99ac6319815dd23e2df4e4cd064@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.03.2019 00:39, Robin Murphy wrote: > Hi Stefan, > > On 2019-03-05 10:18 pm, Stefan Agner wrote: >> The W macro for generating wide instructions when targeting Thumb-2 >> is not required for the preload data instructions (pld, pldw) since >> they are only available as wide instructions. The GNU assembler seems >> to work with or without the .w appended when compiling an Thumb-2 >> kernel. However, Clang's integrated assembler does not consider the >> .w variants as valid instructions: >> >> ./arch/arm/include/asm/processor.h:133:5: error: invalid instruction >> "pldw.w\t%a0 \n" >> ^ >> :2:1: note: instantiated into assembly here >> pldw.w [r0] >> ^ >> 1 error generated. > > Have you filed a bug against Clang for that? Something like "pldwal.w" > may be super-redundant, but it's still perfectly valid syntax. The > "Standard assembler syntax fields" section of the Arm ARM even calls > out that "...the .W qualifier has no effect" on ARM/A32 instructions > since they are inherently 32-bit; that should equally apply for 32-bit > only Thumb/T32 instructions. There are certainly a few instructions > which don't allow a condition code (even "AL"), but off-hand I don't > remember any not having the optional {} field in their syntax. Good point, bug filed: https://bugs.llvm.org/show_bug.cgi?id=40972 Will send a v2 and note that this is a work around for Clang and reference the bug. -- Stefan > > That said, obviously the patch itself is no problem since the syntax > *is* redundant here, but it really is just a workaround for an > assembler bug. > > Robin. > >> Drop the macro to make sure non-wide variants of pld and pldw are >> emitted in all cases. >> >> Signed-off-by: Stefan Agner >> --- >> arch/arm/include/asm/processor.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h >> index 120f4c9bbfde..042d77cf686d 100644 >> --- a/arch/arm/include/asm/processor.h >> +++ b/arch/arm/include/asm/processor.h >> @@ -131,8 +131,8 @@ static inline void prefetchw(const void *ptr) >> __asm__ __volatile__( >> ".arch_extension mp\n" >> __ALT_SMP_ASM( >> - WASM(pldw) "\t%a0", >> - WASM(pld) "\t%a0" >> + "pldw\t%a0", >> + "pld\t%a0" >> ) >> :: "p" (ptr)); >> } >>