From: Ben Guthro <benjamin.guthro@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Jan Beulich <jbeulich@suse.com>,
"Rafaell J . Wysocki" <rjw@sisk.pl>,
<linux-kernel@vger.kernel.org>, <linux-acpi@vger.kernel.org>,
<xen-devel@lists.xen.org>
Cc: Ben Guthro <benjamin.guthro@citrix.com>
Subject: [PATCH v3 3/3] xen/acpi: notify xen when reduced hardware sleep is available
Date: Wed, 26 Jun 2013 10:06:15 -0400 [thread overview]
Message-ID: <1372255575-29567-4-git-send-email-benjamin.guthro@citrix.com> (raw)
In-Reply-To: <1372255575-29567-1-git-send-email-benjamin.guthro@citrix.com>
Make use of acpi_os_prepare_sleep extended parameter to notify xen
to make use of the reduced hardware sleep functionality
The hypervisor change underlying this is commit 62d1a69 ("ACPI: support
v5 (reduced HW) sleep interface") on the master branch of
git://xenbits.xen.org/xen.git.
Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Wilk <konrad.wilk@oracle.com>
---
drivers/xen/acpi.c | 26 +++++++++++++-------------
include/xen/acpi.h | 4 ++--
include/xen/interface/platform.h | 7 ++++---
3 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/drivers/xen/acpi.c b/drivers/xen/acpi.c
index 119d42a..f4e12dc 100644
--- a/drivers/xen/acpi.c
+++ b/drivers/xen/acpi.c
@@ -35,27 +35,27 @@
#include <asm/xen/hypercall.h>
#include <asm/xen/hypervisor.h>
-int xen_acpi_notify_hypervisor_state(u8 sleep_state,
- u32 pm1a_cnt, u32 pm1b_cnt)
+int xen_acpi_notify_hypervisor_state(u8 sleep_state, u32 val_a, u32 val_b,
+ u8 extended)
{
+ unsigned int bits = extended ? 8 : 16;
+
struct xen_platform_op op = {
.cmd = XENPF_enter_acpi_sleep,
.interface_version = XENPF_INTERFACE_VERSION,
- .u = {
- .enter_acpi_sleep = {
- .pm1a_cnt_val = (u16)pm1a_cnt,
- .pm1b_cnt_val = (u16)pm1b_cnt,
- .sleep_state = sleep_state,
- },
+ .u.enter_acpi_sleep = {
+ .val_a = (u16)val_a,
+ .val_b = (u16)val_b,
+ .sleep_state = sleep_state,
+ .flags = extended ? XENPF_ACPI_SLEEP_EXTENDED : 0,
},
};
- if ((pm1a_cnt & 0xffff0000) || (pm1b_cnt & 0xffff0000)) {
- WARN(1, "Using more than 16bits of PM1A/B 0x%x/0x%x!"
- "Email xen-devel@lists.xensource.com Thank you.\n", \
- pm1a_cnt, pm1b_cnt);
+ if (WARN((val_a & (~0 << bits)) || (val_b & (~0 << bits)),
+ "Using more than %u bits of sleep control values %#x/%#x!"
+ "Email xen-devel@lists.xen.org - Thank you.\n", \
+ bits, val_a, val_b))
return -1;
- }
HYPERVISOR_dom0_op(&op);
return 1;
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 68d73d0..55bf8423f 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -75,8 +75,8 @@ static inline int xen_acpi_get_pxm(acpi_handle h)
return -ENXIO;
}
-int xen_acpi_notify_hypervisor_state(u8 sleep_state,
- u32 pm1a_cnt, u32 pm1b_cnd);
+int xen_acpi_notify_hypervisor_state(u8 sleep_state, u32 val_a, u32 val_b,
+ u8 extended);
static inline void xen_acpi_sleep_register(void)
{
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
index c57d5f6..f1331e3 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -152,10 +152,11 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t);
#define XENPF_enter_acpi_sleep 51
struct xenpf_enter_acpi_sleep {
/* IN variables */
- uint16_t pm1a_cnt_val; /* PM1a control value. */
- uint16_t pm1b_cnt_val; /* PM1b control value. */
+ uint16_t val_a; /* PM1a control / sleep type A. */
+ uint16_t val_b; /* PM1b control / sleep type B. */
uint32_t sleep_state; /* Which state to enter (Sn). */
- uint32_t flags; /* Must be zero. */
+#define XENPF_ACPI_SLEEP_EXTENDED 0x00000001
+ uint32_t flags; /* XENPF_ACPI_SLEEP_*. */
};
DEFINE_GUEST_HANDLE_STRUCT(xenpf_enter_acpi_sleep_t);
--
1.7.9.5
prev parent reply other threads:[~2013-06-26 14:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 14:06 [PATCH v3 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Ben Guthro
2013-06-26 14:06 ` [PATCH v3 1/3] acpi: Call acpi_os_prepare_sleep hook in reduced hardware sleep path Ben Guthro
2013-06-26 14:41 ` Jan Beulich
2013-06-26 15:03 ` Ben Guthro
2013-06-26 15:45 ` Jan Beulich
2013-06-26 18:59 ` Rafael J. Wysocki
2013-07-02 6:19 ` Zheng, Lv
2013-07-02 11:42 ` Ben Guthro
2013-07-24 6:24 ` Zheng, Lv
2013-07-24 12:01 ` Ben Guthro
2013-07-24 13:18 ` Moore, Robert
2013-07-24 13:23 ` Ben Guthro
2013-07-24 14:38 ` Moore, Robert
2013-07-24 15:14 ` Ben Guthro
2013-07-24 16:32 ` Konrad Rzeszutek Wilk
2013-07-25 1:28 ` Zheng, Lv
[not found] ` <CAOvdn6WZFu7TssoML3J9SPpqH_AKSi4cjvZ7Tb0zdBtq46QO0Q@mail.gmail.com>
2013-07-25 1:54 ` Zheng, Lv
2013-07-25 12:04 ` Konrad Rzeszutek Wilk
2013-07-26 2:51 ` Zheng, Lv
2013-07-26 18:03 ` konrad wilk
2013-07-29 2:22 ` Zheng, Lv
2013-07-25 1:01 ` Zheng, Lv
2013-07-25 1:19 ` Ben Guthro
2013-06-26 14:06 ` [PATCH v3 2/3] x86/tboot: Fail extended mode reduced hardware sleep Ben Guthro
2013-06-26 14:44 ` Jan Beulich
2013-06-26 14:55 ` Ben Guthro
2013-06-26 15:47 ` Jan Beulich
2013-06-26 14:06 ` Ben Guthro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372255575-29567-4-git-send-email-benjamin.guthro@citrix.com \
--to=benjamin.guthro@citrix.com \
--cc=jbeulich@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome