qemu-kvm/kvm-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch
Danilo C. L. de Paula dd7aef2877 * Tue Mar 17 2020 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.2.0-15.el8
- kvm-block-nbd-Fix-hang-in-.bdrv_close.patch [bz#1640894]
- kvm-block-Generic-file-creation-fallback.patch [bz#1640894]
- kvm-file-posix-Drop-hdev_co_create_opts.patch [bz#1640894]
- kvm-iscsi-Drop-iscsi_co_create_opts.patch [bz#1640894]
- kvm-iotests-Add-test-for-image-creation-fallback.patch [bz#1640894]
- kvm-block-Fix-leak-in-bdrv_create_file_fallback.patch [bz#1640894]
- kvm-iotests-Use-complete_and_wait-in-155.patch [bz#1790482 bz#1805143]
- kvm-block-Introduce-bdrv_reopen_commit_post-step.patch [bz#1790482 bz#1805143]
- kvm-block-qcow2-Move-bitmap-reopen-into-bdrv_reopen_comm.patch [bz#1790482 bz#1805143]
- kvm-iotests-Refactor-blockdev-reopen-test-for-iothreads.patch [bz#1790482 bz#1805143]
- kvm-block-bdrv_reopen-with-backing-file-in-different-Aio.patch [bz#1790482 bz#1805143]
- kvm-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch [bz#1790482 bz#1805143]
- kvm-block-Make-bdrv_get_cumulative_perm-public.patch [bz#1790482 bz#1805143]
- kvm-block-Relax-restrictions-for-blockdev-snapshot.patch [bz#1790482 bz#1805143]
- kvm-iotests-Fix-run_job-with-use_log-False.patch [bz#1790482 bz#1805143]
- kvm-iotests-Test-mirror-with-temporarily-disabled-target.patch [bz#1790482 bz#1805143]
- kvm-block-Fix-cross-AioContext-blockdev-snapshot.patch [bz#1790482 bz#1805143]
- kvm-iotests-Add-iothread-cases-to-155.patch [bz#1790482 bz#1805143]
- kvm-qapi-Add-allow-write-only-overlay-feature-for-blockd.patch [bz#1790482 bz#1805143]
- kvm-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch [bz#1809380]
- Resolves: bz#1640894
  (Fix generic file creation fallback for qemu-img nvme:// image creation support)
- Resolves: bz#1790482
  (bitmaps in backing images can't be modified)
- Resolves: bz#1805143
  (allow late/lazy opening of backing chain for shallow blockdev-mirror)
- Resolves: bz#1809380
  (guest hang during reboot process after migration from RHEl7.8 to RHEL8.2.0.)
2020-03-17 00:52:27 +00:00

86 lines
3.1 KiB
Diff

From 5770fe43fe1e15e6f53cfd3705605e8645b95a98 Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 13 Mar 2020 17:17:08 +0000
Subject: [PATCH 20/20] exec/rom_reset: Free rom data during inmigrate skip
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20200313171708.242774-1-dgilbert@redhat.com>
Patchwork-id: 94292
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH 1/1] exec/rom_reset: Free rom data during inmigrate skip
Bugzilla: 1809380
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
bz: https://bugzilla.redhat.com/show_bug.cgi?id=1809380
brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=27249921
branch: rhel-av-8.2.0
upstream: Posted and with review-by, not merged yet
Commit 355477f8c73e9 skips rom reset when we're an incoming migration
so as not to overwrite shared ram in the ignore-shared migration
optimisation.
However, it's got an unexpected side effect that because it skips
freeing the ROM data, when rom_reset gets called later on, after
migration (e.g. during a reboot), the ROM does get reset to the original
file contents. Because of seabios/x86's weird reboot process
this confuses a reboot into hanging after a migration.
Fixes: 355477f8c73e9 ("migration: do not rom_reset() during incoming migration")
https://bugzilla.redhat.com/show_bug.cgi?id=1809380
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/core/loader.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 5099f27..375b29b 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -1118,19 +1118,26 @@ static void rom_reset(void *unused)
{
Rom *rom;
- /*
- * We don't need to fill in the RAM with ROM data because we'll fill
- * the data in during the next incoming migration in all cases. Note
- * that some of those RAMs can actually be modified by the guest on ARM
- * so this is probably the only right thing to do here.
- */
- if (runstate_check(RUN_STATE_INMIGRATE))
- return;
-
QTAILQ_FOREACH(rom, &roms, next) {
if (rom->fw_file) {
continue;
}
+ /*
+ * We don't need to fill in the RAM with ROM data because we'll fill
+ * the data in during the next incoming migration in all cases. Note
+ * that some of those RAMs can actually be modified by the guest.
+ */
+ if (runstate_check(RUN_STATE_INMIGRATE)) {
+ if (rom->data && rom->isrom) {
+ /*
+ * Free it so that a rom_reset after migration doesn't
+ * overwrite a potentially modified 'rom'.
+ */
+ rom_free_data(rom);
+ }
+ continue;
+ }
+
if (rom->data == NULL) {
continue;
}
--
1.8.3.1