From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOkz-0007PY-TP for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:23:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzOky-0007cd-JS for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:23:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOky-0007cX-Dj for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:23:52 -0400 Date: Mon, 1 Jun 2015 14:23:49 +0200 From: "Michael S. Tsirkin" Message-ID: <1433161230-29421-28-git-send-email-mst@redhat.com> References: <1433161230-29421-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1433161230-29421-1-git-send-email-mst@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL v2 27/60] pc: acpi: fix pvpanic for buggy guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Richard Henderson , Paolo Bonzini , Eduardo Habkost , =?us-ascii?B?PT9VVEYtOD9xP1JhZGltPTIwS3I9QzQ9OERtPUMzPUExPUM1PTk5Pz0=?= From: Radim Kr=C4=8Dm=C3=A1=C5=99 In the old times, we always had pvpanic in ACPI and a _STA method told the guest not to use it. Automatic generation dropped the _STA method as the specification says that missing _STA means enabled and working. Some guests (Linux) had buggy drivers and this change made them unable to utilize pvpanic. A Linux patch is posted as well, but I think it's worth to make pvpanic useable on old guests at the price of three lines and few bytes of SSDT. The old _STA method was Method (_STA, 0, NotSerialized) { Store (PEST, Local0) If (LEqual (Local0, Zero)) { Return (Zero) } Else { Return (0x0F) }} Igor pointed out that we don't need to use a method to return a constant and that 0xB (don't show in UI) is the common definition now. Also, the device used to be PEVT. (PEVT as in "panic event"?) Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 3d19de6..283d02e 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,9 @@ build_ssdt(GArray *table_data, GArray *linker, aml_append(field, aml_named_field("PEPT", 8)); aml_append(dev, field); =20 + /* 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))); --=20 MST