From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A52D2C433DF for ; Thu, 6 Aug 2020 11:32:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3868722D04 for ; Thu, 6 Aug 2020 11:32:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qMJNFkdf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3868722D04 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Do2HtLitSwcu1BmH9SDDjF9wwA/ENCz8vsuUR2vxaO4=; b=qMJNFkdfPFT3nIGF9tx8NcE68 UJawl/BnIbMqlFrEWmJSGxFbN90bQ0G6Jhm9rIT+Sr3EUM7xqK8AeKACO6UWui4TiTaxzcEiAn08k dQF2fdSns/k9ft6uQyhHbuTvmoV11Uy8ptB7exfmGswDo0Rz8sJ8PIiCJGAihUeG5TyUphvBFf0pg OCmJNRoGQvYfXlbeedYqVbeduvW1qUp9GtlZBG4maF60aW+ZtUyBcUg5cRUARGasBlpqGvB2dj8Tg fIAnylvfwoBA8GPS4HCfOO9WoU9sZ+3YSWz3ZWCw/qAXePL/GRO/CQmG+HIeDjD6Hfm6bC8eDOgGm 7ZxbIU3CQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3e6x-00063w-0l; Thu, 06 Aug 2020 11:31:03 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3e6t-000638-WE for linux-arm-kernel@lists.infradead.org; Thu, 06 Aug 2020 11:31:00 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200806_073100_099610_C6B97B80 X-CRM114-Status: GOOD ( 21.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kees Cook , Zhenyu Ye , Marc Zyngier , LKML , clang-built-linux , Sami Tolvanen , Nathan Chancellor , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel