From 22afd5250f3cd4a94a2aa7aab09cea0f5cb21c97 Mon Sep 17 00:00:00 2001 From: Jane Chu Date: Tue, 6 Jun 2017 16:25:01 -0600 Subject: [PATCH] arch/sparc: revised support for 4096cpus In the process of upstreaming patch bbd4b32b05cc529e74b1dd5ee3edc396fa7dd129 that went into uek4 for the NR_CPUS=4096 support, I received and incorporated a comment to split up the allocation for the mondo block and mondo cpulist. This patch is to update uek4 for consistency. Orabug: 25505750 Signed-off-by: Jane Chu Reviewed-by: Steve Sistare Signed-off-by: Allen Pais --- arch/sparc/kernel/irq_64.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index dbdd66bcfcbb..1bcb2aba19ef 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c @@ -1231,17 +1231,26 @@ static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb) { #ifdef CONFIG_SMP unsigned long page; - unsigned int order; + void *mondo, *p; - order = get_order(num_possible_cpus() * sizeof(u16) + 64); - page = __get_free_pages(GFP_KERNEL | __GFP_ZERO, order); + BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > PAGE_SIZE); + + /* Make sure mondo block is 64byte aligned */ + p = kzalloc(127, GFP_KERNEL); + if (!p) { + prom_printf("SUN4V: Error, cannot allocate mondo block.\n"); + prom_halt(); + } + mondo = (void *)(((unsigned long)p + 63) & ~0x3f); + tb->cpu_mondo_block_pa = __pa(mondo); + + page = get_zeroed_page(GFP_KERNEL); if (!page) { - prom_printf("SUN4V: Error, cannot allocate cpu mondo pages.\n"); + prom_printf("SUN4V: Error, cannot allocate cpu list page.\n"); prom_halt(); } - tb->cpu_mondo_block_pa = __pa(page); - tb->cpu_list_pa = __pa(page + 64); + tb->cpu_list_pa = __pa(page); #endif } -- 2.50.1