summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/irqchip/irq-gic-v5-irs.c2
-rw-r--r--drivers/irqchip/irq-gic-v5.c10
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
index ce2732d649a3..eeeb40fb0eaa 100644
--- a/drivers/irqchip/irq-gic-v5-irs.c
+++ b/drivers/irqchip/irq-gic-v5-irs.c
@@ -743,6 +743,8 @@ static int __init gicv5_irs_init(struct device_node *node)
* be consistent across IRSes by the architecture.
*/
if (list_empty(&irs_nodes)) {
+ idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR0);
+ gicv5_global_data.virt_capable = !FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR1);
irs_setup_pri_bits(idr);
diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
index 41ef286c4d78..3c86bbc05761 100644
--- a/drivers/irqchip/irq-gic-v5.c
+++ b/drivers/irqchip/irq-gic-v5.c
@@ -1064,6 +1064,16 @@ static struct gic_kvm_info gic_v5_kvm_info __initdata;
static void __init gic_of_setup_kvm_info(struct device_node *node)
{
+ /*
+ * If we don't have native GICv5 virtualisation support, then
+ * we also don't have FEAT_GCIE_LEGACY - the architecture
+ * forbids this combination.
+ */
+ if (!gicv5_global_data.virt_capable) {
+ pr_info("GIC implementation is not virtualization capable\n");
+ return;
+ }
+
gic_v5_kvm_info.type = GIC_V5;
/* GIC Virtual CPU interface maintenance interrupt */