[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/20] acpi:piix4, vt82c686: reinitialize acpi PM device on reset
From: |
Michael S. Tsirkin |
Subject: |
[PULL 09/20] acpi:piix4, vt82c686: reinitialize acpi PM device on reset |
Date: |
Mon, 22 Mar 2021 11:44:54 -0400 |
From: Isaku Yamahata <isaku.yamahata@intel.com>
Commit 6be8cf56bc8b made sure that SCI is enabled in PM1.CNT
on reset in acpi_only mode by modifying acpi_pm1_cnt_reset() and
that worked for q35 as expected.
The function was introduced by commit
eaba51c573a (acpi, acpi_piix, vt82c686: factor out PM1_CNT logic)
that forgot to actually call it at piix4 reset time and as result
SCI_EN wasn't set as was expected by 6be8cf56bc8b in acpi_only mode.
So Windows crashes when it notices that SCI_EN is not set and FADT is
not providing information about how to enable it anymore.
Reproducer:
qemu-system-x86_64 -enable-kvm -M pc-i440fx-6.0,smm=off -cdrom
any_windows_10x64.iso
Fix it by calling acpi_pm1_cnt_reset() at piix4 reset time.
Occasionally this patch adds reset acpi PM related registers on
piix4/vt582c686 reset time and de-assert sci.
piix4_pm_realize() initializes acpi pm tmr, evt, cnt and gpe.
via_pm_realize() initializes acpi pm tmr, evt and cnt.
reset them on device reset. pm_reset() in ich9.c correctly calls
corresponding reset functions.
Fixes: 6be8cf56bc8b (acpi/core: always set SCI_EN when SMM isn't supported)
Reported-by: Reinoud Zandijk <reinoud@NetBSD.org>
Co-developed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Message-Id:
<1ceb31c6782f701674d3b907a419f5a82adb37bc.1616012290.git.isaku.yamahata@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/acpi/piix4.c | 7 +++++++
hw/isa/vt82c686.c | 5 +++++
2 files changed, 12 insertions(+)
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 1efc0ded9f..a00525025b 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -325,6 +325,13 @@ static void piix4_pm_reset(DeviceState *dev)
/* Mark SMM as already inited (until KVM supports SMM). */
pci_conf[0x5B] = 0x02;
}
+
+ acpi_pm1_evt_reset(&s->ar);
+ acpi_pm1_cnt_reset(&s->ar);
+ acpi_pm_tmr_reset(&s->ar);
+ acpi_gpe_reset(&s->ar);
+ acpi_update_sci(&s->ar, s->irq);
+
pm_io_space_update(s);
acpi_pcihp_reset(&s->acpi_pci_hotplug, !s->use_acpi_root_pci_hotplug);
}
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 05d084f698..7bacad03e2 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -167,6 +167,11 @@ static void via_pm_reset(DeviceState *d)
/* SMBus IO base */
pci_set_long(s->dev.config + 0x90, 1);
+ acpi_pm1_evt_reset(&s->ar);
+ acpi_pm1_cnt_reset(&s->ar);
+ acpi_pm_tmr_reset(&s->ar);
+ pm_update_sci(s);
+
pm_io_space_update(s);
smb_io_space_update(s);
}
--
MST
- [PULL 00/20] pc,virtio,pci: fixes, features, Michael S. Tsirkin, 2021/03/22
- [PULL 01/20] virtio: Fix virtio_mmio_read()/virtio_mmio_write(), Michael S. Tsirkin, 2021/03/22
- [PULL 03/20] vhost-user: Fix double-close on slave_read() error path, Michael S. Tsirkin, 2021/03/22
- [PULL 02/20] vhost-user: Drop misleading EAGAIN checks in slave_read(), Michael S. Tsirkin, 2021/03/22
- [PULL 04/20] vhost-user: Factor out duplicated slave_fd teardown code, Michael S. Tsirkin, 2021/03/22
- [PULL 05/20] vhost-user: Convert slave channel to QIOChannelSocket, Michael S. Tsirkin, 2021/03/22
- [PULL 06/20] vhost-user: Introduce nested event loop in vhost_user_read(), Michael S. Tsirkin, 2021/03/22
- [PULL 07/20] vhost-user: Monitor slave channel in vhost_user_read(), Michael S. Tsirkin, 2021/03/22
- [PULL 08/20] virtio-pmem: fix virtio_pmem_resp assign problem, Michael S. Tsirkin, 2021/03/22
- [PULL 09/20] acpi:piix4, vt82c686: reinitialize acpi PM device on reset,
Michael S. Tsirkin <=
- [PULL 11/20] pci: introduce acpi-index property for PCI device, Michael S. Tsirkin, 2021/03/22
- [PULL 12/20] pci: acpi: ensure that acpi-index is unique, Michael S. Tsirkin, 2021/03/22
- [PULL 13/20] acpi: add aml_to_decimalstring() and aml_call6() helpers, Michael S. Tsirkin, 2021/03/22
- [PULL 16/20] acpi: Set proper maximum size for "etc/table-loader" blob, Michael S. Tsirkin, 2021/03/22
- [PULL 17/20] microvm: Don't open-code "etc/table-loader", Michael S. Tsirkin, 2021/03/22
- [PULL 18/20] acpi: Move maximum size logic into acpi_add_rom_blob(), Michael S. Tsirkin, 2021/03/22
- [PULL 19/20] acpi: Set proper maximum size for "etc/acpi/rsdp" blob, Michael S. Tsirkin, 2021/03/22
- [PULL 20/20] acpi: Move setters/getters of oem fields to X86MachineState, Michael S. Tsirkin, 2021/03/22
- [PULL 14/20] pci: acpi: add _DSM method to PCI devices, Michael S. Tsirkin, 2021/03/22
- [PULL 15/20] tests: acpi: update expected blobs, Michael S. Tsirkin, 2021/03/22