From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] xen: add a 'acpi_fake_s3' boot command line parameter Date: Mon, 22 Jun 2015 14:39:13 +0200 Message-ID: <1434976753.25170.75.camel@citrix.com> References: <20150622112847.14314.18653.stgit@Solace.station> <558812450200007800087786@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2878586850053114618==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z710S-0007UZ-VV for xen-devel@lists.xenproject.org; Mon, 22 Jun 2015 12:39:21 +0000 In-Reply-To: <558812450200007800087786@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Andrew Cooper , Ben Guthro , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org --===============2878586850053114618== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-9zdbHuqYVB8/uRP4jgu/" --=-9zdbHuqYVB8/uRP4jgu/ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-06-22 at 12:48 +0100, Jan Beulich wrote: > >>> On 22.06.15 at 13:28, wrote: > > --- a/xen/arch/x86/acpi/power.c > > +++ b/xen/arch/x86/acpi/power.c > > @@ -33,6 +33,9 @@ > > =20 > > uint32_t system_reset_counter =3D 1; > > =20 > > +static bool_t __read_mostly fake_s3 =3D 0; > > +boolean_param("acpi_fake_s3", fake_s3); > > + > > static char __initdata opt_acpi_sleep[20]; > > string_param("acpi_sleep", opt_acpi_sleep); > > =20 > > @@ -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 =3D tboot_s3_resume(); > > break; >=20 > The change is so simple that, considering it's for debugging purposes > only, I don't see why people needing to debug this code couldn't > apply it themselves when needed. > When Ben sent this out some time ago for the first time, one purpose was also using it for making it possible to test S3 in osstest, even on hardware that does not support (properly) that feature. I've also done some work in that direction (I did write a test case), and the point is probably still valid. However, this patch alone can't make the above happen by itself, as on such hardware, it's not possible to echo 'mem' in /sys/power/state, and hence trigger the (fake) suspend (or at least that is my experience). So this patch would still be a step in the right direction , but together with something that allows us to trigger the suspensions from Dom0, bypassing Linux's checks, which is something I haven't investigated. > Imo, if to be considered at all, it > should be made !NDEBUG dependent. >=20 Ok, I'll make that so when/if respinning. Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-9zdbHuqYVB8/uRP4jgu/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlWIAfEACgkQk4XaBE3IOsRXlwCfewaM0o+Sjj7HCf+47golVN+t ZncAn3HgbwAKEVCYGNUL4EjBVTa3GKr8 =h/WM -----END PGP SIGNATURE----- --=-9zdbHuqYVB8/uRP4jgu/-- --===============2878586850053114618== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2878586850053114618==--