qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] spapr/irq: Fix migration of older machine types with XIVE


From: Greg Kurz
Subject: [PATCH] spapr/irq: Fix migration of older machine types with XIVE
Date: Wed, 25 Sep 2019 18:07:40 +0200
User-agent: StGit/unknown-version

Recent patch "spapr/irq: Only claim VALID interrupts at the KVM level"
broke migration of older machine types started with ic-mode=xive:

qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 3 attr 0x0000000000001300: 
Invalid argument
qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr'
qemu-system-ppc64: load of migration failed: Operation not permitted

This is because we should set the interrupt source in KVM at post load,
since we no longer do it unconditionaly at reset time for all interrupts.

Signed-off-by: Greg Kurz <address@hidden>
---

David,

I guess you should probably fold this fix directly into Cedric's
patch (currently SHA1 966d526cdfd9 in ppc-for-4.2) to avoid
bisection breakage.
---
 hw/intc/spapr_xive_kvm.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index 71b88d7797bc..2006f96aece1 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -678,6 +678,17 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id)
             continue;
         }
 
+        /*
+         * We can only restore the source config if the source has been
+         * previously set in KVM. Since we don't do that for all interrupts
+         * at reset time anymore, let's do it now.
+         */
+        kvmppc_xive_source_reset_one(&xive->source, i, &local_err);
+        if (local_err) {
+            error_report_err(local_err);
+            return -1;
+        }
+
         kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err);
         if (local_err) {
             error_report_err(local_err);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]