* [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems
@ 2013-07-30 12:24 Ben Guthro
2013-07-30 12:24 ` [PATCH v8 1/3] x86/acpi: Introduce acpi_os_prepare_extended_sleep callback for extended sleep path Ben Guthro
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Ben Guthro @ 2013-07-30 12:24 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, Jan Beulich, Rafael J . Wysocki,
linux-kernel, linux-acpi, xen-devel
Cc: Ben Guthro, Richard L Maliszewski, Gang Wei, Shane Wang,
Bob Moore, tboot-devel
In version 3.4 acpi_os_prepare_sleep() got introduced in parallel with
reduced hardware sleep support, and the two changes didn't get
synchronized: The new code doesn't call the hook function (if so
requested). Fix this, requiring a new callback to be added to acpica
to be called back during this reduced hardware sleep.
This requires adjusting TXT, but the adjustments only go as far as
failing the extended mode call (since, looking at the TXT interface,
there doesn't even appear to be precautions to deal with that
alternative interface).
The xen 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: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
Cc: Richard L Maliszewski <richard.l.maliszewski@intel.com>
Cc: Gang Wei <gang.wei@intel.com>
Cc: Shane Wang <shane.wang@intel.com>
Cc: Bob Moore <robert.moore@intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: linux-acpi@vger.kernel.org
Cc: tboot-devel@lists.sourceforge.net
v2: Extend description to include reference to hypervisor side change
v3: Split into multiple patches, separating subsystems
Remove bool parameters, in favor of u8
v4: Remove linux/acpi.h dependencies
Further patch split to break out acpica from OSL
More bool vs u8 fixes
v5: Fix build of consumers of acpi_os_prepare_sleep() interface change,
so intermediate builds of partial patch series will not fail.
v6: Rebased to linux-pm linux-next branch
Added warning in tboot early return code
Added Reviewed-by lines
v7: Add separate acpi_os_prepare_extended_sleep() interface
Remove OSL acpica changes introduced in v4
v8: Return meaningful error code in tboot error path
Ben Guthro (3):
x86/acpi: Introduce acpi_os_prepare_extended_sleep callback for
extended sleep path
x86/tboot: Fail extended mode reduced hardware sleep
xen/acpi: notify xen when reduced hardware sleep is available
arch/x86/kernel/tboot.c | 12 +++++++++++
drivers/acpi/acpica/hwesleep.c | 9 +++++++++
drivers/acpi/osl.c | 24 ++++++++++++++++++++++
drivers/xen/acpi.c | 41 ++++++++++++++++++++++++++------------
include/linux/acpi.h | 7 +++++++
include/xen/acpi.h | 8 ++++++--
include/xen/interface/platform.h | 7 ++++---
7 files changed, 90 insertions(+), 18 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 1/3] x86/acpi: Introduce acpi_os_prepare_extended_sleep callback for extended sleep path
2013-07-30 12:24 [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Ben Guthro
@ 2013-07-30 12:24 ` Ben Guthro
2013-07-30 12:24 ` [PATCH v8 2/3] x86/tboot: Fail extended mode reduced hardware sleep Ben Guthro
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Ben Guthro @ 2013-07-30 12:24 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, Jan Beulich, Rafael J . Wysocki,
linux-kernel, linux-acpi, xen-devel
Cc: Ben Guthro
Like acpi_os_prepare_sleep, register a callback for use in systems like
tboot, and xen, which have system specific requirements outside of acpica.
This mirrors the functionality in acpi_os_prepare_sleep(), called from
acpi_hw_sleep()
Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
---
drivers/acpi/acpica/hwesleep.c | 9 +++++++++
drivers/acpi/osl.c | 24 ++++++++++++++++++++++++
include/linux/acpi.h | 7 +++++++
3 files changed, 40 insertions(+)
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c
index 5e5f762..4140768 100644
--- a/drivers/acpi/acpica/hwesleep.c
+++ b/drivers/acpi/acpica/hwesleep.c
@@ -43,6 +43,7 @@
*/
#include <acpi/acpi.h>
+#include <linux/acpi.h>
#include "accommon.h"
#define _COMPONENT ACPI_HARDWARE
@@ -128,6 +129,14 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
ACPI_FLUSH_CPU_CACHE();
+ status = acpi_os_prepare_extended_sleep(sleep_state,
+ acpi_gbl_sleep_type_a,
+ acpi_gbl_sleep_type_b);
+ if (ACPI_SKIP(status))
+ return_ACPI_STATUS(AE_OK);
+ if (ACPI_FAILURE(status))
+ return_ACPI_STATUS(status);
+
/*
* Set the SLP_TYP and SLP_EN bits.
*
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 6ab2c35..a934950 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -79,6 +79,8 @@ extern char line_buf[80];
static int (*__acpi_os_prepare_sleep)(u8 sleep_state, u32 pm1a_ctrl,
u32 pm1b_ctrl);
+static int (*__acpi_os_prepare_extended_sleep)(u8 sleep_state, u32 val_a,
+ u32 val_b);
static acpi_osd_handler acpi_irq_handler;
static void *acpi_irq_context;
@@ -1779,6 +1781,28 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
__acpi_os_prepare_sleep = func;
}
+acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state, u32 val_a,
+ u32 val_b)
+{
+ int rc = 0;
+ if (__acpi_os_prepare_extended_sleep)
+ rc = __acpi_os_prepare_extended_sleep(sleep_state,
+ val_a, val_b);
+ if (rc < 0)
+ return AE_ERROR;
+ else if (rc > 0)
+ return AE_CTRL_SKIP;
+
+ return AE_OK;
+}
+
+void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
+ u32 val_a, u32 val_b))
+{
+ __acpi_os_prepare_extended_sleep = func;
+}
+
+
void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context,
void (*func)(struct work_struct *work))
{
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 353ba25..a5db4ae 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -481,6 +481,13 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
acpi_status acpi_os_prepare_sleep(u8 sleep_state,
u32 pm1a_control, u32 pm1b_control);
+
+void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
+ u32 val_a, u32 val_b));
+
+acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
+ u32 val_a, u32 val_b);
+
#ifdef CONFIG_X86
void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
#else
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v8 2/3] x86/tboot: Fail extended mode reduced hardware sleep
2013-07-30 12:24 [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Ben Guthro
2013-07-30 12:24 ` [PATCH v8 1/3] x86/acpi: Introduce acpi_os_prepare_extended_sleep callback for extended sleep path Ben Guthro
@ 2013-07-30 12:24 ` Ben Guthro
2013-07-30 13:14 ` Rafael J. Wysocki
2013-07-30 12:24 ` [PATCH v8 3/3] xen/acpi: notify xen when reduced hardware sleep is available Ben Guthro
2013-07-30 13:16 ` [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Rafael J. Wysocki
3 siblings, 1 reply; 9+ messages in thread
From: Ben Guthro @ 2013-07-30 12:24 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, Jan Beulich, Rafael J . Wysocki,
linux-kernel, linux-acpi, xen-devel
Cc: tboot-devel, Ben Guthro
Register for the extended sleep callback from acpi.
As tboot currently does not support the reduced hardware sleep
interface, fail this extended call.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
Cc: tboot-devel@lists.sourceforge.net
Cc: Gang Wei <gang.wei@intel.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/kernel/tboot.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index addf7b5..ade00c8 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -301,6 +301,17 @@ static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
return 0;
}
+static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b)
+{
+ if (!tboot_enabled())
+ return 0;
+
+ pr_warning("tboot is not able to suspend on platforms with"
+ " reduced hardware sleep (ACPIv5). Please contact"
+ " tboot-devel@lists.sourceforge.net mailing list.");
+ return -ENODEV;
+}
+
static atomic_t ap_wfs_count;
static int tboot_wait_for_aps(int num_aps)
@@ -422,6 +433,7 @@ static __init int tboot_late_init(void)
#endif
acpi_os_set_prepare_sleep(&tboot_sleep);
+ acpi_os_set_prepare_extended_sleep(&tboot_extended_sleep);
return 0;
}
--
1.7.9.5
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v8 3/3] xen/acpi: notify xen when reduced hardware sleep is available
2013-07-30 12:24 [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Ben Guthro
2013-07-30 12:24 ` [PATCH v8 1/3] x86/acpi: Introduce acpi_os_prepare_extended_sleep callback for extended sleep path Ben Guthro
2013-07-30 12:24 ` [PATCH v8 2/3] x86/tboot: Fail extended mode reduced hardware sleep Ben Guthro
@ 2013-07-30 12:24 ` Ben Guthro
2013-07-30 13:16 ` [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Rafael J. Wysocki
3 siblings, 0 replies; 9+ messages in thread
From: Ben Guthro @ 2013-07-30 12:24 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, Jan Beulich, Rafael J . Wysocki,
linux-kernel, linux-acpi, xen-devel
Cc: Ben Guthro
Make use of acpi_os_prepare_extended_sleep callback to notify xen
to make use of the reduced hardware sleep functionality
The xen 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: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
Acked-by: Konrad Wilk <konrad.wilk@oracle.com>
---
drivers/xen/acpi.c | 41 ++++++++++++++++++++++++++------------
include/xen/acpi.h | 8 ++++++--
include/xen/interface/platform.h | 7 ++++---
3 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/drivers/xen/acpi.c b/drivers/xen/acpi.c
index 119d42a..90307c0 100644
--- a/drivers/xen/acpi.c
+++ b/drivers/xen/acpi.c
@@ -35,28 +35,43 @@
#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)
+static int xen_acpi_notify_hypervisor_state(u8 sleep_state,
+ u32 val_a, u32 val_b,
+ bool 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;
}
+
+int xen_acpi_notify_hypervisor_sleep(u8 sleep_state,
+ u32 pm1a_cnt, u32 pm1b_cnt)
+{
+ return xen_acpi_notify_hypervisor_state(sleep_state, pm1a_cnt,
+ pm1b_cnt, false);
+}
+
+int xen_acpi_notify_hypervisor_extended_sleep(u8 sleep_state,
+ u32 val_a, u32 val_b)
+{
+ return xen_acpi_notify_hypervisor_state(sleep_state, val_a,
+ val_b, true);
+}
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 46aa3d1..4ddd7dc 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -75,8 +75,10 @@ static inline int xen_acpi_get_pxm(acpi_handle h)
return -ENXIO;
}
-int xen_acpi_notify_hypervisor_state(u8 sleep_state,
+int xen_acpi_notify_hypervisor_sleep(u8 sleep_state,
u32 pm1a_cnt, u32 pm1b_cnd);
+int xen_acpi_notify_hypervisor_extended_sleep(u8 sleep_state,
+ u32 val_a, u32 val_b);
static inline int xen_acpi_suspend_lowlevel(void)
{
@@ -93,7 +95,9 @@ static inline void xen_acpi_sleep_register(void)
{
if (xen_initial_domain()) {
acpi_os_set_prepare_sleep(
- &xen_acpi_notify_hypervisor_state);
+ &xen_acpi_notify_hypervisor_sleep);
+ acpi_os_set_prepare_extended_sleep(
+ &xen_acpi_notify_hypervisor_extended_sleep);
acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel;
}
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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v8 2/3] x86/tboot: Fail extended mode reduced hardware sleep
2013-07-30 12:24 ` [PATCH v8 2/3] x86/tboot: Fail extended mode reduced hardware sleep Ben Guthro
@ 2013-07-30 13:14 ` Rafael J. Wysocki
2013-07-30 13:22 ` [PATCH v8.1] " Ben Guthro
0 siblings, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2013-07-30 13:14 UTC (permalink / raw)
To: Ben Guthro
Cc: Konrad Rzeszutek Wilk, Jan Beulich, linux-kernel, linux-acpi,
xen-devel, tboot-devel, Gang Wei
On Tuesday, July 30, 2013 08:24:53 AM Ben Guthro wrote:
> Register for the extended sleep callback from acpi.
> As tboot currently does not support the reduced hardware sleep
> interface, fail this extended call.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
> Cc: tboot-devel@lists.sourceforge.net
> Cc: Gang Wei <gang.wei@intel.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> arch/x86/kernel/tboot.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
> index addf7b5..ade00c8 100644
> --- a/arch/x86/kernel/tboot.c
> +++ b/arch/x86/kernel/tboot.c
> @@ -301,6 +301,17 @@ static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
> return 0;
> }
>
> +static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b)
> +{
> + if (!tboot_enabled())
> + return 0;
> +
> + pr_warning("tboot is not able to suspend on platforms with"
> + " reduced hardware sleep (ACPIv5). Please contact"
> + " tboot-devel@lists.sourceforge.net mailing list.");
I'm told that string literals should be continuous now even if they cross the 80
columns boundary, so let's make that happen here.
Also please drop the "Please contact ..." part, it is unnecessary and unuseful
(I forgot about this particular thing last time, sorry about that).
> + return -ENODEV;
> +}
> +
> static atomic_t ap_wfs_count;
>
> static int tboot_wait_for_aps(int num_aps)
> @@ -422,6 +433,7 @@ static __init int tboot_late_init(void)
> #endif
>
> acpi_os_set_prepare_sleep(&tboot_sleep);
> + acpi_os_set_prepare_extended_sleep(&tboot_extended_sleep);
> return 0;
> }
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems
2013-07-30 12:24 [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Ben Guthro
` (2 preceding siblings ...)
2013-07-30 12:24 ` [PATCH v8 3/3] xen/acpi: notify xen when reduced hardware sleep is available Ben Guthro
@ 2013-07-30 13:16 ` Rafael J. Wysocki
3 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2013-07-30 13:16 UTC (permalink / raw)
To: Ben Guthro
Cc: Konrad Rzeszutek Wilk, Jan Beulich, linux-kernel, linux-acpi,
xen-devel, Richard L Maliszewski, Gang Wei, Shane Wang, Bob Moore,
tboot-devel
On Tuesday, July 30, 2013 08:24:51 AM Ben Guthro wrote:
> In version 3.4 acpi_os_prepare_sleep() got introduced in parallel with
> reduced hardware sleep support, and the two changes didn't get
> synchronized: The new code doesn't call the hook function (if so
> requested). Fix this, requiring a new callback to be added to acpica
> to be called back during this reduced hardware sleep.
>
> This requires adjusting TXT, but the adjustments only go as far as
> failing the extended mode call (since, looking at the TXT interface,
> there doesn't even appear to be precautions to deal with that
> alternative interface).
>
> The xen 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: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
> Cc: Richard L Maliszewski <richard.l.maliszewski@intel.com>
> Cc: Gang Wei <gang.wei@intel.com>
> Cc: Shane Wang <shane.wang@intel.com>
> Cc: Bob Moore <robert.moore@intel.com>
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: linux-acpi@vger.kernel.org
> Cc: tboot-devel@lists.sourceforge.net
>
> v2: Extend description to include reference to hypervisor side change
> v3: Split into multiple patches, separating subsystems
> Remove bool parameters, in favor of u8
> v4: Remove linux/acpi.h dependencies
> Further patch split to break out acpica from OSL
> More bool vs u8 fixes
> v5: Fix build of consumers of acpi_os_prepare_sleep() interface change,
> so intermediate builds of partial patch series will not fail.
> v6: Rebased to linux-pm linux-next branch
> Added warning in tboot early return code
> Added Reviewed-by lines
> v7: Add separate acpi_os_prepare_extended_sleep() interface
> Remove OSL acpica changes introduced in v4
> v8: Return meaningful error code in tboot error path
>
> Ben Guthro (3):
> x86/acpi: Introduce acpi_os_prepare_extended_sleep callback for
> extended sleep path
> x86/tboot: Fail extended mode reduced hardware sleep
> xen/acpi: notify xen when reduced hardware sleep is available
>
> arch/x86/kernel/tboot.c | 12 +++++++++++
> drivers/acpi/acpica/hwesleep.c | 9 +++++++++
> drivers/acpi/osl.c | 24 ++++++++++++++++++++++
> drivers/xen/acpi.c | 41 ++++++++++++++++++++++++++------------
> include/linux/acpi.h | 7 +++++++
> include/xen/acpi.h | 8 ++++++--
> include/xen/interface/platform.h | 7 ++++---
> 7 files changed, 90 insertions(+), 18 deletions(-)
Please modify [2/3] as requested in the other message, [1/3] and [3/3] are OK
and don't need to be resent.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8.1] x86/tboot: Fail extended mode reduced hardware sleep
2013-07-30 13:14 ` Rafael J. Wysocki
@ 2013-07-30 13:22 ` Ben Guthro
2013-07-30 13:34 ` Rafael J. Wysocki
0 siblings, 1 reply; 9+ messages in thread
From: Ben Guthro @ 2013-07-30 13:22 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, Jan Beulich, Rafael J . Wysocki,
linux-kernel, linux-acpi, xen-devel
Cc: Ben Guthro, tboot-devel, Gang Wei
Register for the extended sleep callback from acpi.
As tboot currently does not support the reduced hardware sleep
interface, fail this extended call.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
Cc: tboot-devel@lists.sourceforge.net
Cc: Gang Wei <gang.wei@intel.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/kernel/tboot.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index addf7b5..91a4496 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -301,6 +301,15 @@ static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
return 0;
}
+static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b)
+{
+ if (!tboot_enabled())
+ return 0;
+
+ pr_warning("tboot is not able to suspend on platforms with reduced hardware sleep (ACPIv5)");
+ return -ENODEV;
+}
+
static atomic_t ap_wfs_count;
static int tboot_wait_for_aps(int num_aps)
@@ -422,6 +431,7 @@ static __init int tboot_late_init(void)
#endif
acpi_os_set_prepare_sleep(&tboot_sleep);
+ acpi_os_set_prepare_extended_sleep(&tboot_extended_sleep);
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v8.1] x86/tboot: Fail extended mode reduced hardware sleep
2013-07-30 13:34 ` Rafael J. Wysocki
@ 2013-07-30 13:26 ` Ben Guthro
0 siblings, 0 replies; 9+ messages in thread
From: Ben Guthro @ 2013-07-30 13:26 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Ben Guthro, Konrad Rzeszutek Wilk, linux-kernel, xen-devel,
linux-acpi, tboot-devel, Jan Beulich
[-- Attachment #1.1: Type: text/plain, Size: 2070 bytes --]
On Tue, Jul 30, 2013 at 9:34 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Tuesday, July 30, 2013 09:22:37 AM Ben Guthro wrote:
> > Register for the extended sleep callback from acpi.
> > As tboot currently does not support the reduced hardware sleep
> > interface, fail this extended call.
> >
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
> > Cc: tboot-devel@lists.sourceforge.net
> > Cc: Gang Wei <gang.wei@intel.com>
> > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> Looks OK, thanks!
>
> I'll queue up the patchset for 3.12.
>
Great!
Thanks for your patience on so many rounds of this.
Ben
>
> Thanks,
> Rafael
>
>
> > ---
> > arch/x86/kernel/tboot.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
> > index addf7b5..91a4496 100644
> > --- a/arch/x86/kernel/tboot.c
> > +++ b/arch/x86/kernel/tboot.c
> > @@ -301,6 +301,15 @@ static int tboot_sleep(u8 sleep_state, u32
> pm1a_control, u32 pm1b_control)
> > return 0;
> > }
> >
> > +static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b)
> > +{
> > + if (!tboot_enabled())
> > + return 0;
> > +
> > + pr_warning("tboot is not able to suspend on platforms with reduced
> hardware sleep (ACPIv5)");
> > + return -ENODEV;
> > +}
> > +
> > static atomic_t ap_wfs_count;
> >
> > static int tboot_wait_for_aps(int num_aps)
> > @@ -422,6 +431,7 @@ static __init int tboot_late_init(void)
> > #endif
> >
> > acpi_os_set_prepare_sleep(&tboot_sleep);
> > + acpi_os_set_prepare_extended_sleep(&tboot_extended_sleep);
> > return 0;
> > }
> >
> >
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
[-- Attachment #1.2: Type: text/html, Size: 3404 bytes --]
[-- Attachment #2: Type: text/plain, Size: 417 bytes --]
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
tboot-devel mailing list
tboot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tboot-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v8.1] x86/tboot: Fail extended mode reduced hardware sleep
2013-07-30 13:22 ` [PATCH v8.1] " Ben Guthro
@ 2013-07-30 13:34 ` Rafael J. Wysocki
2013-07-30 13:26 ` Ben Guthro
0 siblings, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2013-07-30 13:34 UTC (permalink / raw)
To: Ben Guthro
Cc: Konrad Rzeszutek Wilk, Jan Beulich, linux-kernel, linux-acpi,
xen-devel, tboot-devel, Gang Wei
On Tuesday, July 30, 2013 09:22:37 AM Ben Guthro wrote:
> Register for the extended sleep callback from acpi.
> As tboot currently does not support the reduced hardware sleep
> interface, fail this extended call.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
> Cc: tboot-devel@lists.sourceforge.net
> Cc: Gang Wei <gang.wei@intel.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Looks OK, thanks!
I'll queue up the patchset for 3.12.
Thanks,
Rafael
> ---
> arch/x86/kernel/tboot.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
> index addf7b5..91a4496 100644
> --- a/arch/x86/kernel/tboot.c
> +++ b/arch/x86/kernel/tboot.c
> @@ -301,6 +301,15 @@ static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
> return 0;
> }
>
> +static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b)
> +{
> + if (!tboot_enabled())
> + return 0;
> +
> + pr_warning("tboot is not able to suspend on platforms with reduced hardware sleep (ACPIv5)");
> + return -ENODEV;
> +}
> +
> static atomic_t ap_wfs_count;
>
> static int tboot_wait_for_aps(int num_aps)
> @@ -422,6 +431,7 @@ static __init int tboot_late_init(void)
> #endif
>
> acpi_os_set_prepare_sleep(&tboot_sleep);
> + acpi_os_set_prepare_extended_sleep(&tboot_extended_sleep);
> return 0;
> }
>
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-07-30 13:26 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-30 12:24 [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Ben Guthro
2013-07-30 12:24 ` [PATCH v8 1/3] x86/acpi: Introduce acpi_os_prepare_extended_sleep callback for extended sleep path Ben Guthro
2013-07-30 12:24 ` [PATCH v8 2/3] x86/tboot: Fail extended mode reduced hardware sleep Ben Guthro
2013-07-30 13:14 ` Rafael J. Wysocki
2013-07-30 13:22 ` [PATCH v8.1] " Ben Guthro
2013-07-30 13:34 ` Rafael J. Wysocki
2013-07-30 13:26 ` Ben Guthro
2013-07-30 12:24 ` [PATCH v8 3/3] xen/acpi: notify xen when reduced hardware sleep is available Ben Guthro
2013-07-30 13:16 ` [PATCH v8 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).