From patchwork Tue Aug 7 12:52:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: reset PMBA and PMREGMISC PIIX4 registers. Date: Tue, 07 Aug 2012 02:52:03 -0000 From: Gleb Natapov X-Patchwork-Id: 175624 Message-Id: <20120807125203.GC3341@redhat.com> To: qemu-devel@nongnu.org Cc: lersek@redhat.com The bug causes Windows + OVMF hang after reboot since OVMF checks PMREGMISC to see if IO space is enabled and skip configuration if it is. Signed-off-by: Gleb Natapov Reviewed-by: Laszlo Ersek --- Gleb. diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 0aace60..90b46b5 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -353,6 +353,9 @@ static void piix4_reset(void *opaque) pci_conf[0x5a] = 0; pci_conf[0x5b] = 0; + pci_conf[0x40] = 0x01; /* PM io base read only bit */ + pci_conf[0x80] = 0; + if (s->kvm_enabled) { /* Mark SMM as already inited (until KVM supports SMM). */ pci_conf[0x5B] = 0x02; @@ -392,8 +395,6 @@ static int piix4_pm_initfn(PCIDevice *dev) pci_conf[0x09] = 0x00; pci_conf[0x3d] = 0x01; // interrupt pin 1 - pci_conf[0x40] = 0x01; /* PM io base read only bit */ - /* APM */ apm_init(&s->apm, apm_ctrl_changed, s);