]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen/pvhvm: run xen_vcpu_setup() for the boot CPU
authorVitaly Kuznetsov <vkuznets@redhat.com>
Thu, 30 Jun 2016 15:56:43 +0000 (17:56 +0200)
committerBob Liu <bob.liu@oracle.com>
Thu, 20 Oct 2016 08:03:35 +0000 (04:03 -0400)
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>
(cherry picked from commit ee42d665d3f5db975caf87baf101a57235ddb566)
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Orabug: 24820937

arch/x86/xen/enlighten.c
arch/x86/xen/smp.c
arch/x86/xen/xen-ops.h

index 706eef560b4f722f0f975a41da7195e79cb2bbe3..1aa26c1c48d99f304fdf4da8c356ab723885620c 100644 (file)
@@ -184,7 +184,7 @@ static void clamp_max_cpus(void)
 #endif
 }
 
-static void xen_vcpu_setup(int cpu)
+void xen_vcpu_setup(int cpu)
 {
        struct vcpu_register_vcpu_info info;
        int err;
index 182f7f6e9a2e850e996f7368c388fd01bb07e1a2..38ecdee525ebb7b78525f5beeed3e3fea0629799 100644 (file)
@@ -326,6 +326,13 @@ static void __init xen_smp_prepare_boot_cpu(void)
                apic_pm_deactivate();
 #endif
        }
+
+       /*
+        * Setup vcpu_info for boot CPU.
+        */
+       if (xen_hvm_domain())
+               xen_vcpu_setup(0);
+
        /*
         * The alternative logic (which patches the unlock/lock) runs before
         * the smp bootup up code is activated. Hence we need to set this up
index e8ae8536c3327107247d6772774790bff252e76a..8defcdd4b06d77150d398b30f433ec94999f0b7b 100644 (file)
@@ -76,6 +76,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
 
 bool xen_vcpu_stolen(int vcpu);
 
+void xen_vcpu_setup(int cpu);
 void xen_setup_vcpu_info_placement(void);
 
 #ifdef CONFIG_SMP