]> www.infradead.org Git - users/dwmw2/qemu.git/commit
i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown
authorJoao Martins <joao.m.martins@oracle.com>
Fri, 20 Jul 2018 19:19:05 +0000 (15:19 -0400)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 30 Jan 2023 18:26:44 +0000 (18:26 +0000)
commita095db4fce20a6b44a34c9541b30d9ac891d0dd8
tree8d405bbc120c7bc4f7c1bceb6da44c9f8b266c92
parentf36181d1db6e786fb687a8f3e2bc15cbf13e0a68
i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown

It allows to shutdown itself via hypercall with any of the 3 reasons:
  1) self-reboot
  2) shutdown
  3) crash

Implementing SCHEDOP_shutdown sub op let us handle crashes gracefully rather
than leading to triple faults if it remains unimplemented.

In addition, the SHUTDOWN_soft_reset reason is used for kexec, to reset
Xen shared pages and other enlightenments and leave a clean slate for the
new kernel without the hypervisor helpfully writing information at
unexpected addresses.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Ditch sched_op_compat which was never available for HVM guests,
        Add SCHEDOP_soft_reset]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
include/sysemu/kvm_xen.h
target/i386/kvm/trace-events
target/i386/kvm/xen-emu.c