From patchwork Mon Nov 2 16:03:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11874325 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=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 2467BC388F2 for ; Mon, 2 Nov 2020 16:05:20 +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 C1A5C2225E for ; Mon, 2 Nov 2020 16:05:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Sy59tCou"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="eTQoB5Zg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1A5C2225E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RNpIQ4FcU/AfCChI/BrY3W4KvJ44Szy+dcIfN9R8X10=; b=Sy59tCou8sN47Xks3Mt584pfy f/b3Yw1kdPZ51mpJqVoXGr9zUecxg6a81EAOq4nBBZArhfBZlE083X8PLwGn6yQZAOqkkrkANYJHX p0JHQEYc7uLsX4hwv84Zcda5nbDCsLdTMl5cFP1tB5WqSGsr63xPuLb6E5qzmD2GxolzdkWw/O761 l/Mo3MlhjPHTGXEOLOcaC8LA+0HPVmX1SonCqyfXd+LBMdW/qla70al4dzs3mceolkbaCnW6CerRd n2Re2Tx1g9/W/woqyVdljyF/mNEZOvtJHw8tQ1twVJRd82hUwNDp3MvbzfO7HzjpcRrxgoPauKw5C 3Snn5Y2jg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZcJy-0006QZ-Qs; Mon, 02 Nov 2020 16:04:38 +0000 Received: from mail-qk1-x74a.google.com ([2607:f8b0:4864:20::74a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZcJv-0006NG-4Z for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 16:04:36 +0000 Received: by mail-qk1-x74a.google.com with SMTP id k12so8922119qkj.18 for ; Mon, 02 Nov 2020 08:04:31 -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=Nv0APfRXVx+DTIM4gaLCUJcDqBiKhNCFIIgeyxClrJo6iXQ+uljS9fQFA/IahsWAmf XI885wQfRinL1v1r8dKr6r67HvA/9tK5MburIjC2gIln8dWcY9x5iwF3mUl7XL9i+8D9 WxUXAKrSaTV87QtVcBCbfLeyQao7QU4D4EZ0Wqq+cXBay0CpVIxH9RMjSBadungqbmX2 2lYod3jlpRBq0b9vZpl9lwS9KZlIVIi5+u9c/5RVKUThEmTD6+hQ8qWc4wZdZkuP7FSJ OL8T1e6Cuur0Aazbv3dbrOZRstlrcR/eE/oEflB13TLXpOA8a2jEjTEOKkcMEwU24/Bk V/5Q== X-Gm-Message-State: AOAM532YVnMUfaRdLScAy0Sz0PxuCVk7LUQNHxp3MFjeesMPqjJbN/qE Tmfgs6qa41ylGNtIXZIOC0AmDTDcV+eX/mar X-Google-Smtp-Source: ABdhPJwc+wJGFLhB5OFAE8wGFb80S0xYuxobgJ7EO+r8UFcqX8a+pLUj5yaP4IAUEYBIDLCA+kBF4HWw4JLFwTiA 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_110435_207595_376CB3C6 X-CRM114-Status: GOOD ( 12.78 ) 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: linux-arm-kernel@lists.infradead.org, Marco Elver , Elena Petrova , Andrey Konovalov , Kevin Brodsky , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Ryabinin , Andrew Morton , Vincenzo Frascino , Dmitry Vyukov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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)"'