linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] kasan: drop empty tagging-related defines
@ 2023-03-10 23:43 andrey.konovalov
  2023-03-10 23:43 ` [PATCH 2/5] kasan, arm64: rename tagging-related routines andrey.konovalov
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: andrey.konovalov @ 2023-03-10 23:43 UTC (permalink / raw)
  To: Marco Elver, Catalin Marinas
  Cc: Andrey Konovalov, Alexander Potapenko, Dmitry Vyukov,
	Andrey Ryabinin, kasan-dev, Vincenzo Frascino, Will Deacon,
	linux-arm-kernel, Peter Collingbourne, Evgenii Stepanov,
	Andrew Morton, linux-mm, Weizhao Ouyang, linux-kernel,
	Andrey Konovalov

From: Andrey Konovalov <andreyknvl@google.com>

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 <andreyknvl@google.com>
---
 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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-14 17:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 23:43 [PATCH 1/5] kasan: drop empty tagging-related defines andrey.konovalov
2023-03-10 23:43 ` [PATCH 2/5] kasan, arm64: rename tagging-related routines andrey.konovalov
2023-03-10 23:43 ` [PATCH 3/5] arm64: mte: Rename TCO routines andrey.konovalov
2023-03-10 23:43 ` [PATCH 4/5] kasan, arm64: add arch_suppress_tag_checks_start/stop andrey.konovalov
2023-03-10 23:43 ` [PATCH 5/5] kasan: suppress recursive reports for HW_TAGS andrey.konovalov
2023-03-13 11:19   ` Marco Elver
2023-03-14 17:56     ` Andrey Konovalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox