Skip to content

Commit 09cf5bc

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/radix: Update PID switch sequence
Update the PID switch as per ISA doc. slbia is needed in radix to invalidate any implementation specific lookaside information. We use the .long format due to build errors with the below compiler version. gcc (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413 GNU assembler (GNU Binutils for Ubuntu) 2.26 CC arch/powerpc/mm//mmu_context_book3s64.o {standard input}: Assembler messages: {standard input}:506: Error: junk at end of line: `0x7' scripts/Makefile.build:291: recipe for target 'arch/powerpc/mm//mmu_context_book3s64.o' failed make[1]: *** [arch/powerpc/mm//mmu_context_book3s64.o] Error 1 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 4b7a350 commit 09cf5bc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
#define PPC_INST_MTSPR_DSCR_USER 0x7c0303a6
182182
#define PPC_INST_MTSPR_DSCR_USER_MASK 0xfc1fffff
183183
#define PPC_INST_SLBFEE 0x7c0007a7
184+
#define PPC_INST_SLBIA 0x7c0003e4
184185

185186
#define PPC_INST_STRING 0x7c00042a
186187
#define PPC_INST_STRING_MASK 0xfc0007fe
@@ -442,5 +443,7 @@
442443
___PPC_RA(a) | \
443444
___PPC_RB(b))
444445

446+
#define PPC_SLBIA(IH) stringify_in_c(.long PPC_INST_SLBIA | \
447+
((IH & 0x7) << 21))
445448

446449
#endif /* _ASM_POWERPC_PPC_OPCODE_H */

arch/powerpc/mm/mmu_context_book3s64.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ void destroy_context(struct mm_struct *mm)
181181
#ifdef CONFIG_PPC_RADIX_MMU
182182
void radix__switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
183183
{
184-
mtspr(SPRN_PID, next->context.id);
185184
asm volatile("isync": : :"memory");
185+
mtspr(SPRN_PID, next->context.id);
186+
asm volatile("isync \n"
187+
PPC_SLBIA(0x7)
188+
: : :"memory");
186189
}
187190
#endif

0 commit comments

Comments
 (0)