All of lore.kernel.org
 help / color / mirror / Atom feed
* S3 testing, etc
@ 2013-04-10 10:31 Ben Guthro
  2013-04-10 21:19 ` Marek Marczykowski
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Guthro @ 2013-04-10 10:31 UTC (permalink / raw)
  To: George Dunlap; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]

I had an off-list discussion with George Dunlap yesterday, who
suggested that it might be helpful to have an ability to test the S3
functionality in a bit more of an end-to-end fashion, and possibly
introduce an ability to do all of the S3 related things without
actually putting the machine to sleep.

Attached is a very simple patch to xen that introduces a command line
argument "fake_s3" that will do just that.

Also attached is a shell script that will put a system to sleep, and
wake it back up after a number of seconds by programming the RTC.
This does so at the kernel interface level, which is not as complete
as the pm-utils functionality, but since different linux distros seem
to vary in implementations of how to go into sleep, I used the sysfs
interface directly. A more complete cli interface may be more
appropriate for specific distros.

Finally, since this does require functionality not yet accepted into
the mainline kernel, one of Konrad's acpi-s3-vX branches is necessary:
I can vouch for the functionality in v9 - but there is also a newer v10:
http://git.kernel.org/cgit/linux/kernel/git/konrad/xen.git/log/?h=devel/acpi-s3.v9
http://git.kernel.org/cgit/linux/kernel/git/konrad/xen.git/log/?h=devel/acpi-s3.v10

The hope here is that this might be somehow worked into the automated
testing to maybe catch regressions in S3 sooner.



Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>

[-- Attachment #2: fake_s3.patch --]
[-- Type: application/octet-stream, Size: 954 bytes --]

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index f41f0de..36a53b0 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -33,6 +33,9 @@
 
 uint32_t system_reset_counter = 1;
 
+static bool_t __read_mostly fake_s3 = 0;
+boolean_param("fake_s3", fake_s3);
+
 static char __initdata opt_acpi_sleep[20];
 string_param("acpi_sleep", opt_acpi_sleep);
 
@@ -123,6 +126,8 @@ static void acpi_sleep_prepare(u32 state)
         *(uint64_t *)wakeup_vector_va = bootsym_phys(wakeup_start);
 }
 
+void set_rtc_alarm(uint32_t seconds);
+
 static void acpi_sleep_post(u32 state) {}
 
 /* Main interface to do xen specific suspend/resume */
@@ -177,7 +182,8 @@ static int enter_state(u32 state)
     switch ( state )
     {
     case ACPI_STATE_S3:
-        do_suspend_lowlevel();
+        if ( !fake_s3 )
+            do_suspend_lowlevel();
         system_reset_counter++;
         error = tboot_s3_resume();
         break;

[-- Attachment #3: s3_timed.sh --]
[-- Type: application/x-sh, Size: 327 bytes --]

[-- Attachment #4: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-10 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10 10:31 S3 testing, etc Ben Guthro
2013-04-10 21:19 ` Marek Marczykowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.