提交 068e0dc7 编写于 作者: K Konrad Rzeszutek Wilk 提交者: Rafael J. Wysocki

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: NLiang Tang <liang.tang@oracle.com>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: NBen Guthro <benjamin.guthro@citrix.com>
Acked-by: NH. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 d6a77ead
...@@ -78,11 +78,25 @@ static inline int xen_acpi_get_pxm(acpi_handle h) ...@@ -78,11 +78,25 @@ static inline int xen_acpi_get_pxm(acpi_handle h)
int xen_acpi_notify_hypervisor_state(u8 sleep_state, int xen_acpi_notify_hypervisor_state(u8 sleep_state,
u32 pm1a_cnt, u32 pm1b_cnd); u32 pm1a_cnt, u32 pm1b_cnd);
static inline int xen_acpi_suspend_lowlevel(void)
{
/*
* Xen will save and restore CPU context, so
* we can skip that and just go straight to
* the suspend.
*/
acpi_enter_sleep_state(ACPI_STATE_S3);
return 0;
}
static inline void xen_acpi_sleep_register(void) static inline void xen_acpi_sleep_register(void)
{ {
if (xen_initial_domain()) if (xen_initial_domain()) {
acpi_os_set_prepare_sleep( acpi_os_set_prepare_sleep(
&xen_acpi_notify_hypervisor_state); &xen_acpi_notify_hypervisor_state);
acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel;
}
} }
#else #else
static inline void xen_acpi_sleep_register(void) static inline void xen_acpi_sleep_register(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册