From patchwork Fri Mar 10 23:43:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 13170460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D3DAC6FA99 for ; Fri, 10 Mar 2023 23:43:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 412716B007B; Fri, 10 Mar 2023 18:43:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CB508E0001; Fri, 10 Mar 2023 18:43:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 129C06B007D; Fri, 10 Mar 2023 18:43:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id F32716B007B for ; Fri, 10 Mar 2023 18:43:40 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D1BCC140609 for ; Fri, 10 Mar 2023 23:43:40 +0000 (UTC) X-FDA: 80554618200.14.BA18799 Received: from out-4.mta1.migadu.com (out-4.mta1.migadu.com [95.215.58.4]) by imf15.hostedemail.com (Postfix) with ESMTP id 1A2DBA0004 for ; Fri, 10 Mar 2023 23:43:38 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=irItE+Jg; spf=pass (imf15.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.4 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678491819; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FR0GMMMnNdReMCefH2++iHzkAdqxWWuGhtNaRaBked8=; b=qkf26NIsLmv+yitdCS9a59iQJM7M6r30yvwXGhdyJ7MsEuoitPHwts9YXxQft3NmB+rT4H dZ3KU0d6/AfJlSibj5KrRgH6XgR5ZrUkaDB80GxTbMvRYpHDjwBCxHc0rjiJDq+cLnnyRc +RaWQyz6VBkyDG9X+mFgd5kBtIsviTs= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=irItE+Jg; spf=pass (imf15.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.4 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678491819; a=rsa-sha256; cv=none; b=mTtg6ES/e0ObhXF54V89Rfa1selWmNoWne/n0fbS+4jNNJJ2Wzm64FTR00nT6QDwErn5iF n6kNMrJPQ5mFTvOCTuTUlkewEA4xStWEN90s+XQyMoyRuX2IFAwkvrojylBkEHjZG80RYH gnF0SDbXpXlkoa+WBBwA09f/iC/IUps= 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=1678491817; 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=irItE+Jgfq84/wI+LBBhF478xDum91DlaJ3tXbxceNY1XuIeNE7SUeo192nrF/ADVo32Nv Mj/JU3ixWvLjBranQUiClYjvymP9MlGX94edM0Nqg2NpmEY1d0xzpdJW3KDOTg+t03LIw+ xlYUVAF+y/E5u7z5X5p0iduduPtLIuY= 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 2/5] kasan, arm64: rename tagging-related routines Date: Sat, 11 Mar 2023 00:43:30 +0100 Message-Id: <069ef5b77715c1ac8d69b186725576c32b149491.1678491668.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1A2DBA0004 X-Stat-Signature: jahbi5xfn3864os5ikrg4cgcsk3eqqyd X-Rspam-User: X-HE-Tag: 1678491818-199870 X-HE-Meta: U2FsdGVkX18lsh6GqfVNKUMMev71RMDsazA4BIl+gZhFUES9ZL1awYyD5vsGfTfqDiqhEpgRZi67qU6cHymh38cW0lKC8df2ifDsTHpn1MA2z4vzJxXgtlHlV2aUbUwud+EPaNCyd8Xc9ZwVrW0IbMr4xfGT7iGkrkgHYb+aJgdp+wNTMYOr0bgxI/TEs61PvEaEh63Q/CBuvs6HaPvVf/UqnoyEaOzVuVCLf4+FkC8CLxJnfqma43vbpW6GxZAyj81n9xM3M6jd6LxbtIsLeBpyNCF/CLPSfLtJ1KnuA2NARy9kw7kAMvAl03m1CRjRxTaYn2OfkbC9qM50m7hvPkZyr0K/udOIWXbeyRTvPPVhzhVTvkTvfpbj49S9PXwfROV+NsZ064oDlB8paHJavqae0dN13OLLVypvHb9hPIH0ccjlRueSS4KSyWpILHV7APwyHMf7WWKwzl6Tq/DU5iKFmx2TWQCKDKmHRiH+3qUJ0QTpEd+9H0npku16p7k+VWm+ENFciiAL/xSx2FYWPFthmV8uhDRZ0+Q7wWXBr6Ud1+JwZ748iaAq85GJBefEHf0EqtWCD3zkevgdhNsVNc6m6Du2P7BpiOnOBPxhRq+wNYgiFJDI5ecolFTvVk6p96yy17UNXxWIplEC6pR43LgEoL5tYTxYE0bECJCoJMIBQaMUEUXHJVlnRE2m3dkcjlr4kVbe6w76DAlb9WbKJ11IKZz2Nirb+guX4rxodA1P0AsXF8Z/3BsAefpjj28g1vwScsQm8Pv+IWzvDLZUtebsJjsRJGCqjaLy1AeVc1HGk30qeGqc+IFH7EX8RKz03qjW0SVUXSa39GdukBS2EHWubTGSRJNiA2ksRey6EuLgg5ukmnMKfJKo3heYwv5Soj0TdUofR19g6A/ZSDHiqAGVAEY/fuwAVpv0Royy6t0KlC1QABOAVwzJCUNI2b7jzB3/kxmIFJzpMFe/3zr pQUnMkyG IpYyjWOxKaApw9J3LCFpLg0/rgaUYXK8RRjTO7f+E2VSXtqxS5fQcj46uYZxgF4ea31q7kX3m8MyKT25rPa/VLFc2LlK4PdQWUi5tU37AyxRXlZdGZ7tzu3Iu9dvZ8eUK3Elq8n4Rt90u8NWeYc9k13a2F60SFMNV9WQlJ45lvlgVlID9j2W2r3K2O53v7bYRDOCA X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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); \