diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0094-xen-smp-Fix-crash-when-booting-with-ACPI-hotplug-CPU.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0094-xen-smp-Fix-crash-when-booting-with-ACPI-hotplug-CPU.patch | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0094-xen-smp-Fix-crash-when-booting-with-ACPI-hotplug-CPU.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0094-xen-smp-Fix-crash-when-booting-with-ACPI-hotplug-CPU.patch new file mode 100644 index 00000000..02b157fc --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0094-xen-smp-Fix-crash-when-booting-with-ACPI-hotplug-CPU.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From 7e7b9fb05d7e36d2d585a422de52c3b2e3345cdf Mon Sep 17 00:00:00 2001 | ||
2 | From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
3 | Date: Thu, 26 Apr 2012 13:50:03 -0400 | ||
4 | Subject: [PATCH 094/165] xen/smp: Fix crash when booting with ACPI hotplug | ||
5 | CPUs. | ||
6 | |||
7 | commit cf405ae612b0f7e2358db7ff594c0e94846137aa upstream. | ||
8 | |||
9 | When we boot on a machine that can hotplug CPUs and we | ||
10 | are using 'dom0_max_vcpus=X' on the Xen hypervisor line | ||
11 | to clip the amount of CPUs available to the initial domain, | ||
12 | we get this: | ||
13 | |||
14 | (XEN) Command line: com1=115200,8n1 dom0_mem=8G noreboot dom0_max_vcpus=8 sync_console mce_verbosity=verbose console=com1,vga loglvl=all guest_loglvl=all | ||
15 | .. snip.. | ||
16 | DMI: Intel Corporation S2600CP/S2600CP, BIOS SE5C600.86B.99.99.x032.072520111118 07/25/2011 | ||
17 | .. snip. | ||
18 | SMP: Allowing 64 CPUs, 32 hotplug CPUs | ||
19 | installing Xen timer for CPU 7 | ||
20 | cpu 7 spinlock event irq 361 | ||
21 | NMI watchdog: disabled (cpu7): hardware events not enabled | ||
22 | Brought up 8 CPUs | ||
23 | .. snip.. | ||
24 | [acpi processor finds the CPUs are not initialized and starts calling | ||
25 | arch_register_cpu, which creates /sys/devices/system/cpu/cpu8/online] | ||
26 | CPU 8 got hotplugged | ||
27 | CPU 9 got hotplugged | ||
28 | CPU 10 got hotplugged | ||
29 | .. snip.. | ||
30 | initcall 1_acpi_battery_init_async+0x0/0x1b returned 0 after 406 usecs | ||
31 | calling erst_init+0x0/0x2bb @ 1 | ||
32 | |||
33 | [and the scheduler sticks newly started tasks on the new CPUs, but | ||
34 | said CPUs cannot be initialized b/c the hypervisor has limited the | ||
35 | amount of vCPUS to 8 - as per the dom0_max_vcpus=8 flag. | ||
36 | The spinlock tries to kick the other CPU, but the structure for that | ||
37 | is not initialized and we crash.] | ||
38 | BUG: unable to handle kernel paging request at fffffffffffffed8 | ||
39 | IP: [<ffffffff81035289>] xen_spin_lock+0x29/0x60 | ||
40 | PGD 180d067 PUD 180e067 PMD 0 | ||
41 | Oops: 0002 [#1] SMP | ||
42 | CPU 7 | ||
43 | Modules linked in: | ||
44 | |||
45 | Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc2upstream-00001-gf5154e8 #1 Intel Corporation S2600CP/S2600CP | ||
46 | RIP: e030:[<ffffffff81035289>] [<ffffffff81035289>] xen_spin_lock+0x29/0x60 | ||
47 | RSP: e02b:ffff8801fb9b3a70 EFLAGS: 00010282 | ||
48 | |||
49 | With this patch, we cap the amount of vCPUS that the initial domain | ||
50 | can run, to exactly what dom0_max_vcpus=X has specified. | ||
51 | |||
52 | In the future, if there is a hypercall that will allow a running | ||
53 | domain to expand past its initial set of vCPUS, this patch should | ||
54 | be re-evaluated. | ||
55 | |||
56 | Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
57 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
58 | --- | ||
59 | arch/x86/xen/smp.c | 15 +++++++++++++++ | ||
60 | 1 files changed, 15 insertions(+), 0 deletions(-) | ||
61 | |||
62 | diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c | ||
63 | index 041d4fe..9a23fff 100644 | ||
64 | --- a/arch/x86/xen/smp.c | ||
65 | +++ b/arch/x86/xen/smp.c | ||
66 | @@ -172,6 +172,7 @@ static void __init xen_fill_possible_map(void) | ||
67 | static void __init xen_filter_cpu_maps(void) | ||
68 | { | ||
69 | int i, rc; | ||
70 | + unsigned int subtract = 0; | ||
71 | |||
72 | if (!xen_initial_domain()) | ||
73 | return; | ||
74 | @@ -186,8 +187,22 @@ static void __init xen_filter_cpu_maps(void) | ||
75 | } else { | ||
76 | set_cpu_possible(i, false); | ||
77 | set_cpu_present(i, false); | ||
78 | + subtract++; | ||
79 | } | ||
80 | } | ||
81 | +#ifdef CONFIG_HOTPLUG_CPU | ||
82 | + /* This is akin to using 'nr_cpus' on the Linux command line. | ||
83 | + * Which is OK as when we use 'dom0_max_vcpus=X' we can only | ||
84 | + * have up to X, while nr_cpu_ids is greater than X. This | ||
85 | + * normally is not a problem, except when CPU hotplugging | ||
86 | + * is involved and then there might be more than X CPUs | ||
87 | + * in the guest - which will not work as there is no | ||
88 | + * hypercall to expand the max number of VCPUs an already | ||
89 | + * running guest has. So cap it up to X. */ | ||
90 | + if (subtract) | ||
91 | + nr_cpu_ids = nr_cpu_ids - subtract; | ||
92 | +#endif | ||
93 | + | ||
94 | } | ||
95 | |||
96 | static void __init xen_smp_prepare_boot_cpu(void) | ||
97 | -- | ||
98 | 1.7.7.6 | ||
99 | |||