xen-devel
[Xen-devel] [PATCH 08/11] xen: suspend: refactor non-arch specific pre/p
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
drivers/xen/manage.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 7783722..f61c155 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -39,6 +39,23 @@ struct suspend_info {
unsigned long arg; /* extra hypercall argument */
};
+static void xen_hvm_post_suspend(void)
+{
+ gnttab_resume();
+}
+
+static void xen_pre_suspend(void)
+{
+ xen_mm_pin_all();
+ gnttab_suspend();
+}
+
+static void xen_post_suspend(void)
+{
+ gnttab_resume();
+ xen_mm_unpin_all();
+}
+
#ifdef CONFIG_PM_SLEEP
static int xen_hvm_suspend(void *data)
{
@@ -62,7 +79,7 @@ static int xen_hvm_suspend(void *data)
si->cancelled = HYPERVISOR_suspend(si->arg);
xen_arch_hvm_post_suspend(si->cancelled);
- gnttab_resume();
+ xen_hvm_post_suspend();
if (!si->cancelled) {
xen_irq_resume();
@@ -89,8 +106,7 @@ static int xen_suspend(void *data)
return err;
}
- xen_mm_pin_all();
- gnttab_suspend();
+ xen_pre_suspend();
xen_arch_pre_suspend();
/*
@@ -101,8 +117,7 @@ static int xen_suspend(void *data)
si->cancelled = HYPERVISOR_suspend(si->arg);
xen_arch_post_suspend(si->cancelled);
- gnttab_resume();
- xen_mm_unpin_all();
+ xen_post_suspend();
if (!si->cancelled) {
xen_irq_resume();
--
1.5.6.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] Re: [PATCH] xen: suspend and resume system devices when running PVHVM, (continued)
[Xen-devel] [PATCH 0/11] suspend cleanups, refactoring and fixes (Was: Re: [PATCH] xen: suspend and resume system devices when running PVHVM), Ian Campbell
- [Xen-devel] [PATCH 01/11] xen: do not respond to unknown xenstore control requests, Ian Campbell
- [Xen-devel] [PATCH 02/11] xen: use new schedop interface for suspend, Ian Campbell
- [Xen-devel] [PATCH 03/11] xen: switch to new schedop hypercall by default., Ian Campbell
- [Xen-devel] [PATCH 04/11] xen: suspend: use HYPERVISOR_suspend for PVHVM case instead of open coding, Ian Campbell
- [Xen-devel] [PATCH 05/11] xen: suspend: refactor cancellation flag into a structure, Ian Campbell
- [Xen-devel] [PATCH 06/11] xen: suspend: pass extra hypercall argument via suspend_info struct, Ian Campbell
- [Xen-devel] [PATCH 07/11] xen: suspend: add "arch" to pre/post suspend hooks, Ian Campbell
- [Xen-devel] [PATCH 08/11] xen: suspend: refactor non-arch specific pre/post suspend hooks,
Ian Campbell <=
- [Xen-devel] [PATCH 09/11] xen: suspend: move arch specific pre/post suspend hooks into generic hooks, Ian Campbell
- [Xen-devel] [PATCH 10/11] xen: suspend: pull pre/post suspend hooks out into suspend_info, Ian Campbell
- [Xen-devel] [PATCH 11/11] xen: suspend: remove xen_hvm_suspend, Ian Campbell
- [Xen-devel] Re: [PATCH 0/11] suspend cleanups, refactoring and fixes (Was: Re: [PATCH] xen: suspend and resume system devices when running PVHVM), Stefano Stabellini
- [Xen-devel] Re: [PATCH 0/11] suspend cleanups, refactoring and fixes (Was: Re: [PATCH] xen: suspend and resume system devices when running PVHVM), Ian Campbell
- [Xen-devel] Re: [PATCH 0/11] suspend cleanups, refactoring and fixes (Was: Re: [PATCH] xen: suspend and resume system devices when running PVHVM), Stefano Stabellini
Re: [Xen-devel] [PATCH 0/11] suspend cleanups, refactoring and fixes (Was: Re: [PATCH] xen: suspend and resume system devices when running PVHVM), Konrad Rzeszutek Wilk
Re: [Xen-devel] [PATCH] xen: suspend and resume system devices when running PVHVM, Shriram Rajagopalan
[Xen-devel] [PATCH] xen: suspend and resume system devices when running PVHVM, Ian Campbell
|
|
|