From patchwork Fri Nov 13 22:15:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11905031 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 169E8C4742C for ; Fri, 13 Nov 2020 22:28:46 +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 A712C207DE for ; Fri, 13 Nov 2020 22:28:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2LkAk4Wu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="oZGcT35L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A712C207DE 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=+lAgSH7Md54rCZ8GwmZKUy516T3VfkOJWSwvwwZtE5c=; b=2LkAk4WuzZmEewcAOnjH3oJCg PWwGU+B8mqfUY3zN8HuXPzYAXu/0Eud398KCgltcs3bZMXk4sk8if+Qo11GiP7fIHs7ul+hhFWbMt lmyJP13IpO/3ORr6BGMqHWcUEqYyGTAHebvTKEtEi3vJlqVcgDMOSrIsZQUItcUKpIY34J60jJmWZ WrPoZW8D58NvwVK2gqxUng60RP1Q/YVkiEojOKI3r/GWX5lNG7xgWZIvszcvofyAmeqHKurndKWXp Sx3lbBEyrd9iC7WoSdJEp68xYk0L73EKL96wUGo0/6QnmidWmNerUBuO+XjWyfT1PKVtEpspJr1Kd v5/WULqHw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdhWr-0004P0-Lf; Fri, 13 Nov 2020 22:26:49 +0000 Received: from mail-qt1-x849.google.com ([2607:f8b0:4864:20::849]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdhNc-0000D8-Mh for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 22:17:31 +0000 Received: by mail-qt1-x849.google.com with SMTP id r29so4537463qtu.21 for ; Fri, 13 Nov 2020 14:17:14 -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=NFGGXUBjg1FkirXtdz4QA+03+4XYK9SoCEIWQ/Car4Y=; b=oZGcT35LBHBUVPLuJOh033/ptjjWSUtjPqzsZ18eNWPkH24XvdTAVMjEYwveoSySII M9XhoMXku+PuYoHc23oPWSeVathCjz3RrEyIit+HXPqG7OeRLvLOHeeFM/qhkJPk3pwz 4OzaJP10XYX+HBcgJk6Mnr2GcXHHTbNuigl8vDuo1T+nE3uqYEStRuiUaXWuZyvz1A7f QIVdqSaBErSpwrJbLfXg7PRKQ1Lt1GIRx+Q85QqdW20Xc3FWPijEnPvoPzB6L3BvnIG9 FZzMxhcgMuaAnwB5XXmjskRfj2+vT9ZQ0TycHT94HZ/vpvqVitG6Aofut6AvlaXI0juP pT0w== 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=NFGGXUBjg1FkirXtdz4QA+03+4XYK9SoCEIWQ/Car4Y=; b=FFXq0agtucVLwLroAdXHTkWJcqTprYOErEBI2DWqIbCYlvo6TC0OBVsCG2QZs0e0bn 4viakVEMZ/df81UxBYYO8egi1Gnf0rhovWbdx+LUH7Sm4+Xa99jweMdj0t6HzYuVxGyT IScDO36ASwdKVmaSWZr+/pErP4MUklSaobbmOtSMBPJHn9GAlskneaek48zNT7y3HDMd 5sP8MWUYdZyeicCAsNS4OgFwNlRM1HGXmkW+0R43QDUMOGOJnmAOCNcxGR4qyXtC0pPe ejB1m2C+x9ll72qkYHojItyiEn+rxX1WZ3EpPLdP3fVQKfW6i1CG91Q9I7z+C297xFga zfjg== X-Gm-Message-State: AOAM533tGH0yI6r1a6qyPaBFB3o4qVxa+t3jw67GVjRjWQ8GJIIRq8vf ce8t9dIMgYQNn5dyLOgvadiRlYr5Zpp+rF69 X-Google-Smtp-Source: ABdhPJw/sRcT+84Ih69XdMqaBAgPFkLKGmGclbjXezZDayz5LLIr65pHmErW8SkHvfi3TqfD+UlDjqOUeljiWs5U X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a0c:ab8f:: with SMTP id j15mr2391938qvb.54.1605305832937; Fri, 13 Nov 2020 14:17:12 -0800 (PST) Date: Fri, 13 Nov 2020 23:15:52 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.299.gdc1121823c-goog Subject: [PATCH mm v10 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-20201113_171716_813860_F2BD74C4 X-CRM114-Status: GOOD ( 12.63 ) 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 c999da4f2bdd..b7d1f1a5705d 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)"'