qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hu Tao <hutao@cn.fujitsu.com>
To: qemu-devel <qemu-devel@nongnu.org>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Gleb Natapov <gleb@redhat.com>, Blue Swirl <blauwirbel@gmail.com>,
	Eric Blake <eblake@redhat.com>, Andrew Jones <drjones@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Sasha Levin <levinsasha928@gmail.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Markus Armbruster <armbru@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Orit Wasserman <owasserm@redhat.com>,
	Wen Congyang <wency@cn.fujitsu.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	Alex Williamson <alex.williamson@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	seabios@seabios.org
Subject: [Qemu-devel] [PATCH v15 2/2] patch dsdt to use passed-in pvpanic ioport
Date: Thu, 21 Mar 2013 17:08:34 +0800	[thread overview]
Message-ID: <1363856914-23399-2-git-send-email-hutao@cn.fujitsu.com> (raw)
In-Reply-To: <cover.1363847789.git.hutao@cn.fujitsu.com>

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 src/acpi-dsdt-isa.dsl | 14 ++++++++++++--
 src/acpi.c            |  9 +++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
index 87a31b9..43fe719 100644
--- a/src/acpi-dsdt-isa.dsl
+++ b/src/acpi-dsdt-isa.dsl
@@ -102,7 +102,9 @@ Scope(\_SB.PCI0.ISA) {
 
     Device(PEVT) {
         Name(_HID, "QEMU0001")
-        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
+        ACPI_EXTRACT_NAME_WORD_CONST dsdt_isa_pest
+        Name(PEST, 0x505)
+        OperationRegion(PEOR, SystemIO, PEST, 0x01)
         Field(PEOR, ByteAcc, NoLock, Preserve) {
             PEPT,   8,
         }
@@ -126,7 +128,15 @@ Scope(\_SB.PCI0.ISA) {
         }
 
         Name(_CRS, ResourceTemplate() {
-            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
+            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01, IO)
         })
+
+        CreateWordField(_CRS, IO._MIN, IOMN)
+        CreateWordField(_CRS, IO._MAX, IOMX)
+
+        Method(_INI, 0, NotSerialized) {
+            Store(PEST, IOMN)
+            Store(PEST, IOMX)
+        }
     }
 }
diff --git a/src/acpi.c b/src/acpi.c
index 119d1c1..42fa06e 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -286,11 +286,20 @@ static const struct pci_device_id fadt_init_tbl[] = {
     PCI_DEVICE_END
 };
 
+static void patch_dsdt(void *dsdt)
+{
+    u8 *dsdt_ptr = dsdt;
+    int pvpanic_port = romfile_loadint("etc/pvpanic-port", 0x505);
+
+    *(u16 *)(dsdt_ptr + *dsdt_isa_pest) = pvpanic_port;
+}
+
 static void fill_dsdt(struct fadt_descriptor_rev1 *fadt, void *dsdt)
 {
     if (fadt->dsdt) {
         free((void *)le32_to_cpu(fadt->dsdt));
     }
+    patch_dsdt(dsdt);
     fadt->dsdt = cpu_to_le32((u32)dsdt);
     fadt->checksum -= checksum(fadt, sizeof(*fadt));
     dprintf(1, "ACPI DSDT=%p\n", dsdt);
-- 
1.8.1.4

  parent reply	other threads:[~2013-03-21  9:08 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21  8:35 [Qemu-devel] [PATCH v15 0/6] Add pvpanic device to deal with guest panic event Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 1/6] add a new runstate: RUN_STATE_GUEST_PANICKED Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 2/6] add a new qevent: QEVENT_GUEST_PANICKED Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 3/6] introduce a new qom device to deal with panicked event Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 4/6] pvpanic: add document of pvpanic Hu Tao
2013-03-21  9:13   ` Paolo Bonzini
2013-03-22  7:15     ` Hu Tao
2013-03-26  3:03     ` [Qemu-devel] [PATCH v15.1 " Hu Tao
2013-03-26  9:21       ` Paolo Bonzini
2013-03-26 15:07       ` Eric Blake
2013-03-28  6:16         ` [Qemu-devel] [PATCH v15.2 " Hu Tao
2013-03-28 12:16           ` Eric Blake
2013-03-28 14:57             ` Paolo Bonzini
2013-03-29  7:15               ` Hu Tao
2013-03-29  7:12             ` Hu Tao
2013-03-22  1:59   ` [Qemu-devel] [PATCH v15 " Eric Blake
2013-03-22  7:15     ` Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [RFC][PATCH v15 5/6] pc_piix, pc_q35: export fw_cfg Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [RFC][PATCH v15 6/6] pvpanic: pass configurable ioport to seabios Hu Tao
2013-03-21  9:09   ` Paolo Bonzini
2013-03-21  9:08 ` [Qemu-devel] [PATCH v15 1/2] add pvpanic device driver Hu Tao
2013-03-21  9:08 ` Hu Tao [this message]
2013-03-21  9:11   ` [Qemu-devel] [PATCH v15 2/2] patch dsdt to use passed-in pvpanic ioport Paolo Bonzini
2013-03-21  9:17     ` Hu Tao
2013-03-22  7:48       ` Gleb Natapov
2013-03-26  1:59         ` Hu Tao
2013-03-26  7:03           ` Paolo Bonzini
2013-03-26  7:24             ` Hu Tao
2013-03-26  7:53               ` Paolo Bonzini
2013-03-26  8:52                 ` [Qemu-devel] [PATCH v15.1] Add pvpanic device driver Hu Tao
2013-03-26  9:08                   ` Paolo Bonzini
2013-03-26  9:14                     ` [Qemu-devel] [PATCH v15.1 resend] " Hu Tao
2013-03-21  9:54   ` [Qemu-devel] [PATCH v15 2/2] patch dsdt to use passed-in pvpanic ioport Michael S. Tsirkin
2013-03-22  7:25     ` Hu Tao
2013-03-21 22:54   ` [Qemu-devel] [SeaBIOS] " Kevin O'Connor
2013-03-22  7:23     ` Hu Tao
2013-03-21  9:13 ` [Qemu-devel] [PATCH v15] pvpanic: pvpanic device driver Hu Tao

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=1363856914-23399-2-git-send-email-hutao@cn.fujitsu.com \
    --to=hutao@cn.fujitsu.com \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=borntraeger@de.ibm.com \
    --cc=drjones@redhat.com \
    --cc=eblake@redhat.com \
    --cc=gleb@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lcapitulino@redhat.com \
    --cc=levinsasha928@gmail.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=owasserm@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=seabios@seabios.org \
    --cc=stefanha@redhat.com \
    --cc=wency@cn.fujitsu.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).