Skip to contentSkip to conversation

powerpc/64s: Minor fix for MCE TLB flush for radix

PATCH Applied Nicholas Piggin 3 participants 3 messages Apr 16, 2017 – Apr 19, 2017 PowerPC

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc/64s: Minor fix for MCE TLB flush for radix

The TLB flush for radix first flushes TLB for radix configuration, then flushes for hash configuration. The second flush is unnecessary but does not affect correctness.

Fixes 1a472c9dba6b9 ("powerpc/mm/radix: Add tlbflush routines")
---
 arch/powerpc/kernel/mce_power.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/powerpc/kernel/mce_power.c +6 -3
index 763d6f58caa8..7b765aa9f2ff 100644
@@ -72,10 +72,13 @@ void __flush_tlb_power8(unsigned int action)
 
 void __flush_tlb_power9(unsigned int action)
 {
-	if (radix_enabled())
-		flush_tlb_206(POWER9_TLB_SETS_RADIX, action);
+	unsigned int num_sets;
 
-	flush_tlb_206(POWER9_TLB_SETS_HASH, action);
+	if (radix_enabled())
+		num_sets = POWER9_TLB_SETS_RADIX;
+	else
+		num_sets = POWER9_TLB_SETS_HASH;
+	flush_tlb_206(num_sets, action);
 }
 
 
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Nicholas Piggin

The TLB flush for radix first flushes TLB for radix configuration, then flushes for hash configuration. The second flush is unnecessary but does not affect correctness.

Fixes 1a472c9dba6b9 ("powerpc/mm/radix: Add tlbflush routines")
Quoted 27 lines
---
 arch/powerpc/kernel/mce_power.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/powerpc/kernel/mce_power.c +6 -3
index 763d6f58caa8..7b765aa9f2ff 100644
@@ -72,10 +72,13 @@ void __flush_tlb_power8(unsigned int action)
 
 void __flush_tlb_power9(unsigned int action)
 {
-	if (radix_enabled())
-		flush_tlb_206(POWER9_TLB_SETS_RADIX, action);
+	unsigned int num_sets;
 
-	flush_tlb_206(POWER9_TLB_SETS_HASH, action);
+	if (radix_enabled())
+		num_sets = POWER9_TLB_SETS_RADIX;
+	else
+		num_sets = POWER9_TLB_SETS_HASH;
+	flush_tlb_206(num_sets, action);
 }
 
 
Signature · 1 line
2.11.0
#2 lore raw
In reply to Nicholas Piggin
Quoted 7 lines · Nicholas Piggin

The TLB flush for radix first flushes TLB for radix configuration, then flushes for hash configuration. The second flush is unnecessary but does not affect correctness.

Fixes 1a472c9dba6b9 ("powerpc/mm/radix: Add tlbflush routines")

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/95dbdf4fa09823e35b29eab8f70939

cheers