[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 16/21] acpi_piix4: Update dimm state on VM re
From: |
Vasilis Liaskovitis |
Subject: |
[Qemu-devel] [RFC PATCH v2 16/21] acpi_piix4: Update dimm state on VM reboot |
Date: |
Wed, 11 Jul 2012 12:32:01 +0200 |
in case of hot-remove or hot-add failure, the dimm bitmaps in qemu and Seabios
are inconsistent with the true state of the DIMM devices. The "populated" field
of the DimmState reflects the true state of the device. This inconsistency means
that a failed operation cannot be retried.
Ths patch updates the bit array to the true state of the dimms on VM reboot.
This allows retry of failed hot-add or hot-remove operations after a reboot.
Retrying a failed hot operation is not yet possible before reboot (the following
patch removes this limitation for guests with _OST acpi support)
Signed-off-by: Vasilis Liaskovitis <address@hidden>
---
hw/acpi_piix4.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index d8e2c22..ebc5de7 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -91,6 +91,7 @@ typedef struct PIIX4PMState {
} PIIX4PMState;
static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s);
+static void piix4_dimm_state_sync(PIIX4PMState *s);
#define ACPI_ENABLE 0xf1
#define ACPI_DISABLE 0xf0
@@ -369,6 +370,7 @@ static void piix4_reset(void *opaque)
/* Mark SMM as already inited (until KVM supports SMM). */
pci_conf[0x5B] = 0x02;
}
+ piix4_dimm_state_sync(s);
piix4_update_hotplug(s);
}
@@ -671,6 +673,29 @@ static int piix4_dimm_hotplug(DeviceState *qdev,
SysBusDevice *dev, int
return 0;
}
+void piix4_dimm_state_sync(PIIX4PMState *s)
+{
+ struct gpe_regs *g = &s->gperegs;
+ DimmState *slot = NULL;
+ uint32_t i, temp = 1;
+
+ for(i = 0; i < MAX_DIMMS; i++) {
+ slot = dimm_find_from_idx(i);
+ if (!slot)
+ break;
+ if (i % 8 == 0) {
+ temp = 1;
+ g->mems_sts[i / 8] = 0;
+ }
+ else
+ temp = temp << 1;
+ if (slot->populated) {
+ g->mems_sts[i / 8] |= temp;
+ }
+ slot->pending = false;
+ }
+}
+
static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
PCIHotplugState state)
{
--
1.7.9
- [Qemu-devel] [RFC PATCH v2 02/21][SeaBIOS] Add SSDT memory device support, (continued)
- [Qemu-devel] [RFC PATCH v2 02/21][SeaBIOS] Add SSDT memory device support, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 14/21][SeaBIOS] acpi_dsdt: Support _OST dimm method, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 17/21][SeaBIOS] acpi_dsdt: Revert internal dimm state on _OST failure, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 06/21] dimm: Implement memory device abstraction, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 03/21][SeaBIOS] acpi-dsdt: Implement functions for memory hotplug, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 12/21] fix live-migration when "populated=on" is missing, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 10/21] Implement "-dimm" command line option, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 09/21] pc: Add dimm paravirt SRAT info, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 11/21] Implement dimm_add and dimm_del hmp/qmp commands, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 07/21] acpi_piix4: Implement memory device hotplug registers, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 16/21] acpi_piix4: Update dimm state on VM reboot,
Vasilis Liaskovitis <=
- [Qemu-devel] [RFC PATCH v2 13/21] Implement memory hotplug notification lists, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 15/21] acpi_piix4: _OST dimm support, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 18/21] acpi_piix4: Update dimm bitmap state on hot-remove fail, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 19/21] Implement "info memtotal" and "query-memtotal", Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 21/21] Implement mem_increase, mem_decrease hmp/qmp commands, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 20/21] Implement -dimms, -dimmspop command line options, Vasilis Liaskovitis, 2012/07/11