Skip to contentSkip to conversation

powerpc: Fix action argument for cpufeatures-based TLB flush

PATCH Applied Jeremy Kerr 3 participants 3 messages Sep 27, 2017 – Oct 5, 2017 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix action argument for cpufeatures-based TLB flush

Commit 41d0c2ecde introduced calls to __flush_tlb_power[89] from the cpufeatures code, specifying the number of sets to flush.

However, these functions take an action argument, not a number of sets. This means we hit the BUG() in __flush_tlb_{206,300} when using cpufeatures-style configuration.

This change passes TLB_INVAL_SCOPE_GLOBAL instead.

CC Nicholas Piggin <[email protected]>
---
 arch/powerpc/kernel/dt_cpu_ftrs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/dt_cpu_ftrs.c +2 -2
index 1df770e..7275fed 100644
@@ -102,10 +102,10 @@ static void cpufeatures_flush_tlb(void)
 	case PVR_POWER8:
 	case PVR_POWER8E:
 	case PVR_POWER8NVL:
-		__flush_tlb_power8(POWER8_TLB_SETS);
+		__flush_tlb_power8(TLB_INVAL_SCOPE_GLOBAL);
 		break;
 	case PVR_POWER9:
-		__flush_tlb_power9(POWER9_TLB_SETS_HASH);
+		__flush_tlb_power9(TLB_INVAL_SCOPE_GLOBAL);
 		break;
 	default:
 		pr_err("unknown CPU version for boot TLB flush\n");
Signature · 1 line
2.7.4
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · On Wed, 27 Sep 2017 12:55:51 +0800 Jeremy Kerr <[email protected]> wrote:

Commit 41d0c2ecde introduced calls to __flush_tlb_power[89] from the cpufeatures code, specifying the number of sets to flush.

However, these functions take an action argument, not a number of sets. This means we hit the BUG() in __flush_tlb_{206,300} when using cpufeatures-style configuration.

This change passes TLB_INVAL_SCOPE_GLOBAL instead.

CC Nicholas Piggin <[email protected]>

Thanks for this, yes it's obviously correct. Sigh, I thought I'd posted the the same thing, but I didn't actually send it to linuxppc-dev. I had another one to use early_radix_enabled() rather than radix_enabled() in the series too. I'll send it.

#2 lore raw
In reply to Jeremy Kerr
Quoted 7 lines · Jeremy Kerr

Commit 41d0c2ecde introduced calls to __flush_tlb_power[89] from the cpufeatures code, specifying the number of sets to flush.

However, these functions take an action argument, not a number of sets. This means we hit the BUG() in __flush_tlb_{206,300} when using cpufeatures-style configuration.

Quoted 5 lines

This change passes TLB_INVAL_SCOPE_GLOBAL instead.

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/3b7af5c0fd9631762d1c4d7b4cee76

cheers