powerpc/mm/64s: Only use slbfee on CPUs that support it
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 6 Nov 2018 08:25:38 +0000 (19:25 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 6 Nov 2018 08:32:22 +0000 (19:32 +1100)
The slbfee instruction was only added in ISA 2.05 (Power6), it's not
supported on older CPUs. We don't have a CPU feature for that ISA
version though, so just use the ISA 2.06 feature flag.

Fixes: e15a4fea4dee ("powerpc/64s/hash: Add some SLB debugging tests")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/slb.c

index 457fd29448b1bf41772f7b0fe6b344788e956acc..b663a36f9ada1e588a0da54236435166f978fca9 100644 (file)
@@ -66,6 +66,9 @@ static void assert_slb_presence(bool present, unsigned long ea)
 
        WARN_ON_ONCE(mfmsr() & MSR_EE);
 
+       if (!cpu_has_feature(CPU_FTR_ARCH_206))
+               return;
+
        asm volatile(__PPC_SLBFEE_DOT(%0, %1) : "=r"(tmp) : "r"(ea) : "cr0");
 
        WARN_ON(present == (tmp == 0));