diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-14 13:46:12 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-19 17:36:30 -0400 |
commit | 068e0dc7b7c1db9801e3d7f2ba5cb1d2a552a35b (patch) | |
tree | e61ae45516a78c848db96b5cd68452453b0eb2de | |
parent | d6a77ead21b69c395ca6d09a066ededfac601bcc (diff) |
xen / ACPI / sleep: Register an acpi_suspend_lowlevel callback.
We piggyback on "x86/acpi: Provide registration for acpi_suspend_lowlevel."
to register a Xen version of the callback. The callback does not
do anything special - except it omits the x86_acpi_suspend_lowlevel.
This is necessary b/c during suspend the generic code tries to write
cr3 values that clashes with what the hypervisor has set up for the guest.
Signed-off-by: Liang Tang <liang.tang@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Ben Guthro <benjamin.guthro@citrix.com>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | include/xen/acpi.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/xen/acpi.h b/include/xen/acpi.h index 68d73d09b770..46aa3d1c1654 100644 --- a/include/xen/acpi.h +++ b/include/xen/acpi.h | |||
@@ -78,11 +78,25 @@ static inline int xen_acpi_get_pxm(acpi_handle h) | |||
78 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, | 78 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, |
79 | u32 pm1a_cnt, u32 pm1b_cnd); | 79 | u32 pm1a_cnt, u32 pm1b_cnd); |
80 | 80 | ||
81 | static inline int xen_acpi_suspend_lowlevel(void) | ||
82 | { | ||
83 | /* | ||
84 | * Xen will save and restore CPU context, so | ||
85 | * we can skip that and just go straight to | ||
86 | * the suspend. | ||
87 | */ | ||
88 | acpi_enter_sleep_state(ACPI_STATE_S3); | ||
89 | return 0; | ||
90 | } | ||
91 | |||
81 | static inline void xen_acpi_sleep_register(void) | 92 | static inline void xen_acpi_sleep_register(void) |
82 | { | 93 | { |
83 | if (xen_initial_domain()) | 94 | if (xen_initial_domain()) { |
84 | acpi_os_set_prepare_sleep( | 95 | acpi_os_set_prepare_sleep( |
85 | &xen_acpi_notify_hypervisor_state); | 96 | &xen_acpi_notify_hypervisor_state); |
97 | |||
98 | acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel; | ||
99 | } | ||
86 | } | 100 | } |
87 | #else | 101 | #else |
88 | static inline void xen_acpi_sleep_register(void) | 102 | static inline void xen_acpi_sleep_register(void) |