12286f39d2
- Include upstream patches designated as stable material and reviewed for applicability to include here. NOTE that the PIIX4 patch has migration implications: the change will also be applied to the SLE-15-SP2 qemu, and a live migration from that version to this SLE-15-SP3 qemu would require this patch to be applied for a successful migration if PIIX4 southbridge is used in the machine emulation (x86 i440fx) block-rbd-fix-memory-leak-in-qemu_rbd_co.patch block-rbd-Fix-memory-leak-in-qemu_rbd_co.patch cpu-core-Fix-help-of-CPU-core-device-typ.patch hw-arm-virt-acpi-build-Fix-GSIV-values-o.patch hw-block-fdc-Fix-fallback-property-on-sy.patch hw-isa-Kconfig-Add-missing-dependency-VI.patch hw-isa-piix4-Migrate-Reset-Control-Regis.patch hw-virtio-pci-Added-AER-capability.patch hw-virtio-pci-Added-counter-for-pcie-cap.patch s390x-css-report-errors-from-ccw_dstream.patch target-xtensa-fix-meson.build-rule-for-x.patch util-fix-use-after-free-in-module_load_o.patch virtio-pci-compat-page-aligned-ATS.patch OBS-URL: https://build.opensuse.org/request/show/885459 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=634
63 lines
1.9 KiB
Diff
63 lines
1.9 KiB
Diff
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org>
|
|
Date: Wed, 24 Mar 2021 14:54:43 +0100
|
|
Subject: hw/isa/piix4: Migrate Reset Control Register
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Git-commit: 62271205bcfaee440d06c06060ee79dac657caff
|
|
|
|
When adding the Reset register in commit 5790b757cfb we
|
|
forgot to migrate it.
|
|
|
|
While it is possible a VM using the PIIX4 is migrated just
|
|
after requesting a system shutdown, it is very unlikely.
|
|
However when restoring a migrated VM, we might have the
|
|
RCR bit #4 set on the stack and when the VM resume it
|
|
directly shutdowns.
|
|
|
|
Add a post_load() migration handler and set the default
|
|
RCR value to 0 for earlier versions, assuming the VM was
|
|
not going to shutdown before migration.
|
|
|
|
Fixes: 5790b757cfb ("piix4: Add the Reset Control Register")
|
|
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
Message-Id: <20210324200334.729899-1-f4bug@amsat.org>
|
|
Signed-off-by: Bruce Rogers <brogers@suse.com>
|
|
---
|
|
hw/isa/piix4.c | 15 ++++++++++++++-
|
|
1 file changed, 14 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
|
|
index a50d97834c760e3ebc5103614ee9..b3b6a4378a334b1a4bf0105a6857 100644
|
|
--- a/hw/isa/piix4.c
|
|
+++ b/hw/isa/piix4.c
|
|
@@ -93,12 +93,25 @@ static void piix4_isa_reset(DeviceState *dev)
|
|
pci_conf[0xae] = 0x00;
|
|
}
|
|
|
|
+static int piix4_ide_post_load(void *opaque, int version_id)
|
|
+{
|
|
+ PIIX4State *s = opaque;
|
|
+
|
|
+ if (version_id == 2) {
|
|
+ s->rcr = 0;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static const VMStateDescription vmstate_piix4 = {
|
|
.name = "PIIX4",
|
|
- .version_id = 2,
|
|
+ .version_id = 3,
|
|
.minimum_version_id = 2,
|
|
+ .post_load = piix4_ide_post_load,
|
|
.fields = (VMStateField[]) {
|
|
VMSTATE_PCI_DEVICE(dev, PIIX4State),
|
|
+ VMSTATE_UINT8_V(rcr, PIIX4State, 3),
|
|
VMSTATE_END_OF_LIST()
|
|
}
|
|
};
|