Commit 900cba88 authored by Andrew Jones's avatar Andrew Jones Committed by Konrad Rzeszutek Wilk

xen: support CONFIG_MAXSMP

The MAXSMP config option requires CPUMASK_OFFSTACK, which in turn
requires we init the memory for the maps while we bring up the cpus.
MAXSMP also increases NR_CPUS to 4096. This increase in size exposed an
issue in the argument construction for multicalls from
xen_flush_tlb_others. The args should only need space for the actual
number of cpus.

Also in 2.6.39 it exposes a bootup problem.

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [<ffffffff8157a1d3>] set_cpu_sibling_map+0x123/0x30d
...
Call Trace:
[<ffffffff81039a3f>] ? xen_restore_fl_direct_reloc+0x4/0x4
[<ffffffff819dc4db>] xen_smp_prepare_cpus+0x36/0x135
..

CC: stable@kernel.org
Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
[v2: Updated to compile on 3.0]
[v3: Updated to compile when CONFIG_SMP is not defined]
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent a91d9287
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/init.h> #include <asm/init.h>
#include <asm/pat.h> #include <asm/pat.h>
#include <asm/smp.h>
#include <asm/xen/hypercall.h> #include <asm/xen/hypercall.h>
#include <asm/xen/hypervisor.h> #include <asm/xen/hypervisor.h>
...@@ -1231,7 +1232,7 @@ static void xen_flush_tlb_others(const struct cpumask *cpus, ...@@ -1231,7 +1232,7 @@ static void xen_flush_tlb_others(const struct cpumask *cpus,
{ {
struct { struct {
struct mmuext_op op; struct mmuext_op op;
DECLARE_BITMAP(mask, NR_CPUS); DECLARE_BITMAP(mask, num_processors);
} *args; } *args;
struct multicall_space mcs; struct multicall_space mcs;
......
...@@ -205,11 +205,18 @@ static void __init xen_smp_prepare_boot_cpu(void) ...@@ -205,11 +205,18 @@ static void __init xen_smp_prepare_boot_cpu(void)
static void __init xen_smp_prepare_cpus(unsigned int max_cpus) static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
{ {
unsigned cpu; unsigned cpu;
unsigned int i;
xen_init_lock_cpu(0); xen_init_lock_cpu(0);
smp_store_cpu_info(0); smp_store_cpu_info(0);
cpu_data(0).x86_max_cores = 1; cpu_data(0).x86_max_cores = 1;
for_each_possible_cpu(i) {
zalloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL);
zalloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
zalloc_cpumask_var(&per_cpu(cpu_llc_shared_map, i), GFP_KERNEL);
}
set_cpu_sibling_map(0); set_cpu_sibling_map(0);
if (xen_smp_intr_init(0)) if (xen_smp_intr_init(0))
......
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