From 200e3560ab974816d225410fc5ff28afab4d2c76 Mon Sep 17 00:00:00 2001 From: "Danilo C. L. de Paula" Date: Tue, 10 Sep 2019 19:56:34 +0100 Subject: [PATCH] * Tue Sep 10 2019 Danilo Cesar Lemes de Paula - 4.1.0-9.el8 - kvm-migration-always-initialise-ram_counters-for-a-new-m.patch [bz#1734316] - kvm-migration-add-qemu_file_update_transfer-interface.patch [bz#1734316] - kvm-migration-add-speed-limit-for-multifd-migration.patch [bz#1734316] - kvm-migration-update-ram_counters-for-multifd-sync-packe.patch [bz#1734316] - kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch [bz#1750200] - kvm-spapr-pci-Free-MSIs-during-reset.patch [bz#1750200] - Resolves: bz#1734316 (multifd migration does not honour speed limits, consumes entire bandwidth of NIC) - Resolves: bz#1750200 ([RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error prompt(qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free)) --- ...-qemu_file_update_transfer-interface.patch | 63 ++++++++ ...dd-speed-limit-for-multifd-migration.patch | 141 ++++++++++++++++++ ...-initialise-ram_counters-for-a-new-m.patch | 139 +++++++++++++++++ ...-ram_counters-for-multifd-sync-packe.patch | 47 ++++++ ...ci-Consolidate-de-allocation-of-MSIs.patch | 103 +++++++++++++ kvm-spapr-pci-Free-MSIs-during-reset.patch | 56 +++++++ qemu-kvm.spec | 26 +++- 7 files changed, 574 insertions(+), 1 deletion(-) create mode 100644 kvm-migration-add-qemu_file_update_transfer-interface.patch create mode 100644 kvm-migration-add-speed-limit-for-multifd-migration.patch create mode 100644 kvm-migration-always-initialise-ram_counters-for-a-new-m.patch create mode 100644 kvm-migration-update-ram_counters-for-multifd-sync-packe.patch create mode 100644 kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch create mode 100644 kvm-spapr-pci-Free-MSIs-during-reset.patch diff --git a/kvm-migration-add-qemu_file_update_transfer-interface.patch b/kvm-migration-add-qemu_file_update_transfer-interface.patch new file mode 100644 index 0000000..db27e74 --- /dev/null +++ b/kvm-migration-add-qemu_file_update_transfer-interface.patch @@ -0,0 +1,63 @@ +From 1748253be11cbf12961274d4586671ce3803b006 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 4 Sep 2019 11:23:30 +0100 +Subject: [PATCH 2/6] migration: add qemu_file_update_transfer interface + +RH-Author: Juan Quintela +Message-id: <20190904112332.16160-3-quintela@redhat.com> +Patchwork-id: 90281 +O-Subject: [RHEL-AV-8.1 qemu-kvm PATCH v2 2/4] migration: add qemu_file_update_transfer interface +Bugzilla: 1734316 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Peter Xu +RH-Acked-by: Danilo de Paula + +From: Ivan Ren + +Add qemu_file_update_transfer for just update bytes_xfer for speed +limitation. This will be used for further migration feature such as +multifd migration. + +Signed-off-by: Ivan Ren +Reviewed-by: Wei Yang +Reviewed-by: Juan Quintela +Message-Id: <1564464816-21804-2-git-send-email-ivanren@tencent.com> +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit 5d7d2558631b4421826c60046c606584c58ab76c) +Signed-off-by: Danilo C. L. de Paula +--- + migration/qemu-file.c | 5 +++++ + migration/qemu-file.h | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/migration/qemu-file.c b/migration/qemu-file.c +index 0431585..18f4805 100644 +--- a/migration/qemu-file.c ++++ b/migration/qemu-file.c +@@ -615,6 +615,11 @@ void qemu_file_reset_rate_limit(QEMUFile *f) + f->bytes_xfer = 0; + } + ++void qemu_file_update_transfer(QEMUFile *f, int64_t len) ++{ ++ f->bytes_xfer += len; ++} ++ + void qemu_put_be16(QEMUFile *f, unsigned int v) + { + qemu_put_byte(f, v >> 8); +diff --git a/migration/qemu-file.h b/migration/qemu-file.h +index 13baf89..5de9fa2 100644 +--- a/migration/qemu-file.h ++++ b/migration/qemu-file.h +@@ -147,6 +147,7 @@ int qemu_peek_byte(QEMUFile *f, int offset); + void qemu_file_skip(QEMUFile *f, int size); + void qemu_update_position(QEMUFile *f, size_t size); + void qemu_file_reset_rate_limit(QEMUFile *f); ++void qemu_file_update_transfer(QEMUFile *f, int64_t len); + void qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate); + int64_t qemu_file_get_rate_limit(QEMUFile *f); + void qemu_file_set_error(QEMUFile *f, int ret); +-- +1.8.3.1 + diff --git a/kvm-migration-add-speed-limit-for-multifd-migration.patch b/kvm-migration-add-speed-limit-for-multifd-migration.patch new file mode 100644 index 0000000..90adb74 --- /dev/null +++ b/kvm-migration-add-speed-limit-for-multifd-migration.patch @@ -0,0 +1,141 @@ +From d2ade4bec79bdfe6f0867b0672c6731bc1664b42 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 4 Sep 2019 11:23:31 +0100 +Subject: [PATCH 3/6] migration: add speed limit for multifd migration + +RH-Author: Juan Quintela +Message-id: <20190904112332.16160-4-quintela@redhat.com> +Patchwork-id: 90279 +O-Subject: [RHEL-AV-8.1 qemu-kvm PATCH v2 3/4] migration: add speed limit for multifd migration +Bugzilla: 1734316 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Peter Xu +RH-Acked-by: Danilo de Paula + +From: Ivan Ren + +Limit the speed of multifd migration through common speed limitation +qemu file. + +Signed-off-by: Ivan Ren +Message-Id: <1564464816-21804-3-git-send-email-ivanren@tencent.com> +Reviewed-by: Wei Yang +Reviewed-by: Juan Quintela +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit 1b81c974ccfd536aceef840e220912b142a7dda0) +Signed-off-by: Juan Quintela +Signed-off-by: Danilo C. L. de Paula +--- + migration/ram.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/migration/ram.c b/migration/ram.c +index 889148d..88ddd2b 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -922,7 +922,7 @@ struct { + * false. + */ + +-static int multifd_send_pages(void) ++static int multifd_send_pages(RAMState *rs) + { + int i; + static int next_channel; +@@ -954,6 +954,7 @@ static int multifd_send_pages(void) + multifd_send_state->pages = p->pages; + p->pages = pages; + transferred = ((uint64_t) pages->used) * TARGET_PAGE_SIZE + p->packet_len; ++ qemu_file_update_transfer(rs->f, transferred); + ram_counters.multifd_bytes += transferred; + ram_counters.transferred += transferred;; + qemu_mutex_unlock(&p->mutex); +@@ -962,7 +963,7 @@ static int multifd_send_pages(void) + return 1; + } + +-static int multifd_queue_page(RAMBlock *block, ram_addr_t offset) ++static int multifd_queue_page(RAMState *rs, RAMBlock *block, ram_addr_t offset) + { + MultiFDPages_t *pages = multifd_send_state->pages; + +@@ -981,12 +982,12 @@ static int multifd_queue_page(RAMBlock *block, ram_addr_t offset) + } + } + +- if (multifd_send_pages() < 0) { ++ if (multifd_send_pages(rs) < 0) { + return -1; + } + + if (pages->block != block) { +- return multifd_queue_page(block, offset); ++ return multifd_queue_page(rs, block, offset); + } + + return 1; +@@ -1054,7 +1055,7 @@ void multifd_save_cleanup(void) + multifd_send_state = NULL; + } + +-static void multifd_send_sync_main(void) ++static void multifd_send_sync_main(RAMState *rs) + { + int i; + +@@ -1062,7 +1063,7 @@ static void multifd_send_sync_main(void) + return; + } + if (multifd_send_state->pages->used) { +- if (multifd_send_pages() < 0) { ++ if (multifd_send_pages(rs) < 0) { + error_report("%s: multifd_send_pages fail", __func__); + return; + } +@@ -1083,6 +1084,7 @@ static void multifd_send_sync_main(void) + p->packet_num = multifd_send_state->packet_num++; + p->flags |= MULTIFD_FLAG_SYNC; + p->pending_job++; ++ qemu_file_update_transfer(rs->f, p->packet_len); + qemu_mutex_unlock(&p->mutex); + qemu_sem_post(&p->sem); + } +@@ -2079,7 +2081,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus *pss, bool last_stage) + static int ram_save_multifd_page(RAMState *rs, RAMBlock *block, + ram_addr_t offset) + { +- if (multifd_queue_page(block, offset) < 0) { ++ if (multifd_queue_page(rs, block, offset) < 0) { + return -1; + } + ram_counters.normal++; +@@ -3482,7 +3484,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) + ram_control_before_iterate(f, RAM_CONTROL_SETUP); + ram_control_after_iterate(f, RAM_CONTROL_SETUP); + +- multifd_send_sync_main(); ++ multifd_send_sync_main(*rsp); + qemu_put_be64(f, RAM_SAVE_FLAG_EOS); + qemu_fflush(f); + +@@ -3570,7 +3572,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) + ram_control_after_iterate(f, RAM_CONTROL_ROUND); + + out: +- multifd_send_sync_main(); ++ multifd_send_sync_main(rs); + qemu_put_be64(f, RAM_SAVE_FLAG_EOS); + qemu_fflush(f); + ram_counters.transferred += 8; +@@ -3629,7 +3631,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque) + + rcu_read_unlock(); + +- multifd_send_sync_main(); ++ multifd_send_sync_main(rs); + qemu_put_be64(f, RAM_SAVE_FLAG_EOS); + qemu_fflush(f); + +-- +1.8.3.1 + diff --git a/kvm-migration-always-initialise-ram_counters-for-a-new-m.patch b/kvm-migration-always-initialise-ram_counters-for-a-new-m.patch new file mode 100644 index 0000000..1280554 --- /dev/null +++ b/kvm-migration-always-initialise-ram_counters-for-a-new-m.patch @@ -0,0 +1,139 @@ +From 7ec124b3de4e7c7ef093955813a213d7a976d395 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 4 Sep 2019 11:23:29 +0100 +Subject: [PATCH 1/6] migration: always initialise ram_counters for a new + migration + +RH-Author: Juan Quintela +Message-id: <20190904112332.16160-2-quintela@redhat.com> +Patchwork-id: 90278 +O-Subject: [RHEL-AV-8.1 qemu-kvm PATCH v2 1/4] migration: always initialise ram_counters for a new migration +Bugzilla: 1734316 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Peter Xu +RH-Acked-by: Danilo de Paula + +From: Ivan Ren + +This patch fix a multifd migration bug in migration speed calculation, this +problem can be reproduced as follows: +1. start a vm and give a heavy memory write stress to prevent the vm be + successfully migrated to destination +2. begin a migration with multifd +3. migrate for a long time [actually, this can be measured by transferred bytes] +4. migrate cancel +5. begin a new migration with multifd, the migration will directly run into + migration_completion phase + +Reason as follows: + +Migration update bandwidth and s->threshold_size in function +migration_update_counters after BUFFER_DELAY time: + + current_bytes = migration_total_bytes(s); + transferred = current_bytes - s->iteration_initial_bytes; + time_spent = current_time - s->iteration_start_time; + bandwidth = (double)transferred / time_spent; + s->threshold_size = bandwidth * s->parameters.downtime_limit; + +In multifd migration, migration_total_bytes function return +qemu_ftell(s->to_dst_file) + ram_counters.multifd_bytes. +s->iteration_initial_bytes will be initialized to 0 at every new migration, +but ram_counters is a global variable, and history migration data will be +accumulated. So if the ram_counters.multifd_bytes is big enough, it may lead +pending_size >= s->threshold_size become false in migration_iteration_run +after the first migration_update_counters. + +Signed-off-by: Ivan Ren +Reviewed-by: Juan Quintela +Reviewed-by: Wei Yang +Suggested-by: Wei Yang +Message-Id: <1564741121-1840-1-git-send-email-ivanren@tencent.com> +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit 87f3bd8717cd88932de302e215f1da51bfb8051a) +Signed-off-by: Juan Quintela +Signed-off-by: Danilo C. L. de Paula +--- + migration/migration.c | 25 +++++++++++++++++++------ + migration/savevm.c | 1 + + 2 files changed, 20 insertions(+), 6 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index beffbfd..5299597 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1910,6 +1910,11 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, + } + + migrate_init(s); ++ /* ++ * set ram_counters memory to zero for a ++ * new migration ++ */ ++ memset(&ram_counters, 0, sizeof(ram_counters)); + + return true; + } +@@ -3027,6 +3032,17 @@ static void migration_calculate_complete(MigrationState *s) + } + } + ++static void update_iteration_initial_status(MigrationState *s) ++{ ++ /* ++ * Update these three fields at the same time to avoid mismatch info lead ++ * wrong speed calculation. ++ */ ++ s->iteration_start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); ++ s->iteration_initial_bytes = migration_total_bytes(s); ++ s->iteration_initial_pages = ram_get_total_transferred_pages(); ++} ++ + static void migration_update_counters(MigrationState *s, + int64_t current_time) + { +@@ -3062,9 +3078,7 @@ static void migration_update_counters(MigrationState *s, + + qemu_file_reset_rate_limit(s->to_dst_file); + +- s->iteration_start_time = current_time; +- s->iteration_initial_bytes = current_bytes; +- s->iteration_initial_pages = ram_get_total_transferred_pages(); ++ update_iteration_initial_status(s); + + trace_migrate_transferred(transferred, time_spent, + bandwidth, s->threshold_size); +@@ -3188,7 +3202,7 @@ static void *migration_thread(void *opaque) + rcu_register_thread(); + + object_ref(OBJECT(s)); +- s->iteration_start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); ++ update_iteration_initial_status(s); + + qemu_savevm_state_header(s->to_dst_file); + +@@ -3253,8 +3267,7 @@ static void *migration_thread(void *opaque) + * the local variables. This is important to avoid + * breaking transferred_bytes and bandwidth calculation + */ +- s->iteration_start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); +- s->iteration_initial_bytes = 0; ++ update_iteration_initial_status(s); + } + + current_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); +diff --git a/migration/savevm.c b/migration/savevm.c +index 79ed44d..480c511 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -1424,6 +1424,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) + } + + migrate_init(ms); ++ memset(&ram_counters, 0, sizeof(ram_counters)); + ms->to_dst_file = f; + + qemu_mutex_unlock_iothread(); +-- +1.8.3.1 + diff --git a/kvm-migration-update-ram_counters-for-multifd-sync-packe.patch b/kvm-migration-update-ram_counters-for-multifd-sync-packe.patch new file mode 100644 index 0000000..b22d984 --- /dev/null +++ b/kvm-migration-update-ram_counters-for-multifd-sync-packe.patch @@ -0,0 +1,47 @@ +From 0e42e63ddcaddd8837ba5ba1056380d4590754ee Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 4 Sep 2019 11:23:32 +0100 +Subject: [PATCH 4/6] migration: update ram_counters for multifd sync packet + +RH-Author: Juan Quintela +Message-id: <20190904112332.16160-5-quintela@redhat.com> +Patchwork-id: 90280 +O-Subject: [RHEL-AV-8.1 qemu-kvm PATCH v2 4/4] migration: update ram_counters for multifd sync packet +Bugzilla: 1734316 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Peter Xu +RH-Acked-by: Danilo de Paula + +From: Ivan Ren + +Multifd sync will send MULTIFD_FLAG_SYNC flag info to destination, add +these bytes to ram_counters record. + +Signed-off-by: Ivan Ren +Suggested-by: Wei Yang +Message-Id: <1564464816-21804-4-git-send-email-ivanren@tencent.com> +Reviewed-by: Juan Quintela +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit 81507f6b7e87468f24ed5886559feda15fe2db0c) +Signed-off-by: Juan Quintela +Signed-off-by: Danilo C. L. de Paula +--- + migration/ram.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/migration/ram.c b/migration/ram.c +index 88ddd2b..20b6eeb 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -1085,6 +1085,8 @@ static void multifd_send_sync_main(RAMState *rs) + p->flags |= MULTIFD_FLAG_SYNC; + p->pending_job++; + qemu_file_update_transfer(rs->f, p->packet_len); ++ ram_counters.multifd_bytes += p->packet_len; ++ ram_counters.transferred += p->packet_len; + qemu_mutex_unlock(&p->mutex); + qemu_sem_post(&p->sem); + } +-- +1.8.3.1 + diff --git a/kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch b/kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch new file mode 100644 index 0000000..b9e727b --- /dev/null +++ b/kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch @@ -0,0 +1,103 @@ +From b27062f4b3ddf47dea926026e5511f15d5b31320 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Tue, 10 Sep 2019 07:04:27 +0100 +Subject: [PATCH 5/6] spapr/pci: Consolidate de-allocation of MSIs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: David Gibson +Message-id: <20190910070428.28628-2-dgibson@redhat.com> +Patchwork-id: 90362 +O-Subject: [RHEL-AV-8.1 qemu-kvm PATCH 1/2] spapr/pci: Consolidate de-allocation of MSIs +Bugzilla: 1750200 +RH-Acked-by: Thomas Huth +RH-Acked-by: Philippe Mathieu-Daudé +RH-Acked-by: Laurent Vivier + +From: Greg Kurz + +When freeing MSIs, we need to: +- remove them from the machine's MSI bitmap +- remove them from the IC backend +- remove them from the PHB's MSI cache + +This is currently open coded in two places in rtas_ibm_change_msi(), +and we're about to need this in spapr_phb_reset() as well. Instead of +duplicating this code again, make it a destroy function for the PHB's +MSI cache. Removing an MSI device from the cache will call the destroy +function internally. + +Signed-off-by: Greg Kurz +Message-Id: <156415227855.1064338.5657793835271464648.stgit@bahia.lan> +Reviewed-by: Cédric Le Goater +Signed-off-by: David Gibson +(cherry picked from commit 078eb6b05b7f962e43d8bc376e0b96cdd550c17a) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1750200 + +Signed-off-by: David Gibson +Signed-off-by: Danilo C. L. de Paula +--- + hw/ppc/spapr_pci.c | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c +index 9003fe9..1ffcfae 100644 +--- a/hw/ppc/spapr_pci.c ++++ b/hw/ppc/spapr_pci.c +@@ -336,10 +336,6 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr, + return; + } + +- if (!smc->legacy_irq_allocation) { +- spapr_irq_msi_free(spapr, msi->first_irq, msi->num); +- } +- spapr_irq_free(spapr, msi->first_irq, msi->num); + if (msi_present(pdev)) { + spapr_msi_setmsg(pdev, 0, false, 0, 0); + } +@@ -409,10 +405,6 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr, + + /* Release previous MSIs */ + if (msi) { +- if (!smc->legacy_irq_allocation) { +- spapr_irq_msi_free(spapr, msi->first_irq, msi->num); +- } +- spapr_irq_free(spapr, msi->first_irq, msi->num); + g_hash_table_remove(phb->msi, &config_addr); + } + +@@ -1806,6 +1798,19 @@ static void spapr_phb_unrealize(DeviceState *dev, Error **errp) + memory_region_del_subregion(get_system_memory(), &sphb->mem32window); + } + ++static void spapr_phb_destroy_msi(gpointer opaque) ++{ ++ SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); ++ SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr); ++ spapr_pci_msi *msi = opaque; ++ ++ if (!smc->legacy_irq_allocation) { ++ spapr_irq_msi_free(spapr, msi->first_irq, msi->num); ++ } ++ spapr_irq_free(spapr, msi->first_irq, msi->num); ++ g_free(msi); ++} ++ + static void spapr_phb_realize(DeviceState *dev, Error **errp) + { + /* We don't use SPAPR_MACHINE() in order to exit gracefully if the user +@@ -2017,7 +2022,8 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) + spapr_tce_get_iommu(tcet)); + } + +- sphb->msi = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, g_free); ++ sphb->msi = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, ++ spapr_phb_destroy_msi); + return; + + unrealize: +-- +1.8.3.1 + diff --git a/kvm-spapr-pci-Free-MSIs-during-reset.patch b/kvm-spapr-pci-Free-MSIs-during-reset.patch new file mode 100644 index 0000000..7be103a --- /dev/null +++ b/kvm-spapr-pci-Free-MSIs-during-reset.patch @@ -0,0 +1,56 @@ +From 26879f41a890a93beabefebb19c399561013a615 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Tue, 10 Sep 2019 07:04:28 +0100 +Subject: [PATCH 6/6] spapr/pci: Free MSIs during reset +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: David Gibson +Message-id: <20190910070428.28628-3-dgibson@redhat.com> +Patchwork-id: 90363 +O-Subject: [RHEL-AV-8.1 qemu-kvm PATCH 2/2] spapr/pci: Free MSIs during reset +Bugzilla: 1750200 +RH-Acked-by: Thomas Huth +RH-Acked-by: Philippe Mathieu-Daudé +RH-Acked-by: Laurent Vivier + +From: Greg Kurz + +When the machine is reset, the MSI bitmap is cleared but the allocated +MSIs are not freed. Some operating systems, such as AIX, can detect the +previous configuration and assert. + +Empty the MSI cache, this performs the needed cleanup. + +Signed-off-by: Greg Kurz +Message-Id: <156415228410.1064338.4486161194061636096.stgit@bahia.lan> +Reviewed-by: Cédric Le Goater +Reviewed-by: Philippe Mathieu-Daudé +Signed-off-by: David Gibson +(cherry picked from commit ea52074d3a1c5fbe70f3014dc1b1f2e7d5ced5de) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1750200 + +Signed-off-by: David Gibson +Signed-off-by: Danilo C. L. de Paula +--- + hw/ppc/spapr_pci.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c +index 1ffcfae..128c981 100644 +--- a/hw/ppc/spapr_pci.c ++++ b/hw/ppc/spapr_pci.c +@@ -2078,6 +2078,8 @@ static void spapr_phb_reset(DeviceState *qdev) + if (spapr_phb_eeh_available(SPAPR_PCI_HOST_BRIDGE(qdev))) { + spapr_phb_vfio_reset(qdev); + } ++ ++ g_hash_table_remove_all(sphb->msi); + } + + static Property spapr_phb_properties[] = { +-- +1.8.3.1 + diff --git a/qemu-kvm.spec b/qemu-kvm.spec index b087571..d5882f2 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -67,7 +67,7 @@ Obsoletes: %1-rhev Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 4.1.0 -Release: 8%{?dist} +Release: 9%{?dist} # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped Epoch: 15 License: GPLv2 and GPLv2+ and CC-BY @@ -178,6 +178,18 @@ Patch47: kvm-file-posix-Handle-undetectable-alignment.patch Patch48: kvm-block-posix-Always-allocate-the-first-block.patch # For bz#1749134 - I/O error when virtio-blk disk is backed by a raw image on 4k disk Patch49: kvm-iotests-Test-allocate_first_block-with-O_DIRECT.patch +# For bz#1734316 - multifd migration does not honour speed limits, consumes entire bandwidth of NIC +Patch50: kvm-migration-always-initialise-ram_counters-for-a-new-m.patch +# For bz#1734316 - multifd migration does not honour speed limits, consumes entire bandwidth of NIC +Patch51: kvm-migration-add-qemu_file_update_transfer-interface.patch +# For bz#1734316 - multifd migration does not honour speed limits, consumes entire bandwidth of NIC +Patch52: kvm-migration-add-speed-limit-for-multifd-migration.patch +# For bz#1734316 - multifd migration does not honour speed limits, consumes entire bandwidth of NIC +Patch53: kvm-migration-update-ram_counters-for-multifd-sync-packe.patch +# For bz#1750200 - [RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error prompt(qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free) +Patch54: kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch +# For bz#1750200 - [RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error prompt(qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free) +Patch55: kvm-spapr-pci-Free-MSIs-during-reset.patch BuildRequires: wget BuildRequires: rpm-build @@ -1119,6 +1131,18 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %changelog +* Tue Sep 10 2019 Danilo Cesar Lemes de Paula - 4.1.0-9.el8 +- kvm-migration-always-initialise-ram_counters-for-a-new-m.patch [bz#1734316] +- kvm-migration-add-qemu_file_update_transfer-interface.patch [bz#1734316] +- kvm-migration-add-speed-limit-for-multifd-migration.patch [bz#1734316] +- kvm-migration-update-ram_counters-for-multifd-sync-packe.patch [bz#1734316] +- kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch [bz#1750200] +- kvm-spapr-pci-Free-MSIs-during-reset.patch [bz#1750200] +- Resolves: bz#1734316 + (multifd migration does not honour speed limits, consumes entire bandwidth of NIC) +- Resolves: bz#1750200 + ([RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error prompt(qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free)) + * Mon Sep 09 2019 Danilo Cesar Lemes de Paula - 4.1.0-8.el8 - kvm-migration-Do-not-re-read-the-clock-on-pre_save-in-ca.patch [bz#1747836] - kvm-ehci-fix-queue-dev-null-ptr-dereference.patch [bz#1746790]