diff options
author | Keir Fraser <keir@xen.org> | 2010-12-15 11:55:48 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2010-12-15 11:55:48 +0000 |
commit | 613407d5903e76e51f3573b3a465b064cb390331 (patch) | |
tree | 0a706d4769d40163eef83a1822e262e637cd7b92 /xen/arch/x86/smpboot.c | |
parent | 06e127fc275cd524a0f1dc8e2fa974de46619c10 (diff) | |
download | xen-613407d5903e76e51f3573b3a465b064cb390331.tar.gz xen-613407d5903e76e51f3573b3a465b064cb390331.tar.bz2 xen-613407d5903e76e51f3573b3a465b064cb390331.zip |
x86: increase MAX_LOCAL_APIC
otherwise apicid_to_node[MAX_LOCAL_APIC] will be overrun if apicid >
255. After patch, the mapping get right.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Make this and also MAX_MADT_ENTRIES loosely depend on NR_CPUS. Tie
MAX_APICS to MAX_LOCAL_APIC. Fix initializer of x86_acpiid_to_apicid[]
to match the array member type of u32, as well as all checks in
readers of this array and x86_cpu_to_apicid[].
While the adjustment to xen_vcpu_physid_to_x86_{acpi,apic}id() is not
backward compatible, I think it should still be done this way as the
former reserving of values beyond 0xff should never have been part of
the interface. If considered impossible, a second best solution would
appear to be to make the macros depend on __XEN_INTERFACE_VERSION__.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/smpboot.c')
-rw-r--r-- | xen/arch/x86/smpboot.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 40b60ae746..e5fc896363 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -67,7 +67,8 @@ EXPORT_SYMBOL(cpu_online_map); struct cpuinfo_x86 cpu_data[NR_CPUS]; -u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = -1U }; +u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly = + { [0 ... NR_CPUS-1] = BAD_APICID }; static void map_cpu_to_logical_apicid(void); @@ -882,7 +883,7 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm) return -EBUSY; /* Detect if the cpu has been added before */ - if ( x86_acpiid_to_apicid[acpi_id] != 0xff ) + if ( x86_acpiid_to_apicid[acpi_id] != BAD_APICID ) { cpu = (x86_acpiid_to_apicid[acpi_id] != apic_id) ? -EINVAL : -EEXIST; @@ -906,7 +907,7 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm) { dprintk(XENLOG_WARNING, "Setup node failed for pxm %x\n", pxm); - x86_acpiid_to_apicid[acpi_id] = 0xff; + x86_acpiid_to_apicid[acpi_id] = BAD_APICID; mp_unregister_lapic(apic_id, cpu); cpu = node; goto out; |