forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
- Loading branch information
Showing
14 changed files
with
318 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
obj-y := enlighten.o setup.o multicalls.o mmu.o \ | ||
time.o xen-asm.o grant-table.o | ||
time.o xen-asm.o grant-table.o suspend.o | ||
|
||
obj-$(CONFIG_SMP) += smp.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <linux/types.h> | ||
|
||
#include <xen/interface/xen.h> | ||
#include <xen/grant_table.h> | ||
#include <xen/events.h> | ||
|
||
#include <asm/xen/hypercall.h> | ||
#include <asm/xen/page.h> | ||
|
||
#include "xen-ops.h" | ||
#include "mmu.h" | ||
|
||
void xen_pre_suspend(void) | ||
{ | ||
xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn); | ||
xen_start_info->console.domU.mfn = | ||
mfn_to_pfn(xen_start_info->console.domU.mfn); | ||
|
||
BUG_ON(!irqs_disabled()); | ||
|
||
HYPERVISOR_shared_info = &xen_dummy_shared_info; | ||
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP), | ||
__pte_ma(0), 0)) | ||
BUG(); | ||
} | ||
|
||
void xen_post_suspend(int suspend_cancelled) | ||
{ | ||
if (suspend_cancelled) { | ||
xen_start_info->store_mfn = | ||
pfn_to_mfn(xen_start_info->store_mfn); | ||
xen_start_info->console.domU.mfn = | ||
pfn_to_mfn(xen_start_info->console.domU.mfn); | ||
} else { | ||
#ifdef CONFIG_SMP | ||
xen_cpu_initialized_map = cpu_online_map; | ||
#endif | ||
} | ||
|
||
xen_setup_shared_info(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.