lkml.org 
[lkml]   [2022]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-05-31 09:42    [W:0.053 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site