aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2016-06-30 11:56:43 -0400
committerDavid Vrabel <david.vrabel@citrix.com>2016-07-25 08:34:23 -0400
commitee42d665d3f5db975caf87baf101a57235ddb566 (patch)
tree340d28824d43040956c1cb17b95d29722d12eab3
parentcbbb4682394c45986a34d8c77a02e7a066e30235 (diff)
xen/pvhvm: run xen_vcpu_setup() for the boot CPU
Historically we didn't call VCPUOP_register_vcpu_info for CPU0 for PVHVM guests (while we had it for PV and ARM guests). This is usually fine as we can use vcpu info in the shared_info page but when we try booting on a vCPU with Xen's vCPU id > 31 (e.g. when we try to kdump after crashing on this CPU) we're not able to boot. Switch to always doing VCPUOP_register_vcpu_info for the boot CPU. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
-rw-r--r--arch/x86/xen/enlighten.c2
-rw-r--r--arch/x86/xen/smp.c7
-rw-r--r--arch/x86/xen/xen-ops.h1
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 5ca92e600a69..85ef4c0442e0 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -184,7 +184,7 @@ static void clamp_max_cpus(void)
184#endif 184#endif
185} 185}
186 186
187static void xen_vcpu_setup(int cpu) 187void xen_vcpu_setup(int cpu)
188{ 188{
189 struct vcpu_register_vcpu_info info; 189 struct vcpu_register_vcpu_info info;
190 int err; 190 int err;
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index a3118f250416..0b4d04c8ab4d 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -322,6 +322,13 @@ static void __init xen_smp_prepare_boot_cpu(void)
322 xen_filter_cpu_maps(); 322 xen_filter_cpu_maps();
323 xen_setup_vcpu_info_placement(); 323 xen_setup_vcpu_info_placement();
324 } 324 }
325
326 /*
327 * Setup vcpu_info for boot CPU.
328 */
329 if (xen_hvm_domain())
330 xen_vcpu_setup(0);
331
325 /* 332 /*
326 * The alternative logic (which patches the unlock/lock) runs before 333 * The alternative logic (which patches the unlock/lock) runs before
327 * the smp bootup up code is activated. Hence we need to set this up 334 * the smp bootup up code is activated. Hence we need to set this up
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 4140b070f2e9..3cbce3b085e7 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -76,6 +76,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
76 76
77bool xen_vcpu_stolen(int vcpu); 77bool xen_vcpu_stolen(int vcpu);
78 78
79void xen_vcpu_setup(int cpu);
79void xen_setup_vcpu_info_placement(void); 80void xen_setup_vcpu_info_placement(void);
80 81
81#ifdef CONFIG_SMP 82#ifdef CONFIG_SMP