]> git.karo-electronics.de Git - linux-beck.git/commitdiff
powerpc/pseries: Add a warning in the case of cross-cpu VPA registration
authorMichael Ellerman <michael@ellerman.id.au>
Thu, 15 Aug 2013 05:22:15 +0000 (15:22 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 27 Aug 2013 04:44:28 +0000 (14:44 +1000)
The spec says it "may be problematic" if CPU x registers the VPA of
CPU y. Add a warning in case we ever do that.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/pseries/lpar.c

index 6d5e932b615a6c650eb1e78b830032954959f7ef..356bc75ca74f6f0bf8f08dd6eca37b5c538dbfc3 100644 (file)
@@ -68,6 +68,12 @@ void vpa_init(int cpu)
        struct paca_struct *pp;
        struct dtl_entry *dtl;
 
+       /*
+        * The spec says it "may be problematic" if CPU x registers the VPA of
+        * CPU y. We should never do that, but wail if we ever do.
+        */
+       WARN_ON(cpu != smp_processor_id());
+
        if (cpu_has_feature(CPU_FTR_ALTIVEC))
                lppaca_of(cpu).vmxregs_in_use = 1;