Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1572721pxa; Thu, 6 Aug 2020 10:33:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdRJi3w31GWEiIOuWEuq3IMLbYL7S8DEloxnOwyZxb5vEB7tmjbnHkloZ/0iR3Re87O9gK X-Received: by 2002:a17:906:9399:: with SMTP id l25mr5413405ejx.212.1596735224864; Thu, 06 Aug 2020 10:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596735224; cv=none; d=google.com; s=arc-20160816; b=Ri4zJbLjGeNjBI73DfahycdisHrbEMTQW+5j+4dsX0tEjqtHYLsWiM994V2ACOwOEP 0zyKI2RU1n6A1gjJQSOBsrJMAGfil1xqCuSc+KGOlZN/biPe9PmTfEsz9q4WdaabTDkM Vq8MbD0mYviewbZxO+I11uG85Y9X7GuJ4SbIr2U1xsCUcvphuREHlaZGWjRW1ISOKEh4 qiG18BPm7CG3/ItLxIk230DKf2UYjMv274+NM6BjrNClKmdt4qdYISBlbEhZ3aaVlnLe K5hNrrYBkDrtf1WA88WmhIQE+Tll1wDNqnuwG2YqmbfJmAEMdjT9X+d8KDzO7oc8+/DA uS6A== 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=fgcHoFA4eenY0noPNHFHedel9bw16Lc1ggYvCvVu7sY=; b=JKs5JeO7a6+QMyC414OM/kyYPUCPw0xAN97osj3Jhn36umHz1tGyIDnOOznCkAfc4R dS9sn++p2tyktbCe866Bz/Ob3w6o66jbS6dUM3/M8usfsqtLxKAB06JKpDe72O5pkBP7 Ir828lN/GnYHPfxcuPlFrX3KzNkp65BvqkOtmfAK29dvMEWkNNZIxQWGq58U4Hz/k/2I dybu+JNLLauATfwnv/XFRrRUrku2TiZGnJvcAxI2kXrh2OoZv9aIbMRMCelwqLveG/3a mi338vGQPFp1AVnCeutlqsW4wPGJPowCvA91a2WmvZQth6vBollNaNThIFDCVGdkaaeI Gtyg== 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 z7si4464814ede.225.2020.08.06.10.33.22; Thu, 06 Aug 2020 10:33:44 -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 S1730460AbgHFRc7 (ORCPT + 99 others); Thu, 6 Aug 2020 13:32:59 -0400 Received: from foss.arm.com ([217.140.110.172]:46002 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729889AbgHFRcf (ORCPT ); Thu, 6 Aug 2020 13:32:35 -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 7906D1063; Thu, 6 Aug 2020 04:33:17 -0700 (PDT) Received: from gaia (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE94F3F99C; Thu, 6 Aug 2020 04:33:15 -0700 (PDT) Date: Thu, 6 Aug 2020 12:33:13 +0100 From: Catalin Marinas To: Zhenyu Ye Cc: Sami Tolvanen , Will Deacon , Mark Rutland , Marc Zyngier , Nick Desaulniers , Nathan Chancellor , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] arm64: tlb: fix ARM64_TLB_RANGE with LLVM's integrated assembler Message-ID: <20200806113313.GC23785@gaia> References: <20200805181920.4013059-1-samitolvanen@google.com> <95156879-d76e-65cc-1469-ae3096aa95e4@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95156879-d76e-65cc-1469-ae3096aa95e4@huawei.com> 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 Thu, Aug 06, 2020 at 03:17:40PM +0800, Zhenyu Ye wrote: > On 2020/8/6 2:19, 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. > > I have looked through the discussion on Github issues. The best way to > solve this problem is try to pass the "-Wa,-march" parameter to clang > even when IAS is enabled, which may need the cooperation of compilation > tool chains :( > > Currently, I think we can solve the problem by passing > the '-march=armv8.4-a' when using the integrated assembler, just like: > > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index 55bc8546d9c7..e5ce184e98c2 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -91,8 +91,12 @@ KBUILD_CFLAGS += $(branch-prot-flags-y) > > ifeq ($(CONFIG_AS_HAS_ARMV8_4), y) > # make sure to pass the newest target architecture to -march. > +ifneq ($(LLVM),) > +KBUILD_CFLAGS += -march=armv8.4-a > +else > KBUILD_CFLAGS += -Wa,-march=armv8.4-a > endif > +endif No, see my other reply. This only works for .S files. For inline assembly, passing -march to .c files will make the compiler generate ARMv8.4 instructions and break the kernel single image that's supposed to run on ARMv8.0 hardware (even if you don't have any range TLBI instructions). -- Catalin