[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/8] spapr/xive: Introduce a XIVE StoreEOI IRQ backend
From: |
Cédric Le Goater |
Subject: |
[PATCH 8/8] spapr/xive: Introduce a XIVE StoreEOI IRQ backend |
Date: |
Wed, 19 Aug 2020 15:08:43 +0200 |
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(-)
diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h
index ca8cb4421374..548895a89cca 100644
--- a/include/hw/ppc/spapr_irq.h
+++ b/include/hw/ppc/spapr_irq.h
@@ -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);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a5bb0736e237..23f26d50f598 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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);
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index d036c8fef519..c2e83fd0b34d 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -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;
}
--
2.25.4
- Re: [PATCH 2/8] linux-headers: Update for KVM_DEV_XIVE_GRP_SOURCE_INFO, (continued)
- [PATCH 3/8] spapr/xive: Query the characteristics of a source in KVM, Cédric Le Goater, 2020/08/19
- [PATCH 4/8] spapr/xive: Activate StoreEOI for POWER10 only, Cédric Le Goater, 2020/08/19
- [PATCH 6/8] spapr/xive: Activate StoreEOI by default, Cédric Le Goater, 2020/08/19
- [PATCH 5/8] spapr/xive: Enforce the load-after-store ordering, Cédric Le Goater, 2020/08/19
- [PATCH 7/8] spapr/xive: Use the xics flag to check for XIVE-only IRQ backends, Cédric Le Goater, 2020/08/19
- [PATCH 8/8] spapr/xive: Introduce a XIVE StoreEOI IRQ backend,
Cédric Le Goater <=