From: Dario Faggioli <dario.faggioli@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Ben Guthro <ben@guthro.net>, Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] xen: add a 'acpi_fake_s3' boot command line parameter
Date: Mon, 22 Jun 2015 13:28:47 +0200 [thread overview]
Message-ID: <20150622112847.14314.18653.stgit@Solace.station> (raw)
which, if provided, prevents the function that actually
put the system in ACPI S3 suspended state to be called.
The system will, therefore, go down the suspend path,
until the second to last step, and then resume right away.
This is useful when testing and debugging S3 suspend/resume
issues.
Signed-off-by: Ben Guthro <ben@guthro.net>
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
docs/misc/xen-command-line.markdown | 11 +++++++++++
xen/arch/x86/acpi/power.c | 6 +++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index aa684c0..adbe9b5 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -110,6 +110,17 @@ domain 0 command line
Specify which ACPI MADT table to parse for APIC information, if more
than one is present.
+### acpi\_fake\_s3
+> `= <boolean>`
+
+> Default: `false`
+
+When ACPI S3 suspend is requested, perform all the operations necessary
+to achieve that, except the actual low level register writes that puts
+the system to sleep (hence the system resumes right away).
+
+This is useful for testing and debugging ACPI S3 suspend/resume issues.
+
### acpi\_pstate\_strict
> `= <boolean>`
diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index f41f0de..562d25a 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("acpi_fake_s3", fake_s3);
+
static char __initdata opt_acpi_sleep[20];
string_param("acpi_sleep", opt_acpi_sleep);
@@ -177,7 +180,8 @@ static int enter_state(u32 state)
switch ( state )
{
case ACPI_STATE_S3:
- do_suspend_lowlevel();
+ if ( likely(!fake_s3) )
+ do_suspend_lowlevel();
system_reset_counter++;
error = tboot_s3_resume();
break;
next reply other threads:[~2015-06-22 11:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 11:28 Dario Faggioli [this message]
2015-06-22 11:48 ` [PATCH] xen: add a 'acpi_fake_s3' boot command line parameter Jan Beulich
2015-06-22 12:39 ` Dario Faggioli
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=20150622112847.14314.18653.stgit@Solace.station \
--to=dario.faggioli@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ben@guthro.net \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xenproject.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 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.