arm64: mm: Set stack size from the kernel command line
As now THREAD_SHIFT can be variable with ARCH_HAS_VARIABLE_STACK_SIZE,
select it for ARM64, and set it from the kernel command line. Update
the stack overflow detection path to use the dynamic thread_shift.
The max value that can be set is 16 (64K) and the min values is
MAX(13, PAGE_SHIFT) as the stack has to be page aligned.
One caveat:
- As init_task stack size is the max possible, that means overflow
checks will fail for it. So we slide the stack bottom to match
the configured stack size, that is done twice; once at boot to
match the default stack size and once if the kernel command
line was passed.
Signed-off-by: Mostafa Saleh <smostafa@google.com>
5 files changed