Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1035677rwl; Wed, 29 Mar 2023 11:39:19 -0700 (PDT) X-Google-Smtp-Source: AKy350a3MbcgVu3XkhOozOrfblFV1G8OZjHU0ExzQrNLLZvsTE+8YqVYuvXXJUpFtlosSkcv96AP X-Received: by 2002:a17:906:ecf9:b0:92e:b1dd:cff2 with SMTP id qt25-20020a170906ecf900b0092eb1ddcff2mr17951057ejb.28.1680115158877; Wed, 29 Mar 2023 11:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680115158; cv=none; d=google.com; s=arc-20160816; b=tlR36YPBGO5Cs34x88nglR31ZmgBilPIsvZorh5xPWsDEb3VsGAVu9Cn/pzM98IxcM ZNyo5xyENXys1I4JUA6E7iwPMgCeXbtIblBcUp2cFl75miMLhDPkLTa6xcQJUq2pehlT Xeu9XZIFLSfXZ47zyGvSMKz+tJV7i7NuA5OrayKSeBZDLoXojP6vyHJ9/FG96X/oecCO avYQvUMH85yg+2qrnKsElXgSS1fnirVxeMXji39qSQyIkC10kZHABZrGIN8m93nFl4z8 ZcoV+aphB9XFMaFoQ7VZUda4L3jGW+3ZqxkPjAbcxZN4nLk6rQ/MTlVH+3NSRZIv/ANz 3K/w== 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 :dkim-signature; bh=4IBB0t30IQWFgjzMoDMwNtgr4khYAd9V6YJirYANKJw=; b=ENVTbs2MRwvkOyoakCbj5tIKAzAIZIOMKI7rZu7Ws6N+p4Xmw9BE69MBizQnHj76Ly sLYxZF94Fx9apKcqpdmDW9W2GsRcWmV9OPfnKnkTSzoXFhs6xi1Zst5yoU8PIeJm9hbb XDD+kFAk60x6A9zs0RDx8jgryJMJ/P8kre0CH3aVIKTAll8fgM2GBsZj+dsMyFYE/0XY ThViRcR9LHU4IW21FqA5aN4VgN2tJ7AlkWqYr7gel0Ohcl8UnMNO5yayfoRB4Yz6mR0I bfmx2lm7JgRn68ZWEF62NwJAjJ7uIRNPysGfocpEzwnV7Ds1HkGlm9/t7VMIT+H4H4k1 +jRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QgAd4ttX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne29-20020a1709077b9d00b0093295ea18c2si41320859ejc.392.2023.03.29.11.38.53; Wed, 29 Mar 2023 11:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QgAd4ttX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229684AbjC2SiM (ORCPT + 99 others); Wed, 29 Mar 2023 14:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjC2SiF (ORCPT ); Wed, 29 Mar 2023 14:38:05 -0400 Received: from out-10.mta1.migadu.com (out-10.mta1.migadu.com [IPv6:2001:41d0:203:375::a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5F571FDA for ; Wed, 29 Mar 2023 11:38:01 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1680115080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4IBB0t30IQWFgjzMoDMwNtgr4khYAd9V6YJirYANKJw=; b=QgAd4ttXeu2KtUbjd+eYGisjZq9ioQEf7KHQO41mUQEncgqcvFT0kMtVWTnVhTvqO39dCs qnfT8VmxT5x2t4jFNaIYtC86D2toghjLwz4S6LnFhsQ33dWNChtMewppVDGTmO1JwwMcY9 /ZquEfYJhPqccz/gfQ0PZ1hFiaHWscc= From: andrey.konovalov@linux.dev To: Marco Elver , Catalin Marinas Cc: Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Vincenzo Frascino , Will Deacon , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, Weizhao Ouyang , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v2 4/5] kasan, arm64: add arch_suppress_tag_checks_start/stop Date: Wed, 29 Mar 2023 20:37:47 +0200 Message-Id: <7ad5e5a9db79e3aba08d8f43aca24350b04080f6.1680114854.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov Add two new tagging-related routines arch_suppress_tag_checks_start/stop that suppress MTE tag checking via the TCO register. These rouines are used in the next patch. Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/memory.h | 2 ++ mm/kasan/kasan.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index faf42bff9a60..05e42bd3555f 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -264,6 +264,8 @@ static inline const void *__tag_set(const void *addr, u8 tag) #define arch_enable_tag_checks_sync() mte_enable_kernel_sync() #define arch_enable_tag_checks_async() mte_enable_kernel_async() #define arch_enable_tag_checks_asymm() mte_enable_kernel_asymm() +#define arch_suppress_tag_checks_start() mte_enable_tco() +#define arch_suppress_tag_checks_stop() mte_disable_tco() #define arch_force_async_tag_fault() mte_check_tfsr_exit() #define arch_get_random_tag() mte_get_random_tag() #define arch_get_mem_tag(addr) mte_get_mem_tag(addr) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index a1613f5d7608..f5e4f5f2ba20 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -398,6 +398,8 @@ static inline const void *arch_kasan_set_tag(const void *addr, u8 tag) #define hw_enable_tag_checks_sync() arch_enable_tag_checks_sync() #define hw_enable_tag_checks_async() arch_enable_tag_checks_async() #define hw_enable_tag_checks_asymm() arch_enable_tag_checks_asymm() +#define hw_suppress_tag_checks_start() arch_suppress_tag_checks_start() +#define hw_suppress_tag_checks_stop() arch_suppress_tag_checks_stop() #define hw_force_async_tag_fault() arch_force_async_tag_fault() #define hw_get_random_tag() arch_get_random_tag() #define hw_get_mem_tag(addr) arch_get_mem_tag(addr) -- 2.25.1