Thread (60 messages) 60 messages, 5 authors, 2021-12-30

Re: [PATCH mm v4 29/39] kasan, page_alloc: allow skipping memory init for HW_TAGS

From: Andrey Konovalov <andreyknvl@gmail.com>
Date: 2021-12-30 19:11:49
Also in: linux-arm-kernel, lkml

On Tue, Dec 21, 2021 at 1:12 PM Marco Elver [off-list ref] wrote:
On Mon, Dec 20, 2021 at 11:02PM +0100, andrey.konovalov@linux.dev wrote:
quoted
From: Andrey Konovalov <redacted>
[...]
quoted
+static inline bool should_skip_init(gfp_t flags)
+{
+     /* Don't skip if a software KASAN mode is enabled. */
+     if (IS_ENABLED(CONFIG_KASAN_GENERIC) ||
+         IS_ENABLED(CONFIG_KASAN_SW_TAGS))
+             return false;
+
+     /* Don't skip, if hardware tag-based KASAN is not enabled. */
+     if (!kasan_hw_tags_enabled())
+             return false;
Why is the IS_ENABLED(CONFIG_KASAN_{GENERIC,SW_TAGS}) check above
required? Isn't kasan_hw_tags_enabled() always false if one of those is
configured?
It is. I wanted to include those checks for completeness, but maybe
they just cause confusion instead. Will drop them in v5. Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help