From patchwork Mon Nov 23 20:07:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11926405 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=-16.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 81C81C2D0E4 for ; Mon, 23 Nov 2020 20:09:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E776B20724 for ; Mon, 23 Nov 2020 20:09:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="bzRUk7lH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E776B20724 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 63ECC6B00AD; Mon, 23 Nov 2020 15:09:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 59B0C6B00AE; Mon, 23 Nov 2020 15:09:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43BB66B00AF; Mon, 23 Nov 2020 15:09:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id 0DAC76B00AD for ; Mon, 23 Nov 2020 15:09:25 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id ADA99824999B for ; Mon, 23 Nov 2020 20:09:24 +0000 (UTC) X-FDA: 77516772648.08.soup15_3700f1127368 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 886451819E793 for ; Mon, 23 Nov 2020 20:09:24 +0000 (UTC) X-HE-Tag: soup15_3700f1127368 X-Filterd-Recvd-Size: 5219 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Nov 2020 20:09:24 +0000 (UTC) Received: by mail-wm1-f73.google.com with SMTP id e15so103377wme.4 for ; Mon, 23 Nov 2020 12:09:24 -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=KVSJXJK3L8qTAj65/VfUWb47G8JUT1DB2NysMQkgqU4=; b=bzRUk7lH945+D4glkCJTKLJUwSPZmB7Rhy8GTksmj5BD4GyFtkilz7wrLtlk9Ei+MY 2bSehq8DRjRDlXgHVIWbosolvD7F7NAi8y2Sln5aVLVGPp3qMblvzZByi7i85hUbLveg JcrtmiCCavd+vGYNqKM63InzkQ/nYT2ezWga/nUZmX3pq8a8Bcvis4S747GTAKSuWi35 7WziuBIy2Im/xwj8823jjukD2LFYv55LMajt90HiyEzNUk1RUucBXEuRFOQHPzpn3oST gkJ7HsBzFRfEbATT6NuZK0moEs0gyz/vJnauuOMCrDARGRLGJOPJ9a/fU/L43Jfxl9eI sSKQ== 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=KVSJXJK3L8qTAj65/VfUWb47G8JUT1DB2NysMQkgqU4=; b=pouMo6ud6XoKPY3aJFWbQPzqwmDVWiVGt5evynfMC/jIH8sJWBYSY5lUL1IZp0uEvq CLp8xwnyjXL9lXb9vlRlAGCSvVcSomQqyMiSseGh09iWP2a/7ZJh9S775XMY7VHMvYHn nUrWFmX+Y7he3E1MWrQ8uzkkUCdlUmulgErybRzbMXrnqLUTgYJyMDP3aosHvPCIj0N+ p8tNegsl3M8Xckyj1gGyFCX/i09ZIux3Zh3+yed0E2qQogsmLqsssl7/oW6nLZH2NSot hFcCQH/A/tD04r6bSKbTi1PYPRqhz3VRTMP4WDw+sfksD/TIBUjVS+VlAzCgMaOa8ZJA YI3g== X-Gm-Message-State: AOAM532J3tj1+R8cNCHtnRcW8Kvkgp1oQdnOK9hrOh5Leqoj/kX0a86L 7/WyjyVABhT+CZDOzUtGTXin8GA6DSTu45wB X-Google-Smtp-Source: ABdhPJyACYW4zaMGjNwfxx49aU3DfZ/9cHrTN2moJdj3kkxbybIzLkr76NufI/imYXaFTYNN4fq5KUcM14rjZc9m X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a1c:e3d4:: with SMTP id a203mr566406wmh.177.1606162163180; Mon, 23 Nov 2020 12:09:23 -0800 (PST) Date: Mon, 23 Nov 2020 21:07:48 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH mm v11 24/42] arm64: Enable armv8.5-a asm-arch option From: Andrey Konovalov To: Andrew Morton Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Alexander Potapenko --- 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 026aaa64a7e0..b641bb6cbc73 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)"'