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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46A3CC6FD19 for ; Fri, 10 Mar 2023 23:43:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231982AbjCJXnn (ORCPT ); Fri, 10 Mar 2023 18:43:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231713AbjCJXnk (ORCPT ); Fri, 10 Mar 2023 18:43:40 -0500 Received: from out-6.mta1.migadu.com (out-6.mta1.migadu.com [95.215.58.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5459611FF9D for ; Fri, 10 Mar 2023 15:43:38 -0800 (PST) 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 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 */ -- 2.25.1