Commit 36b401e2 authored by Ian Campbell's avatar Ian Campbell Committed by Stefano Stabellini

xen: suspend: pass extra hypercall argument via suspend_info struct

Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent ceb18029
...@@ -36,6 +36,7 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID; ...@@ -36,6 +36,7 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID;
struct suspend_info { struct suspend_info {
int cancelled; int cancelled;
unsigned long arg; /* extra hypercall argument */
}; };
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
...@@ -58,7 +59,7 @@ static int xen_hvm_suspend(void *data) ...@@ -58,7 +59,7 @@ static int xen_hvm_suspend(void *data)
* or the domain was merely checkpointed, and 0 if it * or the domain was merely checkpointed, and 0 if it
* is resuming in a new domain. * is resuming in a new domain.
*/ */
si->cancelled = HYPERVISOR_suspend(0UL); si->cancelled = HYPERVISOR_suspend(si->arg);
xen_hvm_post_suspend(si->cancelled); xen_hvm_post_suspend(si->cancelled);
gnttab_resume(); gnttab_resume();
...@@ -97,7 +98,7 @@ static int xen_suspend(void *data) ...@@ -97,7 +98,7 @@ static int xen_suspend(void *data)
* or the domain was merely checkpointed, and 0 if it * or the domain was merely checkpointed, and 0 if it
* is resuming in a new domain. * is resuming in a new domain.
*/ */
si->cancelled = HYPERVISOR_suspend(virt_to_mfn(xen_start_info)); si->cancelled = HYPERVISOR_suspend(si->arg);
xen_post_suspend(si->cancelled); xen_post_suspend(si->cancelled);
gnttab_resume(); gnttab_resume();
...@@ -149,6 +150,11 @@ static void do_suspend(void) ...@@ -149,6 +150,11 @@ static void do_suspend(void)
si.cancelled = 1; si.cancelled = 1;
if (xen_hvm_domain())
si.arg = 0UL;
else
si.arg = virt_to_mfn(xen_start_info);
if (xen_hvm_domain()) if (xen_hvm_domain())
err = stop_machine(xen_hvm_suspend, &si, cpumask_of(0)); err = stop_machine(xen_hvm_suspend, &si, cpumask_of(0));
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment