xen: implement save/restore
commit0e91398f2a5d4eb6b07df8115917d0d1cf3e9b58
authorJeremy Fitzhardinge <jeremy@goop.org>
Mon, 26 May 2008 22:31:27 +0000 (26 23:31 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 27 May 2008 08:11:38 +0000 (27 10:11 +0200)
treec6a3b31b7bcbbfb55bb2304d8651abdd28cdad54
parent7d88d32a4670af583c896e5ecd3929b78538ca62
xen: implement save/restore

This patch implements Xen save/restore and migration.

Saving is triggered via xenbus, which is polled in
drivers/xen/manage.c.  When a suspend request comes in, the kernel
prepares itself for saving by:

1 - Freeze all processes.  This is primarily to prevent any
    partially-completed pagetable updates from confusing the suspend
    process.  If CONFIG_PREEMPT isn't defined, then this isn't necessary.

2 - Suspend xenbus and other devices

3 - Stop_machine, to make sure all the other vcpus are quiescent.  The
    Xen tools require the domain to run its save off vcpu0.

4 - Within the stop_machine state, it pins any unpinned pgds (under
    construction or destruction), performs canonicalizes various other
    pieces of state (mostly converting mfns to pfns), and finally

5 - Suspend the domain

Restore reverses the steps used to save the domain, ending when all
the frozen processes are thawed.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 files changed:
arch/x86/xen/Makefile
arch/x86/xen/enlighten.c
arch/x86/xen/mmu.c
arch/x86/xen/smp.c
arch/x86/xen/suspend.c [new file with mode: 0644]
arch/x86/xen/time.c
arch/x86/xen/xen-ops.h
drivers/xen/events.c
drivers/xen/grant-table.c
drivers/xen/manage.c
include/linux/page-flags.h
include/xen/events.h
include/xen/grant_table.h
include/xen/xen-ops.h