Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp242389ybh; Wed, 15 Jul 2020 00:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU1gpREbmtMQX1O7tJyIZhlhx7HnhszMUX3KGh0QPrbUC9GhF23q5EfC8qCkx6iOwbuRud X-Received: by 2002:a17:906:700f:: with SMTP id n15mr8366359ejj.390.1594797702271; Wed, 15 Jul 2020 00:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594797702; cv=none; d=google.com; s=arc-20160816; b=hgyFdTUtPDbTvqtqve/ewby/M2WMUCzNY99bJ7zHbM0dH8pvfMyq7P+73I0ZbkwJEo PGQ7OmNICi5Qr7tyshdjRA+bbntlguMZU+uArOk2cqDBF7SfvIwZu63ckjtVKuLlriue k58nfgkHpfJxu+zt5Aqo5vI/BFYZqlCSSqd7kHTnxI0c00YDmWoR6AQyF9qd6JDgD5bx Gh1J7NuEGRzCzPA+JU8TrqI8bG50rBX3wNQV0JbAKEoEjesDEN86glUABIz4rSZjLZ+7 DXkCSXrQWhZc87wLS1puI7ryyzSN1z9mgSVxxa9jl9MuELrbpe5App91p2It1DUiaG2j 0/qw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZXpHUY4CNLGWzfac/3S7Tv/2fu8ert311LS7xj9sIck=; b=jJySmQcFzZBYDnQbca84MGzO8eOuwV3TlghHnsPE/uhiXixJ3295yozzYYfuLw3WY/ k5hNKsPOBFpUUxz8rK8nfOPcfp7FneR30patBlA1U5ps1197uQbZ0aYvyaUBstF4HNND fJaVnnyC8NpPDRT+iNa8Y1jdDAywLZUsf6LDEPxekrtRUnF+bMvHdL6jdxWeVa2o1fqI SM8XXCNf/oUx7b1Z17oeEbMn1B2H/POt73rkJjTwY5ZGyd1zGmEOfBNEb9b1cz4phRYO 2mkLntT9SnUv51/CpCUg/oLeAuH7r4xEXN80lc+5cDgweVSXCiuKYa8Jz7gTPoM3rz8d 912w== 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 r20si832978eda.19.2020.07.15.00.21.19; Wed, 15 Jul 2020 00:21:42 -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 S1729219AbgGOHUH (ORCPT + 99 others); Wed, 15 Jul 2020 03:20:07 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7753 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728883AbgGOHUF (ORCPT ); Wed, 15 Jul 2020 03:20:05 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 47DBF5D28DC6A2756BB1; Wed, 15 Jul 2020 15:20:01 +0800 (CST) Received: from DESKTOP-KKJBAGG.china.huawei.com (10.174.186.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Wed, 15 Jul 2020 15:19:52 +0800 From: Zhenyu Ye To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v3 2/3] arm64: enable tlbi range instructions Date: Wed, 15 Jul 2020 15:19:44 +0800 Message-ID: <20200715071945.897-3-yezhenyu2@huawei.com> X-Mailer: git-send-email 2.22.0.windows.1 In-Reply-To: <20200715071945.897-1-yezhenyu2@huawei.com> References: <20200715071945.897-1-yezhenyu2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.186.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TLBI RANGE feature instoduces new assembly instructions and only support by binutils >= 2.30. Add necessary Kconfig logic to allow this to be enabled and pass '-march=armv8.4-a' to KBUILD_CFLAGS. Signed-off-by: Zhenyu Ye --- arch/arm64/Kconfig | 14 ++++++++++++++ arch/arm64/Makefile | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 66dc41fd49f2..e385361f8137 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1596,6 +1596,20 @@ config ARM64_AMU_EXTN correctly reflect reality. Most commonly, the value read will be 0, indicating that the counter is not enabled. +config ARM64_TLB_RANGE + bool "Enable support for tlbi range feature" + default y + depends on AS_HAS_ARMV8_4 + help + ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a + range of input addresses. + + The feature introduces new assembly instructions, and they were + support when binutils >= 2.30. + +config AS_HAS_ARMV8_4 + def_bool $(cc-option, -Wa$(comma)-march=armv8.4-a) + endmenu menu "ARMv8.5 architectural features" diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index a0d94d063fa8..4e823b97c92e 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -82,11 +82,18 @@ endif # compiler to generate them and consequently to break the single image contract # we pass it only to the assembler. This option is utilized only in case of non # integrated assemblers. +ifneq ($(CONFIG_AS_HAS_ARMV8_4), y) branch-prot-flags-$(CONFIG_AS_HAS_PAC) += -Wa,-march=armv8.3-a endif +endif KBUILD_CFLAGS += $(branch-prot-flags-y) +ifeq ($(CONFIG_AS_HAS_ARMV8_4), y) +# make sure to pass the newest target architecture to -march. +KBUILD_CFLAGS += -Wa,-march=armv8.4-a +endif + ifeq ($(CONFIG_SHADOW_CALL_STACK), y) KBUILD_CFLAGS += -ffixed-x18 endif -- 2.19.1