All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix action argument for cpufeatures-based TLB flush
@ 2017-09-27  4:55 Jeremy Kerr
  2017-09-27  5:44 ` Nicholas Piggin
  2017-10-05  4:22 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Jeremy Kerr @ 2017-09-27  4:55 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Jeremy Kerr, Nicholas Piggin, Meng YK Li

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.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
CC: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/kernel/dt_cpu_ftrs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index 1df770e..7275fed 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -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");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: Fix action argument for cpufeatures-based TLB flush
  2017-09-27  4:55 [PATCH] powerpc: Fix action argument for cpufeatures-based TLB flush Jeremy Kerr
@ 2017-09-27  5:44 ` Nicholas Piggin
  2017-10-05  4:22 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Nicholas Piggin @ 2017-09-27  5:44 UTC (permalink / raw)
  To: Jeremy Kerr; +Cc: linuxppc-dev, Meng YK Li

On Wed, 27 Sep 2017 12:55:51 +0800
Jeremy Kerr <jk@ozlabs.org> 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.
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> CC: Nicholas Piggin <npiggin@gmail.com>

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.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: powerpc: Fix action argument for cpufeatures-based TLB flush
  2017-09-27  4:55 [PATCH] powerpc: Fix action argument for cpufeatures-based TLB flush Jeremy Kerr
  2017-09-27  5:44 ` Nicholas Piggin
@ 2017-10-05  4:22 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-10-05  4:22 UTC (permalink / raw)
  To: Jeremy Kerr, linuxppc-dev; +Cc: Meng YK Li, Jeremy Kerr, Nicholas Piggin

On Wed, 2017-09-27 at 04:55:51 UTC, Jeremy Kerr 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.
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> CC: Nicholas Piggin <npiggin@gmail.com>
> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

Applied to powerpc fixes, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-05  4:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27  4:55 [PATCH] powerpc: Fix action argument for cpufeatures-based TLB flush Jeremy Kerr
2017-09-27  5:44 ` Nicholas Piggin
2017-10-05  4:22 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.