* [PATCH 1/2] x86: make voyager_phys_cpu_present_map static unsigned long.
@ 2009-03-11 6:32 Rusty Russell
2009-03-11 16:48 ` James Bottomley
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2009-03-11 6:32 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-kernel, Ingo Molnar
Impact: cleanup, remove cpumask_t
Instead of replacing voyager_phys_cpu_present_map with a cpumask_var_t,
let's make it an unsigned long as assumed in various places anyway.
Also delete incorrect comment on external usage.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
To: James.Bottomley@HansenPartnership.com
---
arch/x86/mach-voyager/voyager_smp.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@ -63,9 +63,8 @@ static int voyager_extended_cpus = 1;
/* Used for the invalidate map that's also checked in the spinlock */
static volatile unsigned long smp_invalidate_needed;
-/* Bitmask of CPUs present in the system - exported by i386_syms.c, used
- * by scheduler but indexed physically */
-static cpumask_t voyager_phys_cpu_present_map = CPU_MASK_NONE;
+/* Set from extended CMOS in find_smp_config */
+static unsigned long voyager_phys_cpu_present_map;
/* The internal functions */
static void send_CPI(__u32 cpuset, __u8 cpi);
@@ -349,6 +348,7 @@ void __init find_smp_config(void)
void __init find_smp_config(void)
{
int i;
+ unsigned long present;
boot_cpu_id = hard_smp_processor_id();
@@ -366,19 +366,24 @@ void __init find_smp_config(void)
/* set up everything for just this CPU, we can alter
* this as we start the other CPUs later */
/* now get the CPU disposition from the extended CMOS */
- cpus_addr(voyager_phys_cpu_present_map)[0] =
+ voyager_phys_cpu_present_map =
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK);
- cpus_addr(voyager_phys_cpu_present_map)[0] |=
+ voyager_phys_cpu_present_map |=
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8;
- cpus_addr(voyager_phys_cpu_present_map)[0] |=
+ voyager_phys_cpu_present_map |=
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
2) << 16;
- cpus_addr(voyager_phys_cpu_present_map)[0] |=
+ voyager_phys_cpu_present_map |=
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
3) << 24;
- init_cpu_possible(&voyager_phys_cpu_present_map);
+ for (i = 0; i < 32; i++) {
+ if (test_bit(i, &voyager_phys_cpu_present_map))
+ set_cpu_possible(i, true);
+ }
+
printk("VOYAGER SMP: voyager_phys_cpu_present_map = 0x%lx\n",
- cpus_addr(voyager_phys_cpu_present_map)[0]);
+ voyager_phys_cpu_present_map);
+
/* Here we set up the VIC to enable SMP */
/* enable the CPIs by writing the base vector to their register */
outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER);
@@ -628,15 +633,14 @@ void __init smp_boot_cpus(void)
/* now that the cat has probed the Voyager System Bus, sanity
* check the cpu map */
if (((voyager_quad_processors | voyager_extended_vic_processors)
- & cpus_addr(voyager_phys_cpu_present_map)[0]) !=
- cpus_addr(voyager_phys_cpu_present_map)[0]) {
+ & voyager_phys_cpu_present_map) !=
+ voyager_phys_cpu_present_map) {
/* should panic */
printk("\n\n***WARNING*** "
"Sanity check of CPU present map FAILED\n");
}
} else if (voyager_level == 4)
- voyager_extended_vic_processors =
- cpus_addr(voyager_phys_cpu_present_map)[0];
+ voyager_extended_vic_processors = voyager_phys_cpu_present_map;
/* this sets up the idle task to run on the current cpu */
voyager_extended_cpus = 1;
@@ -670,7 +674,7 @@ void __init smp_boot_cpus(void)
/* loop over all the extended VIC CPUs and boot them. The
* Quad CPUs must be bootstrapped by their extended VIC cpu */
for (i = 0; i < nr_cpu_ids; i++) {
- if (i == boot_cpu_id || !cpu_isset(i, voyager_phys_cpu_present_map))
+ if (i == boot_cpu_id || !test_bit(i, &voyager_phys_cpu_present_map))
continue;
do_boot_cpu(i);
/* This udelay seems to be needed for the Quad boots
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] x86: make voyager_phys_cpu_present_map static unsigned long.
2009-03-11 6:32 [PATCH 1/2] x86: make voyager_phys_cpu_present_map static unsigned long Rusty Russell
@ 2009-03-11 16:48 ` James Bottomley
0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2009-03-11 16:48 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel, Ingo Molnar
On Wed, 2009-03-11 at 17:02 +1030, Rusty Russell wrote:
> Impact: cleanup, remove cpumask_t
>
> Instead of replacing voyager_phys_cpu_present_map with a cpumask_var_t,
> let's make it an unsigned long as assumed in various places anyway.
>
> Also delete incorrect comment on external usage.
Yes, this looks good. Having it as a cpumask_t was really a historical
artifact from the time when phys_cpu_present_map was an expected
subarchitecture export.
James
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-11 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-11 6:32 [PATCH 1/2] x86: make voyager_phys_cpu_present_map static unsigned long Rusty Russell
2009-03-11 16:48 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®