From 2cd242672eca6ba741dda2a13adf7e9ccd7d7451 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Mon, 6 Sep 2004 07:26:07 -0700 Subject: [PATCH] [PATCH] ppc64: Fix POWER5/JS20 SMP init My recent change to dynamically allocate emergency stacks broke JS20 blades and POWER5. Since we use the emergency stacks in real mode during secondary CPU bringup they must be below the RMO. Signed-off-by: Anton Blanchard Signed-off-by: Linus Torvalds --- arch/ppc64/kernel/setup.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index 06c8abd91ef0a..e73a71e9c8340 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c @@ -724,16 +724,23 @@ static void __init irqstack_early_init(void) */ static void __init emergency_stack_init(void) { + unsigned long limit; unsigned int i; /* * Emergency stacks must be under 256MB, we cannot afford to take * SLB misses on them. The ABI also requires them to be 128-byte * aligned. + * + * Since we use these as temporary stacks during secondary CPU + * bringup, we need to get at them in real mode. This means they + * must also be within the RMO region. */ + limit = min(0x10000000UL, lmb.rmo_size); + for_each_cpu(i) paca[i].emergency_sp = __va(lmb_alloc_base(PAGE_SIZE, 128, - 0x10000000)) + PAGE_SIZE; + limit)) + PAGE_SIZE; } /* -- 2.53.0