[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YpXGmilyOWmAh4WA@infradead.org>
Date: Tue, 31 May 2022 00:41:14 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Michael Ellerman <mpe@...erman.id.au>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Erhard Furtner <erhard_f@...lbox.org>
Subject: Re: [PATCH] powerpc/Kconfig: Force THREAD_SHIFT to at least 14 with
KASAN
On Tue, May 31, 2022 at 04:16:19PM +1000, Michael Ellerman wrote:
> I was thinking of doing it in C, similar to the way arm64 handles it.
>
> Something like below. It means we always double the stack size when
> KASAN is enabled. I think it's preferable, as it will always work
> regardless of whether the user has an old .config (or is bisectting)?
Is there any reason to even offer the Kconfig? It is super cryptic and
just picking the right value directly in the header would seem much
more sensible:
#if defined(CONFIG_PPC_256K_PAGES)
#define MIN_THREAD_SHIFT 15
#elif defined(CONFIG_PPC64)
#define MIN_THREAD_SHIFT 14
#else
#define MIN_THREAD_SHIFT 13
#endif
#ifdef CONFIG_KASAN
#define THREAD_SHIFT (MIN_THREAD_SHIFT + 1)
#else
#define THREAD_SHIFT MIN_THREAD_SHIFT
#endif
#if defined(CONFIG_VMAP_STACK) && THREAD_SHIFT < PAGE_SHIFT
#undef THREAD_SHIFT
#define THREAD_SHIFT PAGE_SHIFT
#endif
Powered by blists - more mailing lists