X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=arch%2FKconfig;h=180ea33164dc45821a78c08043dc95119c1bdb7e;hb=687ee0ad4e897e29f4b41f7a20c866d74c5e0660;hp=fd6e9712af81b5bab38f871665d2a2df66d8468d;hpb=a931a189d4f661d1a23010e40c528c0170a1d9b2;p=cascardo%2Flinux.git diff --git a/arch/Kconfig b/arch/Kconfig index fd6e9712af81..180ea33164dc 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -696,4 +696,38 @@ config ARCH_NO_COHERENT_DMA_MMAP config CPU_NO_EFFICIENT_FFS def_bool n +config HAVE_ARCH_VMAP_STACK + def_bool n + help + An arch should select this symbol if it can support kernel stacks + in vmalloc space. This means: + + - vmalloc space must be large enough to hold many kernel stacks. + This may rule out many 32-bit architectures. + + - Stacks in vmalloc space need to work reliably. For example, if + vmap page tables are created on demand, either this mechanism + needs to work while the stack points to a virtual address with + unpopulated page tables or arch code (switch_to() and switch_mm(), + most likely) needs to ensure that the stack's page table entries + are populated before running on a possibly unpopulated stack. + + - If the stack overflows into a guard page, something reasonable + should happen. The definition of "reasonable" is flexible, but + instantly rebooting without logging anything would be unfriendly. + +config VMAP_STACK + default y + bool "Use a virtually-mapped stack" + depends on HAVE_ARCH_VMAP_STACK && !KASAN + ---help--- + Enable this if you want the use virtually-mapped kernel stacks + with guard pages. This causes kernel stack overflows to be + caught immediately rather than causing difficult-to-diagnose + corruption. + + This is presently incompatible with KASAN because KASAN expects + the stack to map directly to the KASAN shadow map using a formula + that is incorrect if the stack is in vmalloc space. + source "kernel/gcov/Kconfig"