kexec: extend hypercall with improved load/unload ops
authorDavid Vrabel <david.vrabel@citrix.com>
Tue, 12 Nov 2013 10:44:41 +0000 (11:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Nov 2013 10:44:41 +0000 (11:44 +0100)
commit5a82d5cf352d8693a6088763ea7ab2f1a0983d71
treee63353cb3becae231794c0f79b64450ed35a86f2
parent9ee51c59d74168ff28b8c5a311d9c17c53f7fe6b
kexec: extend hypercall with improved load/unload ops

In the existing kexec hypercall, the load and unload ops depend on
internals of the Linux kernel (the page list and code page provided by
the kernel).  The code page is used to transition between Xen context
and the image so using kernel code doesn't make sense and will not
work for PVH guests.

Add replacement KEXEC_CMD_kexec_load and KEXEC_CMD_kexec_unload ops
that no longer require a code page to be provided by the guest -- Xen
now provides the code for calling the image directly.

The new load op looks similar to the Linux kexec_load system call and
allows the guest to provide the image data to be loaded.  The guest
specifies the architecture of the image which may be a 32-bit subarch
of the hypervisor's architecture (i.e., an EM_386 image on an
EM_X86_64 hypervisor).

The toolstack can now load images without kernel involvement.  This is
required for supporting kexec when using a dom0 with an upstream
kernel.

Crash images are copied directly into the crash region on load.
Default images are copied into domheap pages and a list of source and
destination machine addresses is created.  This is list is used in
kexec_reloc() to relocate the image to its destination.

The old load and unload sub-ops are still available (as
KEXEC_CMD_load_v1 and KEXEC_CMD_unload_v1) and are implemented on top
of the new infrastructure.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Don Slutz <dslutz@verizon.com>
Tested-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/machine_kexec.c
xen/arch/x86/x86_64/Makefile
xen/arch/x86/x86_64/compat_kexec.S [deleted file]
xen/arch/x86/x86_64/kexec_reloc.S [new file with mode: 0644]
xen/common/kexec.c
xen/common/kimage.c
xen/include/asm-x86/fixmap.h
xen/include/asm-x86/machine_kexec.h [new file with mode: 0644]
xen/include/xen/kexec.h
xen/include/xen/kimage.h