All of lore.kernel.org
 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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  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 10:51 ` Jan Beulich
  1 sibling, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2018-05-21 14:28 UTC (permalink / raw)
  To: George Dunlap, xen-devel
  Cc: Ian Jackson, Ben Guthro, Marek Marczykowski-Górecki,
	Jan Beulich, Dario Faggioli

On 21/05/18 15:16, George Dunlap wrote:
> 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>

bool_t => bool, drop the redundant initialiser, and you need to patch
xen-command-line.markdown.

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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  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
  0 siblings, 2 replies; 10+ messages in thread
From: George Dunlap @ 2018-05-21 15:33 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel
  Cc: Ian Jackson, Ben Guthro, Marek Marczykowski-Górecki,
	Jan Beulich, Dario Faggioli

On 05/21/2018 03:28 PM, Andrew Cooper wrote:
> On 21/05/18 15:16, George Dunlap wrote:
>> 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>
> 
> bool_t => bool, drop the redundant initialiser, and you need to patch
> xen-command-line.markdown.

Hmm, actually -- would it make more sense to add this as an option to
acpi_sleep?  e.g., "acpi_sleep=s3_fake"?  (Along with s3_bios and s3_mode?)

 -George

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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  2018-05-21 15:33   ` George Dunlap
@ 2018-05-22  7:47     ` Dario Faggioli
  2018-05-22 10:53     ` Jan Beulich
  1 sibling, 0 replies; 10+ messages in thread
From: Dario Faggioli @ 2018-05-22  7:47 UTC (permalink / raw)
  To: George Dunlap, Andrew Cooper, xen-devel
  Cc: Ian Jackson, Ben Guthro, Marek Marczykowski-Górecki, Jan Beulich


[-- Attachment #1.1: Type: text/plain, Size: 1032 bytes --]

On Mon, 2018-05-21 at 16:33 +0100, George Dunlap wrote:
> On 05/21/2018 03:28 PM, Andrew Cooper wrote:
> > On 21/05/18 15:16, George Dunlap wrote:
> > > 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.
> > > 
> > bool_t => bool, drop the redundant initialiser, and you need to
> > patch
> > xen-command-line.markdown.
> 
> Hmm, actually -- would it make more sense to add this as an option to
> acpi_sleep?  e.g., "acpi_sleep=s3_fake"?  (Along with s3_bios and
> s3_mode?)
> 
This actually seems a good idea to me.

Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Software Engineer @ SUSE https://www.suse.com/

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  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-22 10:51 ` Jan Beulich
  2018-05-22 10:55   ` Andrew Cooper
  2018-05-22 11:21   ` George Dunlap
  1 sibling, 2 replies; 10+ messages in thread
From: Jan Beulich @ 2018-05-22 10:51 UTC (permalink / raw)
  To: george.dunlap
  Cc: Ben Guthro, Andrew Cooper, Marek Marczykowski, Dario Faggioli,
	Ian Jackson, xen-devel

>>> On 21.05.18 at 16:16, <george.dunlap@citrix.com> wrote:
> Most server-class hardware doesn't support ACPI S3 suspend;

Is that really the case? I though S3 was pretty "normal" these days.

> but most bugs we'll run across won't need actual S3 to trigger.

Not sure about this one either: In particular the microcode issue
addressed recently does require actual S3 to surface. I'm not
meaning to put under question the usefulness of this option,
though. I'd just like the description to not lead to people drawing
wrong conclusions.

Jan



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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  2018-05-21 15:33   ` George Dunlap
  2018-05-22  7:47     ` Dario Faggioli
@ 2018-05-22 10:53     ` Jan Beulich
  1 sibling, 0 replies; 10+ messages in thread
From: Jan Beulich @ 2018-05-22 10:53 UTC (permalink / raw)
  To: george.dunlap
  Cc: Ben Guthro, Andrew Cooper, Marek Marczykowski, Dario Faggioli,
	Ian Jackson, xen-devel

>>> On 21.05.18 at 17:33, <george.dunlap@citrix.com> wrote:
> On 05/21/2018 03:28 PM, Andrew Cooper wrote:
>> On 21/05/18 15:16, George Dunlap wrote:
>>> 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>
>> 
>> bool_t => bool, drop the redundant initialiser, and you need to patch
>> xen-command-line.markdown.
> 
> Hmm, actually -- would it make more sense to add this as an option to
> acpi_sleep?  e.g., "acpi_sleep=s3_fake"?  (Along with s3_bios and s3_mode?)

+1

Jan


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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  2018-05-22 10:51 ` Jan Beulich
@ 2018-05-22 10:55   ` Andrew Cooper
  2018-05-22 11:21   ` George Dunlap
  1 sibling, 0 replies; 10+ messages in thread
From: Andrew Cooper @ 2018-05-22 10:55 UTC (permalink / raw)
  To: Jan Beulich, george.dunlap
  Cc: Ian Jackson, Dario Faggioli, Ben Guthro, Marek Marczykowski, xen-devel

On 22/05/18 11:51, Jan Beulich wrote:
>>>> On 21.05.18 at 16:16, <george.dunlap@citrix.com> wrote:
>> Most server-class hardware doesn't support ACPI S3 suspend;
> Is that really the case? I though S3 was pretty "normal" these days.

I don't think I've never encountered a server without S3, although
sometimes it does require enabling in the firmware.

~Andrew

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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  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
  1 sibling, 1 reply; 10+ messages in thread
From: George Dunlap @ 2018-05-22 11:21 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Ben Guthro, Andrew Cooper, Marek Marczykowski, Dario Faggioli,
	Ian Jackson, xen-devel

On 05/22/2018 11:51 AM, Jan Beulich wrote:
>>>> On 21.05.18 at 16:16, <george.dunlap@citrix.com> wrote:
>> Most server-class hardware doesn't support ACPI S3 suspend;
> 
> Is that really the case? I though S3 was pretty "normal" these days.
> 
>> but most bugs we'll run across won't need actual S3 to trigger.
> 
> Not sure about this one either: In particular the microcode issue
> addressed recently does require actual S3 to surface. I'm not
> meaning to put under question the usefulness of this option,
> though. I'd just like the description to not lead to people drawing
> wrong conclusions.

Re S3 support, I was just repeating what I'd heard.  My judgement is
still that "most" bugs we end up encountering will be on the Xen side;
but I'm happy to reword it to take out / moderate both implications.

 -George

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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  2018-05-22 11:21   ` George Dunlap
@ 2018-05-22 11:44     ` Jan Beulich
  2018-05-22 13:21       ` George Dunlap
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2018-05-22 11:44 UTC (permalink / raw)
  To: george.dunlap
  Cc: Andrew Cooper, Dario Faggioli, xen-devel, Marek Marczykowski,
	Ian Jackson

>>> On 22.05.18 at 13:21, <george.dunlap@citrix.com> wrote:
> On 05/22/2018 11:51 AM, Jan Beulich wrote:
>>>>> On 21.05.18 at 16:16, <george.dunlap@citrix.com> wrote:
>>> Most server-class hardware doesn't support ACPI S3 suspend;
>> 
>> Is that really the case? I though S3 was pretty "normal" these days.
>> 
>>> but most bugs we'll run across won't need actual S3 to trigger.
>> 
>> Not sure about this one either: In particular the microcode issue
>> addressed recently does require actual S3 to surface. I'm not
>> meaning to put under question the usefulness of this option,
>> though. I'd just like the description to not lead to people drawing
>> wrong conclusions.
> 
> Re S3 support, I was just repeating what I'd heard.  My judgement is
> still that "most" bugs we end up encountering will be on the Xen side;
> but I'm happy to reword it to take out / moderate both implications.

Oh, surely issues normally are on the Xen side. It's just that there's a
fair range of issues which still require actually going through S3 to
show up - the ucode issues after XSA-254 are a good example thereof.

Jan



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

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

* Re: [PATCH] xen: Add fake_s3 command-line option for testing
  2018-05-22 11:44     ` Jan Beulich
@ 2018-05-22 13:21       ` George Dunlap
  0 siblings, 0 replies; 10+ messages in thread
From: George Dunlap @ 2018-05-22 13:21 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Andrew Cooper, Dario Faggioli, xen-devel, Marek Marczykowski,
	Ian Jackson

On 05/22/2018 12:44 PM, Jan Beulich wrote:
>>>> On 22.05.18 at 13:21, <george.dunlap@citrix.com> wrote:
>> On 05/22/2018 11:51 AM, Jan Beulich wrote:
>>>>>> On 21.05.18 at 16:16, <george.dunlap@citrix.com> wrote:
>>>> Most server-class hardware doesn't support ACPI S3 suspend;
>>>
>>> Is that really the case? I though S3 was pretty "normal" these days.
>>>
>>>> but most bugs we'll run across won't need actual S3 to trigger.
>>>
>>> Not sure about this one either: In particular the microcode issue
>>> addressed recently does require actual S3 to surface. I'm not
>>> meaning to put under question the usefulness of this option,
>>> though. I'd just like the description to not lead to people drawing
>>> wrong conclusions.
>>
>> Re S3 support, I was just repeating what I'd heard.  My judgement is
>> still that "most" bugs we end up encountering will be on the Xen side;
>> but I'm happy to reword it to take out / moderate both implications.
> 
> Oh, surely issues normally are on the Xen side. It's just that there's a
> fair range of issues which still require actually going through S3 to
> show up - the ucode issues after XSA-254 are a good example thereof.

Well FWIW with acpi_power=s3_fake on staging+patch, the machine hangs
with default bti / xpti settings, and works with bti and xpti disabled.
So at least some part of XSA-254 issues can / would be caught without
having to actually enter real S3.

 -George

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

^ permalink raw reply	[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 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.