]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arch/sparc: revised support for 4096cpus
authorJane Chu <jane.chu@oracle.com>
Tue, 6 Jun 2017 22:25:01 +0000 (16:25 -0600)
committerAllen Pais <allen.pais@oracle.com>
Fri, 16 Jun 2017 08:46:09 +0000 (14:16 +0530)
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 <jane.chu@oracle.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/kernel/irq_64.c

index dbdd66bcfcbb962961c092d7483fe4a9246670ce..1bcb2aba19efba35512087dd51a3d9ac437a6d44 100644 (file)
@@ -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
 }