{
int i, clusters, zeros;
unsigned id;
+ u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
for (i = 0; i < NR_CPUS; i++) {
/* are we being called early in kernel startup? */
- if (x86_bios_cpu_apicid_early_ptr) {
- id = ((u16 *)x86_bios_cpu_apicid_early_ptr)[i];
+ if (bios_cpu_apicid) {
+ id = bios_cpu_apicid[i];
}
else if (i < nr_cpu_ids) {
if (cpu_present(i))
physid_set(m->mpc_apicid, phys_cpu_present_map);
if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
/*
- * x86_bios_cpu_apicid is required to have processors listed
+ * x86_bios_cpu_apicid is required to have processors listed
* in same order as logical cpu numbers. Hence the first
* entry is BSP, and so on.
*/
}
/* are we being called early in kernel startup? */
if (x86_cpu_to_apicid_early_ptr) {
- u16 *cpu_to_apicid = (u16 *)x86_cpu_to_apicid_early_ptr;
- u16 *bios_cpu_apicid = (u16 *)x86_bios_cpu_apicid_early_ptr;
+ u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
+ u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
cpu_to_apicid[cpu] = m->mpc_apicid;
bios_cpu_apicid[cpu] = m->mpc_apicid;
void __cpuinit numa_set_node(int cpu, int node)
{
- u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr;
+ u16 *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;
cpu_pda(cpu)->nodenumber = node;
/* First clean up the node list */
for (i = 0; i < MAX_NUMNODES; i++) {
cutoff_node(i, start, end);
- /* ZZZ why was this needed. At least add a comment */
- if (nodes[i].end && (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
+ /*
+ * don't confuse VM with a node that doesn't have the
+ * minimum memory.
+ */
+ if (nodes[i].end &&
+ (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
unparse_node(i);
node_set_offline(i);
}
/* Returns the number of the node containing CPU 'cpu' */
static inline int cpu_to_node(int cpu)
{
- u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr;
+ u16 *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;
if (cpu_to_node_map)
return cpu_to_node_map[cpu];