From: Michael Ellerman Date: Thu, 15 Aug 2013 05:22:15 +0000 (+1000) Subject: powerpc/pseries: Add a warning in the case of cross-cpu VPA registration X-Git-Tag: v3.12-rc1~123^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b89bdfb8deb0cac5141f54806e406e5888175c80;p=profile%2Fivi%2Fkernel-x86-ivi.git powerpc/pseries: Add a warning in the case of cross-cpu VPA registration 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 Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 6d5e932..356bc75 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c @@ -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;