Skip to content

Commit 62479e6

Browse files
aikmpe
authored andcommitted
powerpc/mm/book3s64/hash: Switch pre 2.06 tlbiel to .long
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 <[email protected]> [aik: did "Eventually do this more smartly"] Signed-off-by: Alexey Kardashevskiy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d51f86c commit 62479e6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

arch/powerpc/include/asm/ppc-opcode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@
394394
(0x7c000264 | ___PPC_RB(rb) | ___PPC_RS(rs) | ___PPC_RIC(ric) | ___PPC_PRS(prs) | ___PPC_R(r))
395395
#define PPC_RAW_TLBIEL(rb, rs, ric, prs, r) \
396396
(0x7c000224 | ___PPC_RB(rb) | ___PPC_RS(rs) | ___PPC_RIC(ric) | ___PPC_PRS(prs) | ___PPC_R(r))
397+
#define PPC_RAW_TLBIEL_v205(rb, l) (0x7c000224 | ___PPC_RB(rb) | (l << 21))
397398
#define PPC_RAW_TLBSRX_DOT(a, b) (0x7c0006a5 | __PPC_RA0(a) | __PPC_RB(b))
398399
#define PPC_RAW_TLBIVAX(a, b) (0x7c000624 | __PPC_RA0(a) | __PPC_RB(b))
399400
#define PPC_RAW_ERATWE(s, a, w) (0x7c0001a6 | __PPC_RS(s) | __PPC_RA(a) | __PPC_WS(w))
@@ -606,6 +607,7 @@
606607
stringify_in_c(.long PPC_RAW_TLBIE_5(rb, rs, ric, prs, r))
607608
#define PPC_TLBIEL(rb,rs,ric,prs,r) \
608609
stringify_in_c(.long PPC_RAW_TLBIEL(rb, rs, ric, prs, r))
610+
#define PPC_TLBIEL_v205(rb, l) stringify_in_c(.long PPC_RAW_TLBIEL_v205(rb, l))
609611
#define PPC_TLBSRX_DOT(a, b) stringify_in_c(.long PPC_RAW_TLBSRX_DOT(a, b))
610612
#define PPC_TLBIVAX(a, b) stringify_in_c(.long PPC_RAW_TLBIVAX(a, b))
611613

arch/powerpc/mm/book3s64/hash_native.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
163163
va |= ssize << 8;
164164
sllp = get_sllp_encoding(apsize);
165165
va |= sllp << 5;
166-
asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0,0", %1)
166+
asm volatile(ASM_FTR_IFSET("tlbiel %0", PPC_TLBIEL_v205(%0, 0), %1)
167167
: : "r" (va), "i" (CPU_FTR_ARCH_206)
168168
: "memory");
169169
break;
@@ -182,7 +182,7 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
182182
*/
183183
va |= (vpn & 0xfe);
184184
va |= 1; /* L */
185-
asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0,1", %1)
185+
asm volatile(ASM_FTR_IFSET("tlbiel %0", PPC_TLBIEL_v205(%0, 1), %1)
186186
: : "r" (va), "i" (CPU_FTR_ARCH_206)
187187
: "memory");
188188
break;

0 commit comments

Comments
 (0)