[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v3 16/19] Update dimm state on reset
From: |
Vasilis Liaskovitis |
Subject: |
[Qemu-devel] [RFC PATCH v3 16/19] Update dimm state on reset |
Date: |
Fri, 21 Sep 2012 13:17:32 +0200 |
in case of hot-remove failure on a guest that does not implement _OST,
the dimm bitmaps in qemu and Seabios show the dimm as unplugged, but the dimm
is still present on the qdev/memory bus. To avoid this inconsistency, we set the
dimm state to active/hot-plugged on a reset of the associated acpi_pm device.
This way the dimm is still active after a VM reboot and dimm visibility has
always the same behaviour, regardless of _OST support in the guest.
Signed-off-by: Vasilis Liaskovitis <address@hidden>
---
hw/acpi_piix4.c | 1 +
hw/dimm.c | 20 ++++++++++++++++++++
hw/dimm.h | 1 +
3 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index f7220d4..8bf58a6 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -373,6 +373,7 @@ static void piix4_reset(void *opaque)
pci_conf[0x5B] = 0x02;
}
piix4_update_hotplug(s);
+ dimm_state_sync();
}
static void piix4_powerdown(void *opaque, int irq, int power_failing)
diff --git a/hw/dimm.c b/hw/dimm.c
index 1521462..b993668 100644
--- a/hw/dimm.c
+++ b/hw/dimm.c
@@ -182,6 +182,26 @@ static DimmDevice *dimm_find_from_idx(uint32_t idx)
return NULL;
}
+void dimm_state_sync(void)
+{
+ DimmBus *bus = main_memory_bus;
+ DimmDevice *slot;
+
+ /* if a hot-remove operation is pending on reset, it means the hot-remove
+ * operation has failed, but the guest hasn't notified us e.g. because the
+ * guest does not provide _OST notifications. The device is still present
on
+ * the dimmbus, but the qemu and Seabios dimm bitmaps show this device as
+ * unplugged. To avoid this inconsistency, we set the dimm bits to active
+ * i.e. hot-plugged for each dimm present on the dimmbus.
+ */
+ QTAILQ_FOREACH(slot, &bus->dimmlist, nextdimm) {
+ if (slot->pending == DIMM_REMOVE_PENDING) {
+ if (bus->dimm_revert)
+ bus->dimm_revert(bus->dimm_hotplug_qdev, slot, 0);
+ }
+ }
+}
+
/* used to create a dimm device, only on incoming migration of a hotplugged
* RAMBlock
*/
diff --git a/hw/dimm.h b/hw/dimm.h
index a6c6e6f..ce091fe 100644
--- a/hw/dimm.h
+++ b/hw/dimm.h
@@ -95,5 +95,6 @@ void main_memory_bus_create(Object *parent);
void dimm_config_create(char *id, uint64_t size, uint64_t node,
uint32_t dimm_idx, uint32_t populated);
uint64_t get_hp_memory_total(void);
+void dimm_state_sync(void);
#endif
--
1.7.9
- [Qemu-devel] [RFC PATCH v3 11/19] Implement qmp and hmp commands for notification lists, (continued)
- [Qemu-devel] [RFC PATCH v3 11/19] Implement qmp and hmp commands for notification lists, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 12/19] Implement "info memory-total" and "query-memory-total", Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 17/19][SeaBIOS] Implement _PS3 method for memory device, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 15/19] Add _OST dimm support, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 18/19] Implement _PS3 for dimm, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 13/19] balloon: update with hotplugged memory, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 10/19] fix live-migration when "populated=on" is missing, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 14/19][SeaBIOS] Add _OST dimm method, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 16/19] Update dimm state on reset,
Vasilis Liaskovitis <=
- [Qemu-devel] [RFC PATCH v3 19/19][SeaBIOS] Calculate pcimem_start and pcimem64_start from SRAT entries, Vasilis Liaskovitis, 2012/09/21
- Re: [Qemu-devel] [RFC PATCH v3 19/19][SeaBIOS] Calculate pcimem_start and pcimem64_start from SRAT entries, Wen Congyang, 2012/09/24
- Re: [Qemu-devel] [RFC PATCH v3 00/19] ACPI memory hotplug, Blue Swirl, 2012/09/22