xen/pvh: Use Xen's emergency_restart op for PVH guests
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Mon, 6 Feb 2017 15:58:06 +0000 (10:58 -0500)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 7 Feb 2017 13:07:01 +0000 (08:07 -0500)
Using native_machine_emergency_restart (called during reboot) will
lead PVH guests to machine_real_restart()  where we try to use
real_mode_header which is not initialized.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
arch/x86/xen/enlighten.c

index 6d406f3465bcf01b4d69ee62ac1784b9ce0acf77..ec1d5c46e58f7cd0719c84686b627e10b7b18dcd 100644 (file)
@@ -1924,6 +1924,9 @@ static void __init xen_hvm_guest_init(void)
        x86_init.irqs.intr_init = xen_init_IRQ;
        xen_hvm_init_time_ops();
        xen_hvm_init_mmu_ops();
+
+       if (xen_pvh_domain())
+               machine_ops.emergency_restart = xen_emergency_restart;
 #ifdef CONFIG_KEXEC_CORE
        machine_ops.shutdown = xen_hvm_shutdown;
        machine_ops.crash_shutdown = xen_hvm_crash_shutdown;