diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-02-17 06:04:20 -0500 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2011-02-25 11:43:11 -0500 |
commit | 36b401e2c2788c7b4881115ddbbff603fe4cf78d (patch) | |
tree | b6e3a794e84619d661ebd1d01216ce7dbe9d2e83 /drivers/xen | |
parent | ceb180294790c8a6a437533488616f6b591b49d0 (diff) |
xen: suspend: pass extra hypercall argument via suspend_info struct
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/manage.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 5c0184fb9d84..6ce6b91e7645 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -36,6 +36,7 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID; | |||
36 | 36 | ||
37 | struct suspend_info { | 37 | struct suspend_info { |
38 | int cancelled; | 38 | int cancelled; |
39 | unsigned long arg; /* extra hypercall argument */ | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | #ifdef CONFIG_PM_SLEEP | 42 | #ifdef CONFIG_PM_SLEEP |
@@ -58,7 +59,7 @@ static int xen_hvm_suspend(void *data) | |||
58 | * or the domain was merely checkpointed, and 0 if it | 59 | * or the domain was merely checkpointed, and 0 if it |
59 | * is resuming in a new domain. | 60 | * is resuming in a new domain. |
60 | */ | 61 | */ |
61 | si->cancelled = HYPERVISOR_suspend(0UL); | 62 | si->cancelled = HYPERVISOR_suspend(si->arg); |
62 | 63 | ||
63 | xen_hvm_post_suspend(si->cancelled); | 64 | xen_hvm_post_suspend(si->cancelled); |
64 | gnttab_resume(); | 65 | gnttab_resume(); |
@@ -97,7 +98,7 @@ static int xen_suspend(void *data) | |||
97 | * or the domain was merely checkpointed, and 0 if it | 98 | * or the domain was merely checkpointed, and 0 if it |
98 | * is resuming in a new domain. | 99 | * is resuming in a new domain. |
99 | */ | 100 | */ |
100 | si->cancelled = HYPERVISOR_suspend(virt_to_mfn(xen_start_info)); | 101 | si->cancelled = HYPERVISOR_suspend(si->arg); |
101 | 102 | ||
102 | xen_post_suspend(si->cancelled); | 103 | xen_post_suspend(si->cancelled); |
103 | gnttab_resume(); | 104 | gnttab_resume(); |
@@ -150,6 +151,11 @@ static void do_suspend(void) | |||
150 | si.cancelled = 1; | 151 | si.cancelled = 1; |
151 | 152 | ||
152 | if (xen_hvm_domain()) | 153 | if (xen_hvm_domain()) |
154 | si.arg = 0UL; | ||
155 | else | ||
156 | si.arg = virt_to_mfn(xen_start_info); | ||
157 | |||
158 | if (xen_hvm_domain()) | ||
153 | err = stop_machine(xen_hvm_suspend, &si, cpumask_of(0)); | 159 | err = stop_machine(xen_hvm_suspend, &si, cpumask_of(0)); |
154 | else | 160 | else |
155 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); | 161 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); |