powerpc/mm/radix: Invalidate ERAT on tlbiel for POWER9 DD1
PATCH v2 1/1 powerpc/mm/radix: Invalidate ERAT on tlbiel for POWER9 DD1
On POWER9 DD1, when we do a local TLB invalidate we also need to explicitly invalidate the ERAT.
---
v2:
- Remove unnecessary isyncs
--- arch/powerpc/mm/tlb-radix.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/powerpc/mm/tlb-radix.c +6 -0
@@ -50,6 +50,9 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)for (set =0 ; set <POWER9_TLB_SETS_RADIX ; set++) {__tlbiel_pid (pid, set, ric); } +if (cpu_has_feature (CPU_FTR_POWER9_DD1 )) + asm volatile(PPC_SLBIA(0x7) + : : :"memory");return ; }
@@ -83,6 +86,9 @@ static inline void _tlbiel_va(unsigned long va, unsigned long pid, asm volatile(PPC_TLBIEL(%0, %4, %3, %2, %1) : : "r"(rb), "i"(r), "i"(prs), "i"(ric), "r"(rs) : "memory"); asm volatile("ptesync": : :"memory"); +if (cpu_has_feature (CPU_FTR_POWER9_DD1 )) + asm volatile(PPC_SLBIA(0x7) + : : :"memory"); } static inline void _tlbie_va(unsigned long va, unsigned long pid,
Signature · 1 line
2.9.3
Michael Ellerman
reviewerarch/powerpc/mm/tlb-radix.c static inline void _tlbiel_pid(unsigned long pid, unsigned long ric) · line 55
Quoted 11 lines · Michael Neuling
arch/powerpc/mm/tlb-radix.c +3
-0@@ -50,6 +50,9 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)for (set =0 ; set <POWER9_TLB_SETS_RADIX ; set++) {__tlbiel_pid (pid, set, ric); } +if (cpu_has_feature (CPU_FTR_POWER9_DD1 )) + asm volatile(PPC_SLBIA(0x7) + : : :"memory");
Ah of course I'll use slbia to invalidate the ERAT.
How about we do:
#define PPC_INVALIDATE_ERAT PPC_SLBIA(0x7)
Or bike-shed me a name for it.
cheers
Quoted 15 lines · Michael Ellerman
arch/powerpc/mm/tlb-radix.c static inline void _tlbiel_pid(unsigned long pid, unsigned long ric) · line 55
Quoted 11 lines · Michael Neuling
arch/powerpc/mm/tlb-radix.c +3
-0@@ -50,6 +50,9 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)for (set =0 ; set <POWER9_TLB_SETS_RADIX ; set++) {__tlbiel_pid (pid, set, ric); } +if (cpu_has_feature (CPU_FTR_POWER9_DD1 )) + asm volatile(PPC_SLBIA(0x7) + : : :"memory");Ah of course I'll use slbia to invalidate the ERAT.
Quoted 4 lines
How about we do:
#define
PPC_INVALIDATE_ERATPPC_SLBIA(0x7)
While you are at it, could you also add a TODO
to use a HCALL when LPCR_GTSE is not set
(when running in guest mode)
Balbir Singh.
Quoted 16 lines · Balbir Singh
Quoted 15 lines · Michael Ellerman
arch/powerpc/mm/tlb-radix.c static inline void _tlbiel_pid(unsigned long pid, unsigned long ric) · line 55
Quoted 11 lines · Michael Neuling
arch/powerpc/mm/tlb-radix.c +3
-0@@ -50,6 +50,9 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)for (set =0 ; set <POWER9_TLB_SETS_RADIX ; set++) {__tlbiel_pid (pid, set, ric); } +if (cpu_has_feature (CPU_FTR_POWER9_DD1 )) + asm volatile(PPC_SLBIA(0x7) + : : :"memory");Ah of course I'll use slbia to invalidate the ERAT.
Quoted 8 lines
Quoted 4 lines
How about we do:
#define
PPC_INVALIDATE_ERATPPC_SLBIA(0x7)While you are at it, could you also add a TODO
to use a HCALL whenLPCR_GTSEis not set
(when running in guest mode)
In what config we use that ? With radix we always run with GTSE = 1 and with hash we don't use tlbiel in guest.
-aneesh