[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 23/23] s3 support: enabling s3 with q35
From: |
Joel Upham |
Subject: |
[PATCH v1 23/23] s3 support: enabling s3 with q35 |
Date: |
Tue, 20 Jun 2023 13:24:57 -0400 |
Resetting pci devices after s3 causes guest freezes, as xen usually
likes to handle resetting devices.
Signed-off-by: Joel Upham <jupham125@gmail.com>
---
hw/acpi/ich9.c | 12 ++++++++----
hw/pci-host/q35.c | 3 ++-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 1c236be1c7..234706a191 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -143,7 +143,8 @@ static int ich9_pm_post_load(void *opaque, int version_id)
{
ICH9LPCPMRegs *pm = opaque;
uint32_t pm_io_base = pm->pm_io_base;
- pm->pm_io_base = 0;
+ if (!xen_enabled())
+ pm->pm_io_base = 0;
ich9_pm_iospace_update(pm, pm_io_base);
return 0;
}
@@ -274,7 +275,10 @@ static void pm_reset(void *opaque)
acpi_pm1_evt_reset(&pm->acpi_regs);
acpi_pm1_cnt_reset(&pm->acpi_regs);
acpi_pm_tmr_reset(&pm->acpi_regs);
- acpi_gpe_reset(&pm->acpi_regs);
+ /* Noticed guest freezing in xen when this was reset after S3. */
+ if (!xen_enabled()) {
+ acpi_gpe_reset(&pm->acpi_regs);
+ }
pm->smi_en = 0;
if (!pm->smm_enabled) {
@@ -322,7 +326,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
qemu_irq sci_irq)
acpi_pm_tco_init(&pm->tco_regs, &pm->io);
}
- if (pm->acpi_pci_hotplug.use_acpi_hotplug_bridge) {
+ if (pm->acpi_pci_hotplug.use_acpi_hotplug_bridge || xen_enabled()) {
acpi_pcihp_init(OBJECT(lpc_pci),
&pm->acpi_pci_hotplug,
pci_get_bus(lpc_pci),
@@ -345,7 +349,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
qemu_irq sci_irq)
legacy_acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci),
OBJECT(lpc_pci), &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);
- if (pm->acpi_memory_hotplug.is_enabled) {
+ if (pm->acpi_memory_hotplug.is_enabled || xen_enabled()) {
acpi_memory_hotplug_init(pci_address_space_io(lpc_pci),
OBJECT(lpc_pci),
&pm->acpi_memory_hotplug,
ACPI_MEMORY_HOTPLUG_BASE);
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 1fe4e5a5c9..5891839ce9 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -580,7 +580,8 @@ static void mch_reset(DeviceState *qdev)
d->config[MCH_HOST_BRIDGE_F_SMBASE] = 0;
d->wmask[MCH_HOST_BRIDGE_F_SMBASE] = 0xff;
- mch_update(mch);
+ if (!xen_enabled())
+ mch_update(mch);
}
static void mch_realize(PCIDevice *d, Error **errp)
--
2.34.1
- [PATCH v1 04/23] q35/xen: Add Xen platform device support for Q35, (continued)
- [PATCH v1 04/23] q35/xen: Add Xen platform device support for Q35, Joel Upham, 2023/06/20
- [PATCH v1 05/23] q35: Fix incorrect values for PCIEXBAR masks, Joel Upham, 2023/06/20
- [PATCH v1 11/23] xen/pt: handle PCIe Extended Capabilities Next register, Joel Upham, 2023/06/20
- [PATCH v1 14/23] xen/pt: add fixed-size PCIe Extended Capabilities descriptors, Joel Upham, 2023/06/20
- [PATCH v1 16/23] xen/pt: add descriptors and size calculation for RCLD/ACS/PMUX/DPA/MCAST/TPH/DPC PCIe Extended Capabilities, Joel Upham, 2023/06/20
- [PATCH v1 19/23] xen/pt: Fake capability id, Joel Upham, 2023/06/20
- [PATCH v1 22/23] qdev-monitor/pt: bypass root device check, Joel Upham, 2023/06/20
- [PATCH v1 09/23] xen/pt: Xen PCIe passthrough support for Q35: bypass PCIe topology check, Joel Upham, 2023/06/20
- [PATCH v1 08/23] xen/pt: determine the legacy/PCIe mode for a passed through device, Joel Upham, 2023/06/20
- [PATCH v1 21/23] pc/q35: setup q35 for xen, Joel Upham, 2023/06/20
- [PATCH v1 23/23] s3 support: enabling s3 with q35,
Joel Upham <=
- [PATCH v1 06/23] xen/pt: XenHostPCIDevice: provide functions for PCI Capabilities and PCIe Extended Capabilities enumeration, Joel Upham, 2023/06/20
- [PATCH v1 13/23] xen/pt: add Vendor-specific PCIe Extended Capability descriptor and sizing, Joel Upham, 2023/06/20
- Re: [PATCH v1 00/23] Q35 support for Xen, Bernhard Beschow, 2023/06/22