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

Commit fe8e0c25 authored by Alexander van Heukelum's avatar Alexander van Heukelum Committed by Ingo Molnar
Browse files

x86, 32-bit: Align percpu area and irq stacks to THREAD_SIZE



The irq stacks, located in the percpu-area, need to be
THREAD_SIZE aligned. Add the infrastucture to align percpu
variables to larger-than-pagesize amounts within the percpu
area, and use it to specify the alignment for the irq stacks.
Also align the percpu area itself to THREAD_SIZE.

This should make irq stacks work with 8K THREAD_SIZE.

Signed-off-by: default avatarAlexander van Heukelum <heukelum@fastmail.fm>
Cc: Tejun Heo <tj@kernel.org>
Cc: hch@lst.de
LKML-Reference: <1283799222.15941.1393621887@webmail.messagingengine.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 1813a684
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -60,8 +60,8 @@ union irq_ctx {
static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx);
static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx);
static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx);
static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx);


static DEFINE_PER_CPU_PAGE_ALIGNED(union irq_ctx, hardirq_stack);
static DEFINE_PER_CPU_MULTIPAGE_ALIGNED(union irq_ctx, hardirq_stack, THREAD_SIZE);
static DEFINE_PER_CPU_PAGE_ALIGNED(union irq_ctx, softirq_stack);
static DEFINE_PER_CPU_MULTIPAGE_ALIGNED(union irq_ctx, softirq_stack, THREAD_SIZE);


static void call_on_stack(void *func, void *stack)
static void call_on_stack(void *func, void *stack)
{
{
+1 −1
Original line number Original line Diff line number Diff line
@@ -273,7 +273,7 @@ SECTIONS
	}
	}


#if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP)
#if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP)
	PERCPU(PAGE_SIZE)
	PERCPU(THREAD_SIZE)
#endif
#endif


	. = ALIGN(PAGE_SIZE);
	. = ALIGN(PAGE_SIZE);
+12 −0
Original line number Original line Diff line number Diff line
@@ -138,6 +138,18 @@
	DEFINE_PER_CPU_SECTION(type, name, "..page_aligned")		\
	DEFINE_PER_CPU_SECTION(type, name, "..page_aligned")		\
	__aligned(PAGE_SIZE)
	__aligned(PAGE_SIZE)


/*
 * Declaration/definition used for large per-CPU variables that must be
 * aligned to something larger than the pagesize.
 */
#define DECLARE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size)		\
	DECLARE_PER_CPU_SECTION(type, name, "..page_aligned")		\
	__aligned(size)

#define DEFINE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size)		\
	DEFINE_PER_CPU_SECTION(type, name, "..page_aligned")		\
	__aligned(size)

/*
/*
 * Intermodule exports for per-CPU variables.  sparse forgets about
 * Intermodule exports for per-CPU variables.  sparse forgets about
 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to
 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to