Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3684687imb; Tue, 5 Mar 2019 16:31:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwnCkIuYXm87HLE1uihJiy+Xmq99mLsUlO3GX7Wy2OkkJkmLVXVC/TJ9xduK+up6p/t/uvU X-Received: by 2002:a63:1947:: with SMTP id 7mr3768140pgz.279.1551832272033; Tue, 05 Mar 2019 16:31:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551832272; cv=none; d=google.com; s=arc-20160816; b=cUJtljw3mjUkbxydAZlQSVC6eHnQRaNAdLvqNRHGA89BRgXN88rVLlOS739H1xACXX 9Pahbm9ftFGuAJO9L60o5nfoTEUXDR4vmrZUJssYWS9XpRiDtfv3gHu2uHp46iS2MQzH uPrDCuhixTvZq0OebH2+aHl85z5RI3NYmUPzX3rJCMlhoJuSO/zWHqS1OeeZbZGaDVQp YhcTi31IjvrOBYjDL1EkFIOkyAlMZE1z3AHbpDM0oLj/LXYPF+KkmcAHoVVYr8xuBV4O savjCUvoGPbADZmw61D1BVMErbP/X9afU2l4VN0s7IpAk7se8GSfk6bu9n9D5QecAigE gwFw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dK8eTrfwhUiqyNU2OWyJQE7/Z/nj4qXO7NfbL9UdUBs=; b=giojVdOkmIhGlxAXvgtzKwI9nbgMLfl1iCL9SzPABo2YgU7dQa98X/WRmrBi4k4/uk J3/EQdokBuoEKJPST81VNLRpwABIZtA0KqeKSEl9y4Ok3GshixzbZwsjNpiHgIyr0UAR b+3jFkD86jirbcVE2WoHtlFiyVsa+PvjAwIu9B3iYWCx8HGhq3OH5JYA4n+AtIR26i9z U8SleDFkEGXI8A60Ly/EdAv4TT2EplJXzkDYTJ5GhOVKWY3y2gwNG6hUpa3HBQspwHnG 1ZNdmYVjj/XN5qb0yyt9Np3JKnqZ8llok1ZG6WmQM3eINwznVtgCdyLyiztcbgwpZzOM /Yaw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e190si228325pfc.63.2019.03.05.16.30.56; Tue, 05 Mar 2019 16:31:12 -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 S1728108AbfCEXjb (ORCPT + 99 others); Tue, 5 Mar 2019 18:39:31 -0500 Received: from foss.arm.com ([217.140.101.70]:54332 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726256AbfCEXja (ORCPT ); Tue, 5 Mar 2019 18:39:30 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 52BFDA78; Tue, 5 Mar 2019 15:39:30 -0800 (PST) Received: from [192.168.1.123] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EBB1A3F703; Tue, 5 Mar 2019 15:39:21 -0800 (PST) Subject: Re: [PATCH 1/2] ARM: drop unnecessary WASM To: Stefan Agner , linux@armlinux.org.uk 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, thierry.reding@gmail.com, natechancellor@gmail.com, linux-arm-kernel@lists.infradead.org References: <13835555f8ef44b21d1b7ddfe1c4203d0981f77e.1551824161.git.stefan@agner.ch> From: Robin Murphy Message-ID: Date: Tue, 5 Mar 2019 23:39:13 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:60.0) Gecko/20100101 Thunderbird/60.5.2 MIME-Version: 1.0 In-Reply-To: <13835555f8ef44b21d1b7ddfe1c4203d0981f77e.1551824161.git.stefan@agner.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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)); > } >