/* Return xen's logical cpu_id of the new added cpu or <0 if error */ static int __devinit MP_processor_info_x(struct mpc_config_processor *m, u32 apicidx) { int ver, apicid, cpu = 0; physid_mask_t phys_cpu; if (!(m->mpc_cpuflag & CPU_ENABLED)) return -EINVAL; apicid = mpc_apic_id(m, apicidx, translation_table[mpc_record]); if (m->mpc_featureflag&(1<<0)) Dprintk(" Floating point unit present.\n"); if (m->mpc_featureflag&(1<<7)) Dprintk(" Machine Exception supported.\n"); if (m->mpc_featureflag&(1<<8)) Dprintk(" 64 bit compare & exchange supported.\n"); if (m->mpc_featureflag&(1<<9)) Dprintk(" Internal APIC present.\n"); if (m->mpc_featureflag&(1<<11)) Dprintk(" SEP present.\n"); if (m->mpc_featureflag&(1<<12)) Dprintk(" MTRR present.\n"); if (m->mpc_featureflag&(1<<13)) Dprintk(" PGE present.\n"); if (m->mpc_featureflag&(1<<14)) Dprintk(" MCA present.\n"); if (m->mpc_featureflag&(1<<15)) Dprintk(" CMOV present.\n"); if (m->mpc_featureflag&(1<<16)) Dprintk(" PAT present.\n"); if (m->mpc_featureflag&(1<<17)) Dprintk(" PSE present.\n"); if (m->mpc_featureflag&(1<<18)) Dprintk(" PSN present.\n"); if (m->mpc_featureflag&(1<<19)) Dprintk(" Cache Line Flush Instruction present.\n"); /* 20 Reserved */ if (m->mpc_featureflag&(1<<21)) Dprintk(" Debug Trace and EMON Store present.\n"); if (m->mpc_featureflag&(1<<22)) Dprintk(" ACPI Thermal Throttle Registers present.\n"); if (m->mpc_featureflag&(1<<23)) Dprintk(" MMX present.\n"); if (m->mpc_featureflag&(1<<24)) Dprintk(" FXSR present.\n"); if (m->mpc_featureflag&(1<<25)) Dprintk(" XMM present.\n"); if (m->mpc_featureflag&(1<<26)) Dprintk(" Willamette New Instructions present.\n"); if (m->mpc_featureflag&(1<<27)) Dprintk(" Self Snoop present.\n"); if (m->mpc_featureflag&(1<<28)) Dprintk(" HT present.\n"); if (m->mpc_featureflag&(1<<29)) Dprintk(" Thermal Monitor present.\n"); /* 30, 31 Reserved */ if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { Dprintk(" Bootup CPU\n"); boot_cpu_physical_apicid = apicid; } ver = m->mpc_apicver; /* * Validate version */ if (ver == 0x0) { printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! " "fixing up to 0x10. (tell your hw vendor)\n", apicid); ver = 0x10; } apic_version[apicid] = ver; phys_cpu = apicid_to_cpu_present(apicid); physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu); if (num_processors >= NR_CPUS) { printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached." " Processor ignored.\n", NR_CPUS); return -ENOSPC; } if (num_processors >= maxcpus) { printk(KERN_WARNING "WARNING: maxcpus limit of %i reached." " Processor ignored.\n", maxcpus); return -ENOSPC; } /* Boot cpu has been marked present in smp_prepare_boot_cpu */ if (!(m->mpc_cpuflag & CPU_BOOTPROCESSOR)) { cpu = alloc_cpu_id(); if (cpu < 0) { printk(KERN_WARNING "WARNING: Can't alloc cpu_id." " Processor with apicid %i ignored\n", apicid); return cpu; } x86_cpu_to_apicid[cpu] = apicid; cpu_set(cpu, cpu_present_map); } if (++num_processors > 8) { /* * No need for processor or APIC checks: physical delivery * (bigsmp) mode should always work. */ def_to_bigsmp = 1; } return cpu; }
/* Return xen's logical cpu_id of the new added cpu or <0 if error */ static int MP_processor_info_x(struct mpc_config_processor *m, u32 apicid, bool hotplug) { int ver, cpu = 0; if (!(m->mpc_cpuflag & CPU_ENABLED)) { if (!hotplug) ++disabled_cpus; return -EINVAL; } if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { Dprintk(" Bootup CPU\n"); boot_cpu_physical_apicid = apicid; } ver = m->mpc_apicver; /* * Validate version */ if (ver == 0x0) { printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! " "fixing up to 0x10. (tell your hw vendor)\n", apicid); ver = 0x10; } apic_version[apicid] = ver; set_apicid(apicid, &phys_cpu_present_map); if (num_processors >= nr_cpu_ids) { printk(KERN_WARNING "WARNING: NR_CPUS limit of %u reached." " Processor ignored.\n", nr_cpu_ids); return -ENOSPC; } if (num_processors >= 8 && hotplug && genapic == &apic_default) { printk(KERN_WARNING "WARNING: CPUs limit of 8 reached." " Processor ignored.\n"); return -ENOSPC; } /* Boot cpu has been marked present in smp_prepare_boot_cpu */ if (!(m->mpc_cpuflag & CPU_BOOTPROCESSOR)) { cpu = alloc_cpu_id(); if (cpu < 0) { printk(KERN_WARNING "WARNING: Can't alloc cpu_id." " Processor with apicid %i ignored\n", apicid); return cpu; } x86_cpu_to_apicid[cpu] = apicid; cpumask_set_cpu(cpu, &cpu_present_map); } if (++num_processors > 8) { /* * No need for processor or APIC checks: physical delivery * (bigsmp) mode should always work. */ def_to_bigsmp = true; } return cpu; }