powerpc/mm/book3s64/hash: Switch pre 2.06 tlbiel to .long
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 21 Dec 2021 05:59:04 +0000 (16:59 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Dec 2021 11:35:13 +0000 (22:35 +1100)
The llvm integrated assembler does not recognise the ISA 2.05 tlbiel
version. Work around it by switching to .long when an old arch level
detected.

Signed-off-by: Daniel Axtens <dja@axtens.net>
[aik: did "Eventually do this more smartly"]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211221055904.555763-7-aik@ozlabs.ru
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/mm/book3s64/hash_native.c

index 9fe3223e7820df65f3721a6edeed16f7abddb2fa..efad07081cc0e59612c872d67d43854cc2e9d6b0 100644 (file)
        (0x7c000264 | ___PPC_RB(rb) | ___PPC_RS(rs) | ___PPC_RIC(ric) | ___PPC_PRS(prs) | ___PPC_R(r))
 #define PPC_RAW_TLBIEL(rb, rs, ric, prs, r) \
        (0x7c000224 | ___PPC_RB(rb) | ___PPC_RS(rs) | ___PPC_RIC(ric) | ___PPC_PRS(prs) | ___PPC_R(r))
+#define PPC_RAW_TLBIEL_v205(rb, l)     (0x7c000224 | ___PPC_RB(rb) | (l << 21))
 #define PPC_RAW_TLBSRX_DOT(a, b)       (0x7c0006a5 | __PPC_RA0(a) | __PPC_RB(b))
 #define PPC_RAW_TLBIVAX(a, b)          (0x7c000624 | __PPC_RA0(a) | __PPC_RB(b))
 #define PPC_RAW_ERATWE(s, a, w)                (0x7c0001a6 | __PPC_RS(s) | __PPC_RA(a) | __PPC_WS(w))
                                stringify_in_c(.long PPC_RAW_TLBIE_5(rb, rs, ric, prs, r))
 #define        PPC_TLBIEL(rb,rs,ric,prs,r) \
                                stringify_in_c(.long PPC_RAW_TLBIEL(rb, rs, ric, prs, r))
+#define PPC_TLBIEL_v205(rb, l) stringify_in_c(.long PPC_RAW_TLBIEL_v205(rb, l))
 #define PPC_TLBSRX_DOT(a, b)   stringify_in_c(.long PPC_RAW_TLBSRX_DOT(a, b))
 #define PPC_TLBIVAX(a, b)      stringify_in_c(.long PPC_RAW_TLBIVAX(a, b))
 
index d2a320828c0b0578407bdd989c81b4b2575e0453..623a7b7ab38b11e6a4104eaa7a0badf555da530b 100644 (file)
@@ -163,7 +163,7 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
                va |= ssize << 8;
                sllp = get_sllp_encoding(apsize);
                va |= sllp << 5;
-               asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0,0", %1)
+               asm volatile(ASM_FTR_IFSET("tlbiel %0", PPC_TLBIEL_v205(%0, 0), %1)
                             : : "r" (va), "i" (CPU_FTR_ARCH_206)
                             : "memory");
                break;
@@ -182,7 +182,7 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
                 */
                va |= (vpn & 0xfe);
                va |= 1; /* L */
-               asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0,1", %1)
+               asm volatile(ASM_FTR_IFSET("tlbiel %0", PPC_TLBIEL_v205(%0, 1), %1)
                             : : "r" (va), "i" (CPU_FTR_ARCH_206)
                             : "memory");
                break;