@@ -90,6 +90,7 @@ typedef struct SpaprIrq {
extern SpaprIrq spapr_irq_xics;
extern SpaprIrq spapr_irq_xics_legacy;
extern SpaprIrq spapr_irq_xive;
+extern SpaprIrq spapr_irq_xive_storeeoi;
extern SpaprIrq spapr_irq_dual;
void spapr_irq_init(SpaprMachineState *spapr, Error **errp);
@@ -3248,6 +3248,8 @@ static char *spapr_get_ic_mode(Object *obj, Error **errp)
return g_strdup("xics");
} else if (spapr->irq == &spapr_irq_xive) {
return g_strdup("xive");
+ } else if (spapr->irq == &spapr_irq_xive_storeeoi) {
+ return g_strdup("xive-storeeoi");
} else if (spapr->irq == &spapr_irq_dual) {
return g_strdup("dual");
}
@@ -3268,6 +3270,8 @@ static void spapr_set_ic_mode(Object *obj, const char *value, Error **errp)
spapr->irq = &spapr_irq_xics;
} else if (strcmp(value, "xive") == 0) {
spapr->irq = &spapr_irq_xive;
+ } else if (strcmp(value, "xive-storeeoi") == 0) {
+ spapr->irq = &spapr_irq_xive_storeeoi;
} else if (strcmp(value, "dual") == 0) {
spapr->irq = &spapr_irq_dual;
} else {
@@ -3350,7 +3354,7 @@ static void spapr_instance_init(Object *obj)
object_property_add_str(obj, "ic-mode", spapr_get_ic_mode,
spapr_set_ic_mode);
object_property_set_description(obj, "ic-mode",
- "Specifies the interrupt controller mode (xics, xive, dual)");
+ "Specifies the interrupt controller mode (xics, xive, xive-storeeoi, dual)");
object_property_add_str(obj, "host-model",
spapr_get_host_model, spapr_set_host_model);
@@ -119,6 +119,15 @@ SpaprIrq spapr_irq_xive = {
.xive = true,
};
+/*
+ * XIVE IRQ backend + StoreEOI activated
+ */
+
+SpaprIrq spapr_irq_xive_storeeoi = {
+ .xics = false,
+ .xive = true,
+};
+
/*
* Dual XIVE and XICS IRQ backend.
*
@@ -213,6 +222,11 @@ static bool spapr_irq_xive_hw_storeeoi(SpaprMachineState *spapr)
}
/* StoreEOI on P9 compat is unsafe */
+ if (spapr->irq == &spapr_irq_xive_storeeoi) {
+ warn_report("HW Store EOI on a POWER9 CPU is unsafe.");
+ return true;
+ }
+
return false;
}
As it is still useful to run a P9 compat guest with StoreEOI enabled, introduce a new IRQ backend to allow that. May be we should add a migration blocker. Signed-off-by: Cédric Le Goater <clg@kaod.org> --- include/hw/ppc/spapr_irq.h | 1 + hw/ppc/spapr.c | 6 +++++- hw/ppc/spapr_irq.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)