From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyG1K-00067s-0I for qemu-devel@nongnu.org; Fri, 29 May 2015 04:52:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyG1H-0006Ur-O5 for qemu-devel@nongnu.org; Fri, 29 May 2015 04:52:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyG1H-0006Ui-IX for qemu-devel@nongnu.org; Fri, 29 May 2015 04:51:59 -0400 Date: Fri, 29 May 2015 10:51:55 +0200 From: Igor Mammedov Message-ID: <20150529105155.22255ce9@nial.brq.redhat.com> In-Reply-To: <1432744157-13798-1-git-send-email-rkrcmar@redhat.com> References: <1432744157-13798-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] pc: acpi: keep pvpanic backward compatible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Radim =?UTF-8?B?S3LEjW3DocWZ?= Cc: pbonzini@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, rth@twiddle.net On Wed, 27 May 2015 18:29:17 +0200 Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > In the old times, we always had pvpanic in ACPI and a _STA function told > the guest not to use it. Now, we only include pvpanic in ACPI if it is > enabled, so the _STA function is useless from qemu's point of view, but > guests still want to query availability. Make them happy. maybe also fix guest's driver not to do since absence of _STA implies that device is present according to ACPI6.0 6.3.7 _STA or only fix driver and drop this patch so that QEMU wouldn't carry useless junk. >=20 > This patch extends > e65bef695441 pc: acpi: fix pvpanic regression >=20 > The original _STA method was > Method (_STA, 0, NotSerialized) { > Store (PEST, Local0) > If (LEqual (Local0, Zero)) { > Return (Zero) } > Else { > Return (0x0F) }} >=20 > hence we return only 0xf now. > (Why Linux does '& 0xb' on this result is completely beyond me.) check _STA related comment in SMC >=20 > Also, the device used to be PEVT. (PEVT as in "panic event"?) >=20 > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > --- > hw/i386/acpi-build.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 73259e729b9f..4141c110a8e1 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -733,7 +733,7 @@ build_ssdt(GArray *table_data, GArray *linker, > if (misc->pvpanic_port) { > scope =3D aml_scope("\\_SB.PCI0.ISA"); > =20 > - dev =3D aml_device("PEVR"); > + dev =3D aml_device("PEVT"); > aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0001"))); > =20 > crs =3D aml_resource_template(); > @@ -748,6 +748,10 @@ build_ssdt(GArray *table_data, GArray *linker, > aml_append(field, aml_named_field("PEPT", 8)); > aml_append(dev, field); > =20 > + method =3D aml_method("_STA", 0); > + aml_append(method, aml_return(aml_int(0xf))); > + aml_append(dev, method); doesn't have to be method, make it like this: /* device present, functioning, decoding, not shown in UI */ aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); > + > method =3D aml_method("RDPT", 0); > aml_append(method, aml_store(aml_name("PEPT"), aml_local(0))); > aml_append(method, aml_return(aml_local(0)));