From 890db403d59fbeaf273ed019d0b1862223d80a9a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 1 Apr 2009 03:13:15 -0700 Subject: sparc: Call OF and MD cpu scanning explicitly from paging_init() We need to split up the cpu present mask setup from the cpu_data initialization, and this is a first step towards that. Signed-off-by: David S. Miller --- arch/sparc/mm/init_64.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/sparc/mm/init_64.c') diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index f26a352c08a..c589d6e6566 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -1806,9 +1806,12 @@ void __init paging_init(void) real_setup_per_cpu_areas(); prom_build_devicetree(); + of_fill_in_cpu_data(); - if (tlb_type == hypervisor) + if (tlb_type == hypervisor) { sun4v_mdesc_init(); + mdesc_fill_in_cpu_data(CPU_MASK_ALL); + } /* Once the OF device tree and MDESC have been setup, we know * the list of possible cpus. Therefore we can allocate the -- cgit v1.2.3 From a2094502dce23e9ace04d49702aa7a4d5996df55 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 1 Apr 2009 03:15:11 -0700 Subject: sparc64: Make mdesc_fill_in_cpu_data take a cpumask_t pointer. Signed-off-by: David S. Miller --- arch/sparc/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sparc/mm/init_64.c') diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index c589d6e6566..87fea94e512 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -1810,7 +1810,7 @@ void __init paging_init(void) if (tlb_type == hypervisor) { sun4v_mdesc_init(); - mdesc_fill_in_cpu_data(CPU_MASK_ALL); + mdesc_fill_in_cpu_data(CPU_MASK_ALL_PTR); } /* Once the OF device tree and MDESC have been setup, we know -- cgit v1.2.3 From b696fdc259f0d94348a9327bed352fac44d4883d Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 26 May 2009 22:37:25 -0700 Subject: sparc64: Defer cpu_data() setup until end of per-cpu data initialization. Signed-off-by: David S. Miller --- arch/sparc/mm/init_64.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'arch/sparc/mm/init_64.c') diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 87fea94e512..785f0a24fcb 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -1799,20 +1799,16 @@ void __init paging_init(void) if (tlb_type == hypervisor) sun4v_ktsb_register(); - /* We must setup the per-cpu areas before we pull in the - * PROM and the MDESC. The code there fills in cpu and - * other information into per-cpu data structures. - */ - real_setup_per_cpu_areas(); - prom_build_devicetree(); - of_fill_in_cpu_data(); + of_populate_present_mask(); if (tlb_type == hypervisor) { sun4v_mdesc_init(); - mdesc_fill_in_cpu_data(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 * the list of possible cpus. Therefore we can allocate the * IRQ stacks. -- cgit v1.2.3 From 73fffc037e2383a0ed126d57bdcda9b369769ae8 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 1 Apr 2009 16:15:20 -0700 Subject: 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 --- arch/sparc/mm/init_64.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'arch/sparc/mm/init_64.c') diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 785f0a24fcb..b5a5932def7 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -1679,11 +1679,6 @@ pgd_t swapper_pg_dir[2048]; static void sun4u_pgprot_init(void); static void sun4v_pgprot_init(void); -/* Dummy function */ -void __init setup_per_cpu_areas(void) -{ -} - void __init paging_init(void) { unsigned long end_pfn, shift, phys_base; @@ -1807,8 +1802,6 @@ void __init paging_init(void) 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 * the list of possible cpus. Therefore we can allocate the * IRQ stacks. -- cgit v1.2.3 From 6ac5c610828c051666f667d2bdbd51fc15a59e98 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 15 Jun 2009 03:06:18 -0700 Subject: sparc: replace uses of CPU_MASK_ALL_PTR CPU_MASK_ALL is the (deprecated) "all bits set" cpumask, defined as so: #define CPU_MASK_ALL (cpumask_t) { { ... } } Taking the address of such a temporary is questionable at best, unfortunately 321a8e9d (cpumask: add CPU_MASK_ALL_PTR macro) added CPU_MASK_ALL_PTR: #define CPU_MASK_ALL_PTR (&CPU_MASK_ALL) Which formalizes this practice. One day gcc could bite us over this usage (though we seem to have gotten away with it so far). [Description by Rusty Russell] Signed-off-by: Stephen Rothwell Signed-off-by: David S. Miller --- arch/sparc/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sparc/mm/init_64.c') diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index b5a5932def7..ca92e2f54e4 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -1799,7 +1799,7 @@ void __init paging_init(void) if (tlb_type == hypervisor) { sun4v_mdesc_init(); - mdesc_populate_present_mask(CPU_MASK_ALL_PTR); + mdesc_populate_present_mask(cpu_all_mask); } /* Once the OF device tree and MDESC have been setup, we know -- cgit v1.2.3