From patchwork Fri Mar 10 23:43:29 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: 13170469 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E0D7C6FD19 for ; Fri, 10 Mar 2023 23:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BEK+jrZTIExnzwmo7NHcI7GDKFqYEMnzeCAOCvwXhh8=; b=o6/Vp9Z75HDTfC dG/sZroygPUtcXdXvMFvzZLNl7bFbiO80lwlFgysQFT8casVzYlm9WA3MwMmU1Oxb9HHsMdyAHSHB 5y6oN9CPnVc6EdqFHadGpvCrAquC4y1I4aHZDWczxZVAvCbcEo1EP67cUsSnckVgNzYSi22nuVk+y gA9oW1IyBP1iC56Hsla3vcNrqUfmBrPSv2WlWZfgTJULEs6/uWrOTlAjcHQjmZ7/e9xRjz+7VFufQ MMlBD75o+ixnlKOWWkxxYoPTQMguz9Fh+x8VZxdo+5fk3FIQ16Ae2J58CduIMbWIvRzAOvyyCZubj vy9gp8fTt3obmSAa2arw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamPJ-00GiRV-8L; Fri, 10 Mar 2023 23:44:17 +0000 Received: from out-5.mta1.migadu.com ([95.215.58.5]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pamOo-00GiGB-KO for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 23:43:48 +0000 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=1678491816; 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; bh=z4DPZvfjlbyZR04Gs5VqWFFoeLvvcar/vhfVx7MEdnM=; b=UcgdJ+DJVo9GF+Ix3wnxINMhtX483ckxS9anY1bHh8fL0eGkNMCuKJlKj1RTT3X1QfHe15 dJeb+N+1TAdv+RZ72TIMdS+If3df0G/LVbGfso6arBItfon0IiusknaIiSUQ4M11FCoxJ8 yjSINLfD2aKPSvaVR6zUm3NXPTT/r9E= 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 1/5] kasan: drop empty tagging-related defines Date: Sat, 11 Mar 2023 00:43:29 +0100 Message-Id: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230310_154346_842728_546830AF X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andrey Konovalov mm/kasan/kasan.h provides a number of empty defines for a few arch-specific tagging-related routines, in case the architecture code didn't define them. The original idea was to simplify integration in case another architecture starts supporting memory tagging. However, right now, if any of those routines are not provided by an architecture, Hardware Tag-Based KASAN won't work. Drop the empty defines, as it would be better to get compiler errors rather than runtime crashes when adding support for a new architecture. Also drop empty hw_enable_tagging_sync/async/asymm defines for !CONFIG_KASAN_HW_TAGS case, as those are only used in mm/kasan/hw_tags.c. Signed-off-by: Andrey Konovalov --- mm/kasan/kasan.h | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index a61eeee3095a..b1895526d02f 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -395,28 +395,6 @@ static inline const void *arch_kasan_set_tag(const void *addr, u8 tag) #ifdef CONFIG_KASAN_HW_TAGS -#ifndef arch_enable_tagging_sync -#define arch_enable_tagging_sync() -#endif -#ifndef arch_enable_tagging_async -#define arch_enable_tagging_async() -#endif -#ifndef arch_enable_tagging_asymm -#define arch_enable_tagging_asymm() -#endif -#ifndef arch_force_async_tag_fault -#define arch_force_async_tag_fault() -#endif -#ifndef arch_get_random_tag -#define arch_get_random_tag() (0xFF) -#endif -#ifndef arch_get_mem_tag -#define arch_get_mem_tag(addr) (0xFF) -#endif -#ifndef arch_set_mem_tag_range -#define arch_set_mem_tag_range(addr, size, tag, init) ((void *)(addr)) -#endif - #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() @@ -430,10 +408,6 @@ void kasan_enable_tagging(void); #else /* CONFIG_KASAN_HW_TAGS */ -#define hw_enable_tagging_sync() -#define hw_enable_tagging_async() -#define hw_enable_tagging_asymm() - static inline void kasan_enable_tagging(void) { } #endif /* CONFIG_KASAN_HW_TAGS */