Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3411732pxx; Mon, 2 Nov 2020 08:12:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4mkDozjtkyPl/OpNRYm8u/IeTIGSMaLi3RU44zDlwzT62qPMTYNr4dYt73HPSu8WtKKly X-Received: by 2002:aa7:d888:: with SMTP id u8mr16463411edq.210.1604333531138; Mon, 02 Nov 2020 08:12:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604333531; cv=none; d=google.com; s=arc-20160816; b=dpO9W+5M5WqfhkqxpXbeDSChpJ7ZnPwEVu31qP7g+aGstpuSeBbzk3Z0DzPCm5X+rV nJKlHqDexEGoUvTQWa+GxID/2BGZciyK1yj4+FUCdHyleQHMDz0EOACQ3w3wjUdqj9tP 3F0YNjpPTkG9zgHjJJ4PptPB8/v+rXZia1QUHnf2vbjLIqvodddkNgmjbS9OXEEUcn0y vOlbmZ4dnxSnh9n66/DmRvKcOOezP+Ka01ojjWERB5gbHJesEz7HY7iSm/jBFQyzzn29 gTlXrGvsjHWZuMUx98TVkvLRN/ZMtPLorul/ocmmE+coQWTAt6gNwNKkcCYGKIcMYli/ gZzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=m6E33oJg1cT4FLFX7kYbKRuylbP2hj1k0453+DytozM=; b=zCbfve8h2aIHzhQp1j4kHzTHQSlZM8+fpY8HHzu3Sv6HqwcEFu6QiClXFV8DdxDaAc q/CRZzYUmCthB0YQ0GDlEY2WEMql0+tp0jpYPkT7AxXUV1/M16cy4xPA0eHm1onSv2aG k2r1ZubSY/D+LGmQt0T9ab3dsO5ncPtO26hvHIvSqWVeKnJkOgDqkP/OZLY7CA/zzshQ zFEd7J0dxEM1D8PD6z49YZSjHsalQWuLOYAj5cLDp58Id8u63t9gh2jQoNFLPmV2wYiK vAFJMhAoxDSZyd2A8UweqAzSWpdIx/N7LN+lLQSEQfI3gqfomdfoFPqhJFosJBO2/wDt j2MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eTQoB5Zg; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pw16si10304983ejb.430.2020.11.02.08.11.48; Mon, 02 Nov 2020 08:12:11 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=eTQoB5Zg; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbgKBQEd (ORCPT + 99 others); Mon, 2 Nov 2020 11:04:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725852AbgKBQEc (ORCPT ); Mon, 2 Nov 2020 11:04:32 -0500 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9BAC0617A6 for ; Mon, 2 Nov 2020 08:04:30 -0800 (PST) Received: by mail-qt1-x84a.google.com with SMTP id g11so8275358qto.11 for ; Mon, 02 Nov 2020 08:04:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=m6E33oJg1cT4FLFX7kYbKRuylbP2hj1k0453+DytozM=; b=eTQoB5ZgIpjbQfIhUIQDO3ivN+FuBAfTi4VLVEnQZ3+5ddqMb4rqWULFHQZp1P92wW 0f2iVrYZVY359/GwnrAKHyxMOmW1h1mOQ0Z6A1Zn7kC87YzHAy7yXIpx7SeccoDZ8lLB AcWIZXgIBFodzuh748+X7nw4pOv/1JD3JbDOqB0afcFKAjk/n7HBaukQqq4GS0zo2Jsp 66xFjw7OFVez2Vp7CiLJ6ugK7qnsjZeUU3gH028W5plToaBoLhDYsR4EtnerKBmMbJb8 u3CQx4tJLCjNZehtgxDLuU5kzznRlMjNmtKrzDUnQc0aRO4sRGid3HaSl94nXtP4QqTP Z8WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=m6E33oJg1cT4FLFX7kYbKRuylbP2hj1k0453+DytozM=; b=P57oy9uk3r7NI3m0HF3RxtcYkopF/nywdBOr7geRVKhLtAU8MtoTo/46wQIM3hRRC4 gxoGUiDv9lHYy6swMTLrnl9GR0zbwjFsj6VuBVK+wVLwpC+UFeD/LvYlukWCLV+Js/Ne W9iws5eJVMSPiZxkYOgYMjxwTWNboAashRbOPc4GRZ09pprRZf+0YFGSHpCYFMoiaXlG M45IyEcOYanIUb3vaUrhb+rkV8Pp/JPujvlC5hkMUrMJieHS0GnEuHm9OswN1T9KqVMz 8No/+t0QqZs6LZZJMRCMcC5xkq53GSr+2f9cOZX8/3pPK+VcH1vL6rfvBv2V2ughh2Fv aV8g== X-Gm-Message-State: AOAM530qQyT+SuoIISUSS1C3T83Jc1fZIuyu6rR/+RRik1BAIwBd24tA wvSCqrlOEwesbiOPpLhNVekMEgC1ehG805kZ Sender: "andreyknvl via sendgmr" X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a05:6214:127:: with SMTP id w7mr7030495qvs.3.1604333069499; Mon, 02 Nov 2020 08:04:29 -0800 (PST) Date: Mon, 2 Nov 2020 17:03:41 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v7 01/41] arm64: Enable armv8.5-a asm-arch option From: Andrey Konovalov To: Catalin Marinas , Will Deacon Cc: Vincenzo Frascino , kasan-dev@googlegroups.com, Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Elena Petrova , Branislav Rankov , Kevin Brodsky , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincenzo Frascino Hardware tag-based KASAN relies on Memory Tagging Extension (MTE) which is an armv8.5-a architecture extension. Enable the correct asm option when the compiler supports it in order to allow the usage of ALTERNATIVE()s with MTE instructions. Signed-off-by: Vincenzo Frascino Signed-off-by: Andrey Konovalov Reviewed-by: Catalin Marinas --- Change-Id: I172e15e4c189f073e4c14a10276b276092e76536 --- arch/arm64/Kconfig | 4 ++++ arch/arm64/Makefile | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1d466addb078..fddb48d35f0f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1591,6 +1591,9 @@ endmenu menu "ARMv8.5 architectural features" +config AS_HAS_ARMV8_5 + def_bool $(cc-option,-Wa$(comma)-march=armv8.5-a) + config ARM64_BTI bool "Branch Target Identification support" default y @@ -1665,6 +1668,7 @@ config ARM64_MTE bool "Memory Tagging Extension support" default y depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI + depends on AS_HAS_ARMV8_5 select ARCH_USES_HIGH_VMA_FLAGS help Memory Tagging (part of the ARMv8.5 Extensions) provides diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 5789c2d18d43..50ad9cbccb51 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -100,6 +100,11 @@ ifeq ($(CONFIG_AS_HAS_ARMV8_4), y) asm-arch := armv8.4-a endif +ifeq ($(CONFIG_AS_HAS_ARMV8_5), y) +# make sure to pass the newest target architecture to -march. +asm-arch := armv8.5-a +endif + ifdef asm-arch KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \ -DARM64_ASM_ARCH='"$(asm-arch)"' -- 2.29.1.341.ge80a0c044ae-goog