[PATCH v4 15/15] hw/intc: hvf: add migration blocker when using multiple vCPUs with the Apple GIC

Mohamed Mediouni posted 15 patches 3 months, 2 weeks ago
Maintainers: Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>, Mads Ynddal <mads@ynddal.dk>, Shannon Zhao <shannon.zhaosl@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Alexander Graf <agraf@csgraf.de>
There is a newer version of this series
[PATCH v4 15/15] hw/intc: hvf: add migration blocker when using multiple vCPUs with the Apple GIC
Posted by Mohamed Mediouni 3 months, 2 weeks ago
Current state known to be broken, still figuring things out...

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
---
 hw/intc/arm_gicv3_hvf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/intc/arm_gicv3_hvf.c b/hw/intc/arm_gicv3_hvf.c
index 30362540f2..151020edd6 100644
--- a/hw/intc/arm_gicv3_hvf.c
+++ b/hw/intc/arm_gicv3_hvf.c
@@ -18,6 +18,7 @@
 #include "hvf_arm.h"
 #include "gicv3_internal.h"
 #include "vgic_common.h"
+#include "migration/blocker.h"
 #include "qom/object.h"
 #include "target/arm/cpregs.h"
 #include <Hypervisor/Hypervisor.h>
@@ -703,6 +704,17 @@ static void hvf_gicv3_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "vGIC maintenance IRQ mismatch with the hardcoded one in HVF.");
         return;
     }
+
+    /* Temporary: current state known to be incomplete. */
+    if (s->num_cpu > 1) {
+        Error *hvf_mcpu_migration_blocker = NULL;
+        error_setg(&hvf_mcpu_migration_blocker,
+           "Live migration disabled because multiple CPUs are exposed.");
+        if (migrate_add_blocker(&hvf_mcpu_migration_blocker, errp)) {
+            error_free(hvf_mcpu_migration_blocker);
+            return;
+        }
+    }
 }
 
 static void hvf_gicv3_class_init(ObjectClass *klass, const void *data)
-- 
2.39.5 (Apple Git-154)