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: 11926595 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,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 A466BC2D0E4 for ; Mon, 23 Nov 2020 20:18:48 +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 35E3E206E5 for ; Mon, 23 Nov 2020 20:18:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DwR4v32k"; 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 35E3E206E5 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=VqQehguCsA/fYRyjSnxILtWdMh34+PJ2zFzrXkzcf6I=; b=DwR4v32kHBjWti2pmBan3a3Q6 WKWz/VNEQbFjIrcg5/VUviw992+f5GAcujc2/cj/UVi9ozBusls0unnDxqbpfk9I679UWL1qxjnJe x9nnMRTPaIal9tj+skNBmybK0PwlDmXxZwimKEDTPV6vkmYWDZEUwKwHVImbz/XVOdbjqrR0sIOuQ ySzNEuacghFVxK0ExK/ABvj7COYrspIjAICYTMqJAP8KHCXHDk0fatrCBQDW+jy5a2GViFxE2IhQi S3WqRu0vkLBwFKNdTJmhbhLBwRf8ahvOPIP6mSYQH9JTAzoD7ehIszHGTx5pqaka0mWtbx9BaZ+9t d2H5MwqLw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khIHb-0003Bt-AK; Mon, 23 Nov 2020 20:17:55 +0000 Received: from mail-wr1-x44a.google.com ([2a00:1450:4864:20::44a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khI9O-0008Fu-Py for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 20:09:41 +0000 Received: by mail-wr1-x44a.google.com with SMTP id f4so6234726wru.21 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=ViO2kYPcXnVgcGKIgttOPoUrj1WtmSAJsr8RQW4YUziDmPBoid0weaxCuLPOSwpzu2 MhTZFT3+IC9fBjtTwLGBFO8mcD/PgmwAKnxgsw7ZPj+InaZpFtKlxBLCHbccRPYNK1e/ 0fOmEJPwwktef/siuGHrLTuLy3uLeY/kJpzWJi/gfCrDkzuMPDVGEMi/HB6CTUGl+n7B kpHIT2p+YX2rJIc11ci66LYaz7yir2OKRyPeXb6atpQIbjGC6FPyr1mVdW0ik8N7e3AM lmMQFAuD7bAQhS5sG9SOJALKZpe3V40ke1YWSybIKIlCvhMgpq8okWz0JTELxV/4We17 Ljag== X-Gm-Message-State: AOAM533PrhewNs+HeOmDV97pP5TysAvUmRWNb08rDXYNoRw9oRXR5djx w2NoGuQWdCVrhmNLxAyD9OcHdcqV6pBdlkEl 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_150926_938973_3268148F X-CRM114-Status: GOOD ( 13.00 ) 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 , Catalin Marinas , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Konovalov , Andrey Ryabinin , 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 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)"'