Commit a8123da8 authored by Andrew Morton's avatar Andrew Morton Committed by Anton Blanchard

[PATCH] fix apic handling for NUMA-Q

From: "Martin J. Bligh" <mbligh@aracnet.com>

All this fancy stuff in cpu_mask_to_apicid doesn't work for NUMA-Q, because
it's based on logical apicids, and we use physical.  Drop back to just
always returning 0xF instead, which is the broadcast physical ID, and has
been working fine since the dawn of time.
parent c6254c88
...@@ -107,37 +107,13 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) ...@@ -107,37 +107,13 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
return (1); return (1);
} }
/*
* We use physical apicids here, not logical, so just return the default
* physical broadcast to stop people from breaking us
*/
static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask) static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask)
{ {
int num_bits_set; return (int) 0xF;
int cpus_found = 0;
int cpu;
int apicid;
num_bits_set = hweight32(cpumask);
/* Return id to all */
if (num_bits_set == 32)
return (int) 0xFF;
/*
* The cpus in the mask must all be on the apic cluster. If are not
* on the same apicid cluster return default value of TARGET_CPUS.
*/
cpu = ffs(cpumask)-1;
apicid = cpu_to_logical_apicid(cpu);
while (cpus_found < num_bits_set) {
if (cpumask & (1 << cpu)) {
int new_apicid = cpu_to_logical_apicid(cpu);
if (apicid_cluster(apicid) !=
apicid_cluster(new_apicid)){
printk ("%s: Not a valid mask!\n",__FUNCTION__);
return TARGET_CPUS;
}
apicid = apicid | new_apicid;
cpus_found++;
}
cpu++;
}
return apicid;
} }
#endif /* __ASM_MACH_APIC_H */ #endif /* __ASM_MACH_APIC_H */
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