Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce12e64f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm64: Use larger stacks when KASAN is selected"

parents 29f0d69b f8a3930d
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/const.h>
#include <linux/types.h>
#include <asm/bug.h>
#include <asm/page.h>
#include <asm/sizes.h>

/*
@@ -92,15 +93,26 @@
#define KERNEL_END        _end

/*
 * The size of the KASAN shadow region. This should be 1/8th of the
 * size of the entire kernel virtual address space.
 * KASAN requires 1/8th of the kernel virtual address space for the shadow
 * region. KASAN can bloat the stack significantly, so double the (minimum)
 * stack size when KASAN is in use.
 */
#ifdef CONFIG_KASAN
#define KASAN_SHADOW_SIZE	(UL(1) << (VA_BITS - 3))
#define KASAN_THREAD_SHIFT	1
#else
#define KASAN_SHADOW_SIZE	(0)
#define KASAN_THREAD_SHIFT	0
#endif

#define THREAD_SHIFT	(14 + KASAN_THREAD_SHIFT)

#if THREAD_SHIFT >= PAGE_SHIFT
#define THREAD_SIZE_ORDER	(THREAD_SHIFT - PAGE_SHIFT)
#endif

#define THREAD_SIZE		(UL(1) << THREAD_SHIFT)

/*
 * Physical vs virtual RAM address space conversion.  These are
 * private definitions which should NOT be used outside memory.h
+1 −7
Original line number Diff line number Diff line
@@ -23,19 +23,13 @@

#include <linux/compiler.h>

#ifdef CONFIG_ARM64_4K_PAGES
#define THREAD_SIZE_ORDER	2
#elif defined(CONFIG_ARM64_16K_PAGES)
#define THREAD_SIZE_ORDER	0
#endif

#define THREAD_SIZE		16384
#define THREAD_START_SP		(THREAD_SIZE - 16)

#ifndef __ASSEMBLY__

struct task_struct;

#include <asm/memory.h>
#include <asm/stack_pointer.h>
#include <asm/types.h>