Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Vitaly Kuznetsov and committed by
David Vrabel
ee42d665 cbbb4682

+9 -1
+1 -1
arch/x86/xen/enlighten.c
··· 184 184 #endif 185 185 } 186 186 187 - static void xen_vcpu_setup(int cpu) 187 + void xen_vcpu_setup(int cpu) 188 188 { 189 189 struct vcpu_register_vcpu_info info; 190 190 int err;
+7
arch/x86/xen/smp.c
··· 322 322 xen_filter_cpu_maps(); 323 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 333 * The alternative logic (which patches the unlock/lock) runs before 327 334 * the smp bootup up code is activated. Hence we need to set this up
+1
arch/x86/xen/xen-ops.h
··· 76 76 77 77 bool xen_vcpu_stolen(int vcpu); 78 78 79 + void xen_vcpu_setup(int cpu); 79 80 void xen_setup_vcpu_info_placement(void); 80 81 81 82 #ifdef CONFIG_SMP