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=-18.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,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 50480C433DF for ; Thu, 6 Aug 2020 12:21:38 +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 1D9BA22D03 for ; Thu, 6 Aug 2020 12:21:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uOLYXbj/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D9BA22D03 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.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:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4mgh+zBjPLNLoaLitvrV0ALVsk4Si/7SxuQPvqag2TY=; b=uOLYXbj/ltJjTAu8N6H8END27 wdMrlqP/bftScd2O33SeosdbrQipEmywV6we4WvKO9ZRcqGVreKE5zHnOqhi5itKZnJFxIMKAJAn2 6yg8CC6MTwxEmbYLne9/mx7sPUggagHL+pPUKYJbIz2Cmi4tyMSvY3GTYbRMFYEVXAesqlxlWJItF h9Q1hPl1il8cxJ20KljlAzdTB5JhiWnEcSu/NpC0ySuUVhmx7zIJbD5AW7vbT5fW3vZgTmz7dzWth Tx1EWRrTc/J1E50cXnkdNxeDkCMZ73ESQoEmQWW5BjC6Jgf/jGUxEaqOOb5J4K2MU5s05mgNxJ7kn yhYg1tRWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3bId-0002Ca-LG; Thu, 06 Aug 2020 08:30:55 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3aB8-0001DH-9n for linux-arm-kernel@lists.infradead.org; Thu, 06 Aug 2020 07:19:08 +0000 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 07FD0DE76A8B34F94D7E; Thu, 6 Aug 2020 15:18:03 +0800 (CST) Received: from [127.0.0.1] (10.174.186.173) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 6 Aug 2020 15:17:59 +0800 Subject: Re: [PATCH] arm64: tlb: fix ARM64_TLB_RANGE with LLVM's integrated assembler To: Sami Tolvanen , Catalin Marinas , Will Deacon References: <20200805181920.4013059-1-samitolvanen@google.com> From: Zhenyu Ye Message-ID: <95156879-d76e-65cc-1469-ae3096aa95e4@huawei.com> Date: Thu, 6 Aug 2020 15:17:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20200805181920.4013059-1-samitolvanen@google.com> X-Originating-IP: [10.174.186.173] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200806_031906_599460_493E2447 X-CRM114-Status: GOOD ( 16.80 ) 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 , Marc Zyngier , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , linux-arm-kernel@lists.infradead.org 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 Hi, 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 ifeq ($(CONFIG_SHADOW_CALL_STACK), y) No need to worry about that this might generate instructions that are not supported on older hardware, because the 'TLB range' feature is only enabled when the hardware support ARMv8.4. > 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 Thanks, Zhenyu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel