xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: Add fake_s3 command-line option for testing
@ 2018-05-21 14:16 George Dunlap
  2018-05-21 14:28 ` Andrew Cooper
  2018-05-22 10:51 ` Jan Beulich
  0 siblings, 2 replies; 10+ messages in thread
From: George Dunlap @ 2018-05-21 14:16 UTC (permalink / raw)
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Ben Guthro, Andrew Cooper,
	George Dunlap, Dario Faggioli, Jan Beulich, Ian Jackson

Most server-class hardware doesn't support ACPI S3 suspend; but most
bugs we'll run across won't need actual S3 to trigger.  Add a
command-line parameter for a "fake" S3, which will do everything
during suspend/restore except actually calling into the ACPI S3
handler.

Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
---
This was originally posted in 2013, but never actually checked in.

I've removed an extraneous line, and changed the underscore in the
option into a dash (as Jan seems to prefer).

Compile-tested only.

If we want osstest to be able to test this functionality it should
probably be backported.

CC: Ian Jackson <ian.jackson@citrix.com>
CC: Dario Faggioli <dfaggioli@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/acpi/power.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index a704c7c340..566cbc38b3 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);
 
@@ -222,7 +225,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;
-- 
2.17.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-05-22 13:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-21 14:16 [PATCH] xen: Add fake_s3 command-line option for testing George Dunlap
2018-05-21 14:28 ` Andrew Cooper
2018-05-21 15:33   ` George Dunlap
2018-05-22  7:47     ` Dario Faggioli
2018-05-22 10:53     ` Jan Beulich
2018-05-22 10:51 ` Jan Beulich
2018-05-22 10:55   ` Andrew Cooper
2018-05-22 11:21   ` George Dunlap
2018-05-22 11:44     ` Jan Beulich
2018-05-22 13:21       ` George Dunlap

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).