xen-devel
[Xen-devel] [PATCH 7/8] xen/acpi/sleep: Register to the acpi_suspend_low
To: |
linux-kernel@xxxxxxxxxxxxxxx, rjw@xxxxxxx, tglx@xxxxxxxxxxxxx, hpa@xxxxxxxxx, x86@xxxxxxxxxx, len.brown@xxxxxxxxx, joseph.cihula@xxxxxxxxx, shane.wang@xxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx, tboot-devel@xxxxxxxxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, liang.tang@xxxxxxxxxx, ke.yu@xxxxxxxxx, kevin.tian@xxxxxxxxx, jeremy@xxxxxxxx |
Subject: |
[Xen-devel] [PATCH 7/8] xen/acpi/sleep: Register to the acpi_suspend_lowlevel a callback. |
From: |
Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |
Date: |
Thu, 29 Sep 2011 16:16:53 -0400 |
Cc: |
Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |
Delivery-date: |
Thu, 29 Sep 2011 13:24:57 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<1317327414-24072-1-git-send-email-konrad.wilk@xxxxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<1317327414-24072-1-git-send-email-konrad.wilk@xxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
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.
It does that b/c during suspend it tries to save cr8 values (which
the hypervisor does not support), and then on resume path the
cr3, cr8, idt, and gdt are all resumed which clashes with what
the hypervisor has set up for the guest.
Signed-off-by: Liang Tang <liang.tang@xxxxxxxxxx>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
include/xen/acpi.h | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index c981887..18025e0 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -44,10 +44,22 @@ int xen_acpi_notify_hypervisor_state(u8 sleep_state,
u32 pm1a_cnt, u32 pm1b_cnd,
bool *skip_rest);
+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)
{
- if (xen_initial_domain())
+ if (xen_initial_domain()) {
+ acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel;
__acpi_override_sleep = xen_acpi_notify_hypervisor_state;
+ }
}
#else
static inline void xen_acpi_sleep_register(void)
--
1.7.4.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH v2] ACPI S3 to work under Xen., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 1/8] x86: Expand the x86_msi_ops to have a restore MSIs., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 2/8] x86, acpi, tboot: Have a ACPI sleep override instead of calling tboot_sleep., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 4/8] xen: Utilize the restore_msi_irqs hook., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 8/8] xen/pci:use hypercall PHYSDEVOP_restore_msi_ext to restore MSI/MSI-X vectors, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 7/8] xen/acpi/sleep: Register to the acpi_suspend_lowlevel a callback.,
Konrad Rzeszutek Wilk <=
- [Xen-devel] [PATCH 3/8] x86/acpi/sleep: Provide registration for acpi_suspend_lowlevel., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 6/8] xen/acpi/sleep: Enable ACPI sleep via the __acpi_override_sleep, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 5/8] xen/acpi: Domain0 acpi parser related platform hypercall, Konrad Rzeszutek Wilk
|
|
|