aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/mpparse.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2010-12-15 11:52:14 +0000
committerKeir Fraser <keir@xen.org>2010-12-15 11:52:14 +0000
commit06e127fc275cd524a0f1dc8e2fa974de46619c10 (patch)
tree5e977d91b0ef7c0c7262b56ead3e643db217a8fb /xen/arch/x86/mpparse.c
parentbc14e5d1e010afad8b8b93ec462088e1d271ce8e (diff)
downloadxen-06e127fc275cd524a0f1dc8e2fa974de46619c10.tar.gz
xen-06e127fc275cd524a0f1dc8e2fa974de46619c10.tar.bz2
xen-06e127fc275cd524a0f1dc8e2fa974de46619c10.zip
x86: mpparse and cstate need to use 32bit apic id
Instead of going with mpc_config_processor struct. that field ony have 8 bits. We should not change that struct, because it is shared with mptable. Also need to increase MAX_APICS. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Rather than using a fixed value of 512, make this scale with NR_CPUS (which obviously still doesn't cover all theoretically possible systems, but at least allows some build time control). Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/mpparse.c')
-rw-r--r--xen/arch/x86/mpparse.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 2a41df8535..b64f9cc2c7 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -99,7 +99,8 @@ static int mpc_record;
static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __initdata;
/* Return xen's logical cpu_id of the new added cpu or <0 if error */
-static int __devinit MP_processor_info (struct mpc_config_processor *m)
+static int __devinit MP_processor_info_x(struct mpc_config_processor *m,
+ u32 apicidx)
{
int ver, apicid, cpu = 0;
physid_mask_t phys_cpu;
@@ -107,7 +108,7 @@ static int __devinit MP_processor_info (struct mpc_config_processor *m)
if (!(m->mpc_cpuflag & CPU_ENABLED))
return -EINVAL;
- apicid = mpc_apic_id(m, translation_table[mpc_record]);
+ apicid = mpc_apic_id(m, apicidx, translation_table[mpc_record]);
if (m->mpc_featureflag&(1<<0))
Dprintk(" Floating point unit present.\n");
@@ -159,7 +160,7 @@ static int __devinit MP_processor_info (struct mpc_config_processor *m)
if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
Dprintk(" Bootup CPU\n");
- boot_cpu_physical_apicid = m->mpc_apicid;
+ boot_cpu_physical_apicid = apicid;
}
ver = m->mpc_apicver;
@@ -170,10 +171,10 @@ static int __devinit MP_processor_info (struct mpc_config_processor *m)
if (ver == 0x0) {
printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! "
"fixing up to 0x10. (tell your hw vendor)\n",
- m->mpc_apicid);
+ apicid);
ver = 0x10;
}
- apic_version[m->mpc_apicid] = ver;
+ apic_version[apicid] = ver;
phys_cpu = apicid_to_cpu_present(apicid);
physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
@@ -213,6 +214,11 @@ static int __devinit MP_processor_info (struct mpc_config_processor *m)
return cpu;
}
+static int __devinit MP_processor_info(struct mpc_config_processor *m)
+{
+ return MP_processor_info_x(m, m->mpc_apicid);
+}
+
static void __init MP_bus_info (struct mpc_config_bus *m)
{
char str[7];
@@ -839,7 +845,7 @@ int __devinit mp_register_lapic (
struct mpc_config_processor processor;
int boot_cpu = 0;
- if (MAX_APICS - id <= 0) {
+ if (MAX_APICS <= id) {
printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
id, MAX_APICS);
return -EINVAL;
@@ -859,7 +865,7 @@ int __devinit mp_register_lapic (
processor.mpc_reserved[0] = 0;
processor.mpc_reserved[1] = 0;
- return MP_processor_info(&processor);
+ return MP_processor_info_x(&processor, id);
}
void mp_unregister_lapic(uint32_t apic_id, uint32_t cpu)