Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1540950pxa; Thu, 6 Aug 2020 09:50:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJZc59Zx8cCmcrzVrV8xE17X6H9rHlwi6V8gTouyWYiY7/+AIj1aGCrhBHpwW+fUh492Eg X-Received: by 2002:a17:906:d92:: with SMTP id m18mr5414250eji.428.1596732636400; Thu, 06 Aug 2020 09:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596732636; cv=none; d=google.com; s=arc-20160816; b=gh0+ojKp8uX5uXIiQqyFVxi76gsaMY90gOIHs6Jn2VkmZvejHObxHMM1l5LZpvuTIA WkEkVtXyayKHRJa10vFHJPuSL/0eC+uZPr+PFefMQV8l7P/D5H+KrddsqXAa/983Gw3S hoH0ubbZSO7xg3g1YoYJ5z+V8pc+nyycO5ObklwqDfHtZC0GCt+R7T34gGj6dK//0B/t U6UlzsspUnh/n6htLORq4k68us4e4YnujBfpnU3kMzy9h8DHnMEv3NuQwhP8MYD4jgQh mnHLqUYoGBL53HoAnDa6BIrVb0B2v10pKb3u93tCe6xh+b2D3Z8SIXjdjC9QU2BgwBlh GM+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=OY1ajl4tZF6UrRyquuuuzd/GOPVA/CIjyFNMnuC/jaI=; b=jrnSv4k4/eXsqRhCdnI4zA4raIAG/K2/WtF2V9M01PWvp5YEl5zWYZtn8Flfnktxlr PPdn2fJ96lSbGdhaklv1VKJ4Vqho1JNEIxUosYYRCQ6kJzd1PJ0j/L6KUAa77QKP8QWF ndq1RO7ognQrjZHywfrAwIzeuEeZ3FoVTjf11CCv523oahE4HCYKzPkkdle/QSwSl4s4 ixdq3yKEiw3Wbbe0pJnTwJ+izitoudpE3/nks7xQbpVsCZ3gYo6Bzlv9neviNscVS/Py WyQsGil0zAjGKY2RVbpqkJq7i+YrFNP6phel8LqKUvln0nL6+ZcRLeI25ZIVCWbogZdP N6xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si3470821edr.589.2020.08.06.09.50.13; Thu, 06 Aug 2020 09:50:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729078AbgHFQsS (ORCPT + 99 others); Thu, 6 Aug 2020 12:48:18 -0400 Received: from foss.arm.com ([217.140.110.172]:45202 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728507AbgHFQmq (ORCPT ); Thu, 6 Aug 2020 12:42:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 515231045; Thu, 6 Aug 2020 04:30:57 -0700 (PDT) Received: from gaia (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CCC7C3F99C; Thu, 6 Aug 2020 04:30:55 -0700 (PDT) Date: Thu, 6 Aug 2020 12:30:53 +0100 From: Catalin Marinas To: Nick Desaulniers Cc: Sami Tolvanen , Will Deacon , Zhenyu Ye , Mark Rutland , Marc Zyngier , Nathan Chancellor , Kees Cook , Linux ARM , LKML , clang-built-linux Subject: Re: [PATCH] arm64: tlb: fix ARM64_TLB_RANGE with LLVM's integrated assembler Message-ID: <20200806113053.GB23785@gaia> References: <20200805181920.4013059-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 05, 2020 at 12:15:54PM -0700, Nick Desaulniers wrote: > On Wed, Aug 5, 2020 at 11:19 AM Sami Tolvanen wrote: > > > > Commit 7c78f67e9bd9 ("arm64: enable tlbi range instructions") breaks > > LLVM's integrated assembler, because -Wa,-march is only passed to > > external assemblers and therefore, the new instructions are not enabled > > when IAS is used. > > > > As binutils doesn't support .arch_extension tlb-rmi, this change adds > > .arch armv8.4-a to __TLBI_0 and __TLBI_1 to fix the issue with both LLVM > > IAS and binutils. > > > > Fixes: 7c78f67e9bd9 ("arm64: enable tlbi range instructions") > > Link: https://github.com/ClangBuiltLinux/linux/issues/1106 > > Signed-off-by: Sami Tolvanen > > I've filed https://sourceware.org/bugzilla/show_bug.cgi?id=26339 to > discuss more with ARM binutils devs about some of the compat issues > around these assembler directives. Until we get some alignment between binutils and the LLVM's integrated assembler, the latter will be officially unsupported by the kernel. It's just insane to maintain different options for architecture extensions, e.g. memtag vs mte, armv8.4-a vs tlb-rmi. Even worse, I think you can't add some .arch_extension in binutils without bumping the .arch version. So maybe ".arch_extension tlb-rmi" works for the integrated assembler but, if such option is added to binutils, it would require ".arch armv8.4-a" as well. So, please sort it out guys, collaborate between yourselves when inventing architecture mnemonics so that you are aligned. We make take the occasional patch to fix the integrated assembler if it's not intrusive but at some point we may say it's just not supported and reject the fix. We have a hard line on the compiler not generating newer than ARMv8.0 instructions (unless they are in the NOP/HINT space), so we limit newer instructions to (inline) asm. That's why -march doesn't work, it needs to be -Wa,-march. -- Catalin