]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
irqchip/gic-v3-its: Check that all RDs have the same property table
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 27 Jul 2018 15:03:31 +0000 (16:03 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 2 Oct 2018 09:37:37 +0000 (10:37 +0100)
If booting with LPIs enabled, all the redistributors must have the
exact same property table. No ifs, no buts.

Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Tested-by: Bhupesh Sharma <bhsharma@redhat.com>
Tested-by: Lei Zhang <zhang.lei@jp.fujitsu.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-gic-v3-its.c

index 83d5573f56e9cb927d5ee15ee1ef595b1a0da128..828af1a68b8e4cf7622af007e0e4ad56f737d137 100644 (file)
@@ -2029,6 +2029,15 @@ static void its_cpu_init_lpis(void)
        val = readl_relaxed(rbase + GICR_CTLR);
        if ((gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) &&
            (val & GICR_CTLR_ENABLE_LPIS)) {
+               /*
+                * Check that we get the same property table on all
+                * RDs. If we don't, this is hopeless.
+                */
+               paddr = gicr_read_propbaser(rbase + GICR_PROPBASER);
+               paddr &= GENMASK_ULL(51, 12);
+               if (WARN_ON(gic_rdists->prop_table_pa != paddr))
+                       add_taint(TAINT_CRAP, LOCKDEP_STILL_OK);
+
                paddr = gicr_read_pendbaser(rbase + GICR_PENDBASER);
                paddr &= GENMASK_ULL(51, 16);