[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen: Add fake_s3 command-line option for testing



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@xxxxxxxxxx>
Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
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@xxxxxxxxxx>
CC: Dario Faggioli <dfaggioli@xxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
CC: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.