Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc64: Get rid of real_setup_per_cpu_areas().

Now that we defer the cpu_data() initializations to the end of per-cpu
setup, we can get rid of this local hack we had to setup the per-cpu
areas eary.

This is a necessary step in order to support HAVE_DYNAMIC_PER_CPU_AREA
since the per-cpu setup must run when page structs are available.

Signed-off-by: David S. Miller <davem@davemloft.net>

+5 -17
-4
arch/sparc/include/asm/percpu_64.h
··· 9 9 10 10 #include <asm/trap_block.h> 11 11 12 - extern void real_setup_per_cpu_areas(void); 13 - 14 12 #define __per_cpu_offset(__cpu) \ 15 13 (trap_block[(__cpu)].__per_cpu_base) 16 14 #define per_cpu_offset(x) (__per_cpu_offset(x)) ··· 16 18 #define __my_cpu_offset __local_per_cpu_offset 17 19 18 20 #else /* ! SMP */ 19 - 20 - #define real_setup_per_cpu_areas() do { } while (0) 21 21 22 22 #endif /* SMP */ 23 23
+5 -6
arch/sparc/kernel/smp_64.c
··· 20 20 #include <linux/cache.h> 21 21 #include <linux/jiffies.h> 22 22 #include <linux/profile.h> 23 - #include <linux/lmb.h> 23 + #include <linux/bootmem.h> 24 24 #include <linux/cpu.h> 25 25 26 26 #include <asm/head.h> ··· 1371 1371 { 1372 1372 } 1373 1373 1374 - void __init real_setup_per_cpu_areas(void) 1374 + void __init setup_per_cpu_areas(void) 1375 1375 { 1376 - unsigned long base, shift, paddr, goal, size, i; 1376 + unsigned long base, shift, goal, size, i; 1377 1377 char *ptr; 1378 1378 1379 1379 /* Copy section for each CPU (we discard the original) */ ··· 1383 1383 for (size = PAGE_SIZE; size < goal; size <<= 1UL) 1384 1384 shift++; 1385 1385 1386 - paddr = lmb_alloc(size * NR_CPUS, PAGE_SIZE); 1387 - if (!paddr) { 1386 + ptr = __alloc_bootmem(size * NR_CPUS, PAGE_SIZE, 0); 1387 + if (!ptr) { 1388 1388 prom_printf("Cannot allocate per-cpu memory.\n"); 1389 1389 prom_halt(); 1390 1390 } 1391 1391 1392 - ptr = __va(paddr); 1393 1392 base = ptr - __per_cpu_start; 1394 1393 1395 1394 for (i = 0; i < NR_CPUS; i++, ptr += size) {
-7
arch/sparc/mm/init_64.c
··· 1679 1679 static void sun4u_pgprot_init(void); 1680 1680 static void sun4v_pgprot_init(void); 1681 1681 1682 - /* Dummy function */ 1683 - void __init setup_per_cpu_areas(void) 1684 - { 1685 - } 1686 - 1687 1682 void __init paging_init(void) 1688 1683 { 1689 1684 unsigned long end_pfn, shift, phys_base; ··· 1801 1806 sun4v_mdesc_init(); 1802 1807 mdesc_populate_present_mask(CPU_MASK_ALL_PTR); 1803 1808 } 1804 - 1805 - real_setup_per_cpu_areas(); 1806 1809 1807 1810 /* Once the OF device tree and MDESC have been setup, we know 1808 1811 * the list of possible cpus. Therefore we can allocate the