Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1035326rwl; Wed, 29 Mar 2023 11:38:57 -0700 (PDT) X-Google-Smtp-Source: AKy350bUWJAqLAzseI9FKJJFTuHvS1KiKjOmAyQUPNHjvDngkjlPlx6Z8YRssGI0WJA1ruY8iRig X-Received: by 2002:a17:90b:3907:b0:237:d59d:5f89 with SMTP id ob7-20020a17090b390700b00237d59d5f89mr23420863pjb.4.1680115137008; Wed, 29 Mar 2023 11:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680115136; cv=none; d=google.com; s=arc-20160816; b=pgshNJyOLVZXho+gASA9BIuTGe1W4w8YBMsn0JnRjF+MNUIe6+WXzc+5KRpEWi+7GA 2x764+w+rKDf0qfo1NUJxL413xYwv0TtzHewEJPiW1SdhQASvApQOaQmoDR7BSGbqsPF cQPIwf/T4zgv5tyNWoIaJkNer4bFGda7p9P95oGCSssO6v7NVDiuHNZsQzXZ+1N8GyKK yuUMBknLQCN5Pc+bMi13NCUGFHu2zrihhBkzTdR1gwpnt571InOqKHi1QOdAUvG4W3Qw grR7hdstwlTWAUF3j3JyLjBub1vdH9Em54k584SXgczaoU8eMYDmge2RDXFgXhLQXikw SS/Q== 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=FR0GMMMnNdReMCefH2++iHzkAdqxWWuGhtNaRaBked8=; b=B2G80ghBybnpWyoXTXDR/QgLWZMHE9n2VkuhLSWZwwFJoO2I5eGAmUHv72r4Meoahf 017CMOc3uK7bav9mGihqIfx+BzldQ5VBiTJhM4iLHWQBzHE+JrGEGzLG+k91c+YdgO2g 26ro1Q6QmQbEhCZZxyw0hhB74wz91K1+jCTCZaKm4fsfQr9+SRSzC52ODXox2MHoDU8o /trq/SpOWGlvAPNiRIA/DXQnvvlHNDRX1GYr+vxLajDtYRxT2imPF7stSYABY9AfmtT3 ih1s7kaApKyDQN03B/+nsMg/Lq+uFmiAgvlceTH1b4llsS0iK1bRyqUUPf1vnFLVQJFV +SxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DbXVQvkG; 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 y187-20020a638ac4000000b004fbd435fc2esi16048021pgd.447.2023.03.29.11.38.45; Wed, 29 Mar 2023 11:38:56 -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=DbXVQvkG; 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 S229754AbjC2SiP (ORCPT + 99 others); Wed, 29 Mar 2023 14:38:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbjC2SiE (ORCPT ); Wed, 29 Mar 2023 14:38:04 -0400 Received: from out-61.mta1.migadu.com (out-61.mta1.migadu.com [95.215.58.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3A0461A5 for ; Wed, 29 Mar 2023 11:37:59 -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=1680115077; 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=FR0GMMMnNdReMCefH2++iHzkAdqxWWuGhtNaRaBked8=; b=DbXVQvkGTlCs/4ox1E5HOmnOas+o8dhrEXZjhbQ6W8WQVmI5zYiq4ygRCi6EHxe9W/CCRl SYi0JaVw5IP0cy6wxqsztEnf8kDC6a250hmtkSn2HqVpd/QOP3J/6rbmYShIcirFB1djxa c4RW3q5ScoCHI8t9U4gig00pOB+z2mU= 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 2/5] kasan, arm64: rename tagging-related routines Date: Wed, 29 Mar 2023 20:37:45 +0200 Message-Id: <75c4000c862996060a20f1f66d6c9adcf9f23aca.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 Rename arch_enable_tagging_sync/async/asymm to arch_enable_tag_checks_sync/async/asymm, as the new name better reflects their function. Also rename kasan_enable_tagging to kasan_enable_hw_tags for the same reason. Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/memory.h | 6 +++--- mm/kasan/hw_tags.c | 12 ++++++------ mm/kasan/kasan.h | 10 +++++----- mm/kasan/kasan_test.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 78e5163836a0..faf42bff9a60 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -261,9 +261,9 @@ static inline const void *__tag_set(const void *addr, u8 tag) } #ifdef CONFIG_KASAN_HW_TAGS -#define arch_enable_tagging_sync() mte_enable_kernel_sync() -#define arch_enable_tagging_async() mte_enable_kernel_async() -#define arch_enable_tagging_asymm() mte_enable_kernel_asymm() +#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_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/hw_tags.c b/mm/kasan/hw_tags.c index d1bcb0205327..b092e37b69a7 100644 --- a/mm/kasan/hw_tags.c +++ b/mm/kasan/hw_tags.c @@ -205,7 +205,7 @@ void kasan_init_hw_tags_cpu(void) * Enable async or asymm modes only when explicitly requested * through the command line. */ - kasan_enable_tagging(); + kasan_enable_hw_tags(); } /* kasan_init_hw_tags() is called once on boot CPU. */ @@ -373,19 +373,19 @@ void __kasan_poison_vmalloc(const void *start, unsigned long size) #endif -void kasan_enable_tagging(void) +void kasan_enable_hw_tags(void) { if (kasan_arg_mode == KASAN_ARG_MODE_ASYNC) - hw_enable_tagging_async(); + hw_enable_tag_checks_async(); else if (kasan_arg_mode == KASAN_ARG_MODE_ASYMM) - hw_enable_tagging_asymm(); + hw_enable_tag_checks_asymm(); else - hw_enable_tagging_sync(); + hw_enable_tag_checks_sync(); } #if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) -EXPORT_SYMBOL_GPL(kasan_enable_tagging); +EXPORT_SYMBOL_GPL(kasan_enable_hw_tags); void kasan_force_async_fault(void) { diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index b1895526d02f..a1613f5d7608 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -395,20 +395,20 @@ static inline const void *arch_kasan_set_tag(const void *addr, u8 tag) #ifdef CONFIG_KASAN_HW_TAGS -#define hw_enable_tagging_sync() arch_enable_tagging_sync() -#define hw_enable_tagging_async() arch_enable_tagging_async() -#define hw_enable_tagging_asymm() arch_enable_tagging_asymm() +#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_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) #define hw_set_mem_tag_range(addr, size, tag, init) \ arch_set_mem_tag_range((addr), (size), (tag), (init)) -void kasan_enable_tagging(void); +void kasan_enable_hw_tags(void); #else /* CONFIG_KASAN_HW_TAGS */ -static inline void kasan_enable_tagging(void) { } +static inline void kasan_enable_hw_tags(void) { } #endif /* CONFIG_KASAN_HW_TAGS */ diff --git a/mm/kasan/kasan_test.c b/mm/kasan/kasan_test.c index 627eaf1ee1db..a375776f9896 100644 --- a/mm/kasan/kasan_test.c +++ b/mm/kasan/kasan_test.c @@ -148,7 +148,7 @@ static void kasan_test_exit(struct kunit *test) kasan_sync_fault_possible()) { \ if (READ_ONCE(test_status.report_found) && \ !READ_ONCE(test_status.async_fault)) \ - kasan_enable_tagging(); \ + kasan_enable_hw_tags(); \ migrate_enable(); \ } \ WRITE_ONCE(test_status.report_found, false); \ -- 2.25.1