From patchwork Tue Nov 10 22:10:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11895687 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 C4490C388F7 for ; Tue, 10 Nov 2020 22:24:54 +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 5AA41206B2 for ; Tue, 10 Nov 2020 22:24:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tkZoFlvE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="HzxJDWjp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AA41206B2 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=P/jHrX4wxI2S9AmN/Rha0S4MkMOxM2/s5Nuh8mgdL/w=; b=tkZoFlvEdd/fH2jch07hqcH0A nsJsOGy9yDR8q9iKMNODyHrNc0cbdo7bdUQjitf++enJNxaehR8liuD0KllYSB+f0WkT7lmXD+Z1U KmPdjmQErxk+5I5Put/hrr1B8S1l+W5S4CXuWW+jAaEPzC5Yg+RDf8cdzV3Ypm4emFT2YqpxmEqPV WovZordajxzCMQhoubtDvoZ+xrjRODGsQwwTsy7nDfbmKJEFwaw3sPYPMI0DQNCrSsol8fX2Bz41/ luGpA05Xwn0o2P+gY55g6KYCxZS3l4p7kjorXf/3JH5ZRHdDqWlarpeSB6SsbqTrcfx1h2mpjV8Jc cYZCZj6qQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcc2j-0001GM-MT; Tue, 10 Nov 2020 22:23:13 +0000 Received: from mail-qk1-x749.google.com ([2607:f8b0:4864:20::749]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcbs7-0004qZ-4r for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 22:12:29 +0000 Received: by mail-qk1-x749.google.com with SMTP id c18so180999qkl.15 for ; Tue, 10 Nov 2020 14:12:11 -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=d0luRNisG3KRkUWIJpA+kozZ7VZYZZ7aV9TEVeCXzwc=; b=HzxJDWjpBYBTx2nnzeaKR40IhBDGNp8//Q5g3+Yp8d8qaNxWMXc3C+4pVR31Fqn3xG fCKVwStNYBwd5N5fYGv0zlaIwWPFu+TBlPtIWMsEP6uSKlc0RDdsgWMDzgaDnld5lYPC hNvbDCdbNwFY5UNDA9qOkIQHMLKr+eaDpVgknzFtlhGsHay1WkNrzs5ZypWi9lsuJWKh omZpvEkEYE9CoCPW0+jFNFzoLp+kNp5DPHpUt7hzn9l3BjrggNZFNATTGFBlUXC3imBa tZo2pRjwpXd7khtzo/kg6/TokptyVi5r4cwYn2oxhHbLbXjTGtQZRkf62np7og6rShje jMCA== 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=d0luRNisG3KRkUWIJpA+kozZ7VZYZZ7aV9TEVeCXzwc=; b=a3xMAXiWjuzMOOxWqbTqCaFrDMDaQs7EJn92VeQ4o5uaPUxcqeIhHvOy5fm+dt0B9/ y8DSvlzOW5/PTKEdFOZZGJbtttI+xtXaVD88xeb9NgPzYkE7qIYE1n76gNBJFKdepeVL iE6oFUrrPq5WcJWc7CQeBObNDSbv3KNwN+xf0SMvrn3rYXzfTkuvoHmRgFmnRUf8uzUb qYmtKMchIUWqgU71y9pgryauJqc7Ul1mD9ADCqgQT5q4w92/QHVJWRsUrlDlVUwLRONG jeUOAifzkc2wotCvldhEHtRdlWnKqHH3n9g2Ap/w/G/WxeU+vps59FDUpq7EkQgfiJJV uiMA== X-Gm-Message-State: AOAM533SBi+XHJd2FhN7j3SJ5jeAa6cCNhc2ST7Z9k+zq/N95j78aqQ+ oq5v6JtKOk2vi5LOs8yFSPw5hoO3XQSKWahS X-Google-Smtp-Source: ABdhPJwpJeDUnREbb6gHaUPPYAcEUOobtengpR9kJKiWVhPyIavQao1BN6Cj2oA+Dzr1a/WdAfsYGMhCOnSInOLT X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a0c:90e4:: with SMTP id p91mr20380986qvp.61.1605046329251; Tue, 10 Nov 2020 14:12:09 -0800 (PST) Date: Tue, 10 Nov 2020 23:10:23 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH v9 26/44] arm64: Enable armv8.5-a asm-arch option From: Andrey Konovalov To: Catalin Marinas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_171215_262167_C598A866 X-CRM114-Status: GOOD ( 12.43 ) 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 , Andrey Konovalov , Kevin Brodsky , Will Deacon , 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 25ead11074bf..c84a0e6b4650 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)"'