powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9
[linux-2.6-block.git] / arch / powerpc / include / asm / timex.h
index 926b9f91a3ef26f6fbbab910586d8ba165a0d0d9..d2d2c4bd843589d0ae2115e0ca7cdcef4fb6d2a8 100644 (file)
@@ -17,38 +17,10 @@ typedef unsigned long cycles_t;
 
 static inline cycles_t get_cycles(void)
 {
-#ifdef __powerpc64__
+       if (IS_ENABLED(CONFIG_BOOK3S_601))
+               return 0;
+
        return mftb();
-#else
-       cycles_t ret;
-
-       /*
-        * For the "cycle" counter we use the timebase lower half.
-        * Currently only used on SMP.
-        */
-
-       ret = 0;
-
-       __asm__ __volatile__(
-#ifdef CONFIG_PPC_8xx
-               "97:    mftb %0\n"
-#else
-               "97:    mfspr %0, %2\n"
-#endif
-               "99:\n"
-               ".section __ftr_fixup,\"a\"\n"
-               ".align 2\n"
-               "98:\n"
-               "       .long %1\n"
-               "       .long 0\n"
-               "       .long 97b-98b\n"
-               "       .long 99b-98b\n"
-               "       .long 0\n"
-               "       .long 0\n"
-               ".previous"
-               : "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL));
-       return ret;
-#endif
 }
 
 #endif /* __KERNEL__ */