Commit 73fffc03 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parent b696fdc2
...@@ -9,8 +9,6 @@ register unsigned long __local_per_cpu_offset asm("g5"); ...@@ -9,8 +9,6 @@ register unsigned long __local_per_cpu_offset asm("g5");
#include <asm/trap_block.h> #include <asm/trap_block.h>
extern void real_setup_per_cpu_areas(void);
#define __per_cpu_offset(__cpu) \ #define __per_cpu_offset(__cpu) \
(trap_block[(__cpu)].__per_cpu_base) (trap_block[(__cpu)].__per_cpu_base)
#define per_cpu_offset(x) (__per_cpu_offset(x)) #define per_cpu_offset(x) (__per_cpu_offset(x))
...@@ -19,8 +17,6 @@ extern void real_setup_per_cpu_areas(void); ...@@ -19,8 +17,6 @@ extern void real_setup_per_cpu_areas(void);
#else /* ! SMP */ #else /* ! SMP */
#define real_setup_per_cpu_areas() do { } while (0)
#endif /* SMP */ #endif /* SMP */
#include <asm-generic/percpu.h> #include <asm-generic/percpu.h>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/profile.h> #include <linux/profile.h>
#include <linux/lmb.h> #include <linux/bootmem.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <asm/head.h> #include <asm/head.h>
...@@ -1371,9 +1371,9 @@ void smp_send_stop(void) ...@@ -1371,9 +1371,9 @@ void smp_send_stop(void)
{ {
} }
void __init real_setup_per_cpu_areas(void) void __init setup_per_cpu_areas(void)
{ {
unsigned long base, shift, paddr, goal, size, i; unsigned long base, shift, goal, size, i;
char *ptr; char *ptr;
/* Copy section for each CPU (we discard the original) */ /* Copy section for each CPU (we discard the original) */
...@@ -1383,13 +1383,12 @@ void __init real_setup_per_cpu_areas(void) ...@@ -1383,13 +1383,12 @@ void __init real_setup_per_cpu_areas(void)
for (size = PAGE_SIZE; size < goal; size <<= 1UL) for (size = PAGE_SIZE; size < goal; size <<= 1UL)
shift++; shift++;
paddr = lmb_alloc(size * NR_CPUS, PAGE_SIZE); ptr = __alloc_bootmem(size * NR_CPUS, PAGE_SIZE, 0);
if (!paddr) { if (!ptr) {
prom_printf("Cannot allocate per-cpu memory.\n"); prom_printf("Cannot allocate per-cpu memory.\n");
prom_halt(); prom_halt();
} }
ptr = __va(paddr);
base = ptr - __per_cpu_start; base = ptr - __per_cpu_start;
for (i = 0; i < NR_CPUS; i++, ptr += size) { for (i = 0; i < NR_CPUS; i++, ptr += size) {
......
...@@ -1679,11 +1679,6 @@ pgd_t swapper_pg_dir[2048]; ...@@ -1679,11 +1679,6 @@ pgd_t swapper_pg_dir[2048];
static void sun4u_pgprot_init(void); static void sun4u_pgprot_init(void);
static void sun4v_pgprot_init(void); static void sun4v_pgprot_init(void);
/* Dummy function */
void __init setup_per_cpu_areas(void)
{
}
void __init paging_init(void) void __init paging_init(void)
{ {
unsigned long end_pfn, shift, phys_base; unsigned long end_pfn, shift, phys_base;
...@@ -1807,8 +1802,6 @@ void __init paging_init(void) ...@@ -1807,8 +1802,6 @@ void __init paging_init(void)
mdesc_populate_present_mask(CPU_MASK_ALL_PTR); mdesc_populate_present_mask(CPU_MASK_ALL_PTR);
} }
real_setup_per_cpu_areas();
/* Once the OF device tree and MDESC have been setup, we know /* Once the OF device tree and MDESC have been setup, we know
* the list of possible cpus. Therefore we can allocate the * the list of possible cpus. Therefore we can allocate the
* IRQ stacks. * IRQ stacks.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment