Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3289250pxf; Mon, 15 Mar 2021 06:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5CE8Zvae2NZ6POCDJsgHov5mfdB2diDzfiDEIaf+PzoA6rFLv7FqDpu92rox6N18N0S1F X-Received: by 2002:aa7:c941:: with SMTP id h1mr29813324edt.85.1615814558475; Mon, 15 Mar 2021 06:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615814558; cv=none; d=google.com; s=arc-20160816; b=oyjoHjmvXDb2tF79l8YWrHYjIRzOvzDbcyuNsQTrvNfMuyOKCEg+NPTePbgtkiuPfR gpzf48PUwQkjFbCXRRGqx2j2J6i1/1aiwLuRsHiuUquCfoNyloXA4wV+6eEjq/BPrDuh KJZXHmiYBNMgPRvB904XBc0vflmHP+irdyoPgrshFqHHB9F4ANI7v1k+jbC5ab32D03V pAX0xMlMNXn6gIxJEM6JxAUCU3m+2WGTw2xQJ1gwHZhsKXRzRC4SxVSni7VueyaxPGlg DOH7T5OfDbCGFDGCcPourbJbAZvnPcboYDHtx7IjL3SZlrk8GIpkXWyarkaQOda0vyw5 BGiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZYRFPkknL+T59Geb3Do4akaxtZE+0ti5PVOWwVUJt5Q=; b=qABg92nY5IqbNKHkkntZrwMOPa2XrtlGQ7YOIYGTNGHPDoPDXRWhcAFseOUBRNwtwC 2aXApnzaIPhkdHH9/+2TTSNtrpiAZvDz1CC4bR8mmp4ujYodEAAybDHFCvOmWpCwI3aV OMqAHCod7PrCbnKWu4+jCRGu+7roQQZDtHdZTHgiNnmhd2coP6Re2L7cBiLhxoGdRuSL AeO0TkEjE+PjMwnY5ueytbwcgmriYe91ofNTq2TL+LjRCSmB8CAA7qqcZmwl7rOy206R BaJ3VLCVryuajBq+qWvKDXurH+QESCYPudujBE4/j1Qz0Dd+3XP/Xf4F/NguJK+pJgbi 7Xtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si3000144eje.58.2021.03.15.06.22.15; Mon, 15 Mar 2021 06:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230372AbhCONU4 (ORCPT + 99 others); Mon, 15 Mar 2021 09:20:56 -0400 Received: from foss.arm.com ([217.140.110.172]:39966 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbhCONUm (ORCPT ); Mon, 15 Mar 2021 09:20:42 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D61C513A1; Mon, 15 Mar 2021 06:20:41 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F34C93F792; Mon, 15 Mar 2021 06:20:39 -0700 (PDT) From: Vincenzo Frascino To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Cc: Vincenzo Frascino , Andrew Morton , Catalin Marinas , Will Deacon , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov , Andrey Konovalov , Lorenzo Pieralisi Subject: [PATCH v16 6/9] arm64: mte: Conditionally compile mte_enable_kernel_*() Date: Mon, 15 Mar 2021 13:20:16 +0000 Message-Id: <20210315132019.33202-7-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315132019.33202-1-vincenzo.frascino@arm.com> References: <20210315132019.33202-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mte_enable_kernel_*() are not needed if KASAN_HW is disabled. Add ash defines around the functions to conditionally compile the functions. Signed-off-by: Vincenzo Frascino --- arch/arm64/kernel/mte.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c index 9362928ba0d5..50f0724c8d8f 100644 --- a/arch/arm64/kernel/mte.c +++ b/arch/arm64/kernel/mte.c @@ -26,9 +26,11 @@ u64 gcr_kernel_excl __ro_after_init; static bool report_fault_once = true; +#ifdef CONFIG_KASAN_HW_TAGS /* Whether the MTE asynchronous mode is enabled. */ DEFINE_STATIC_KEY_FALSE(mte_async_mode); EXPORT_SYMBOL_GPL(mte_async_mode); +#endif static void mte_sync_page_tags(struct page *page, pte_t *ptep, bool check_swap) { @@ -120,6 +122,7 @@ static inline void __mte_enable_kernel(const char *mode, unsigned long tcf) pr_info_once("MTE: enabled in %s mode at EL1\n", mode); } +#ifdef CONFIG_KASAN_HW_TAGS void mte_enable_kernel_sync(void) { /* @@ -147,6 +150,7 @@ void mte_enable_kernel_async(void) if (!system_uses_mte_async_mode()) static_branch_enable(&mte_async_mode); } +#endif void mte_set_report_once(bool state) { -- 2.30.2