Quantcast

[PATCH X/Y/Z SRU] powerpc/mm: Add missing global TLB invalidate if cxl is active

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH X/Y/Z SRU] powerpc/mm: Add missing global TLB invalidate if cxl is active

Tim Gardner-2
From: Frederic Barrat <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1681469

Commit 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl") converted local
TLB invalidates to global if the cxl driver is active. This is necessary
because the CAPP snoops invalidations to forward them to the PSL on the
cxl adapter. However one path was forgotten. native_flush_hash_range()
still does local TLB invalidates, as found out the hard way recently.

This patch fixes it by following the same logic as previously: if the
cxl driver is active, the local TLB invalidates are 'upgraded' to
global.

Fixes: 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl")
Cc: [hidden email] # v3.18+
Signed-off-by: Frederic Barrat <[hidden email]>
Reviewed-by: Aneesh Kumar K.V <[hidden email]>
Signed-off-by: Michael Ellerman <[hidden email]>
(cherry picked from commit 88b1bf7268f56887ca88eb09c6fb0f4fc970121a)
Signed-off-by: Tim Gardner <[hidden email]>
---
 arch/powerpc/mm/hash_native_64.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index cc33260..65bb8f3 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -638,6 +638,10 @@ static void native_flush_hash_range(unsigned long number, int local)
  unsigned long psize = batch->psize;
  int ssize = batch->ssize;
  int i;
+ unsigned int use_local;
+
+ use_local = local && mmu_has_feature(MMU_FTR_TLBIEL) &&
+ mmu_psize_defs[psize].tlbiel && !cxl_ctx_in_use();
 
  local_irq_save(flags);
 
@@ -667,8 +671,7 @@ static void native_flush_hash_range(unsigned long number, int local)
  } pte_iterate_hashed_end();
  }
 
- if (mmu_has_feature(MMU_FTR_TLBIEL) &&
-    mmu_psize_defs[psize].tlbiel && local) {
+ if (use_local) {
  asm volatile("ptesync":::"memory");
  for (i = 0; i < number; i++) {
  vpn = batch->vpn[i];
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH X/Y/Z SRU] powerpc/mm: Add missing global TLB invalidate if cxl is active

Colin Ian King-2
On 12/04/17 12:57, Tim Gardner wrote:

> From: Frederic Barrat <[hidden email]>
>
> BugLink: http://bugs.launchpad.net/bugs/1681469
>
> Commit 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl") converted local
> TLB invalidates to global if the cxl driver is active. This is necessary
> because the CAPP snoops invalidations to forward them to the PSL on the
> cxl adapter. However one path was forgotten. native_flush_hash_range()
> still does local TLB invalidates, as found out the hard way recently.
>
> This patch fixes it by following the same logic as previously: if the
> cxl driver is active, the local TLB invalidates are 'upgraded' to
> global.
>
> Fixes: 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl")
> Cc: [hidden email] # v3.18+
> Signed-off-by: Frederic Barrat <[hidden email]>
> Reviewed-by: Aneesh Kumar K.V <[hidden email]>
> Signed-off-by: Michael Ellerman <[hidden email]>
> (cherry picked from commit 88b1bf7268f56887ca88eb09c6fb0f4fc970121a)
> Signed-off-by: Tim Gardner <[hidden email]>
> ---
>  arch/powerpc/mm/hash_native_64.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
> index cc33260..65bb8f3 100644
> --- a/arch/powerpc/mm/hash_native_64.c
> +++ b/arch/powerpc/mm/hash_native_64.c
> @@ -638,6 +638,10 @@ static void native_flush_hash_range(unsigned long number, int local)
>   unsigned long psize = batch->psize;
>   int ssize = batch->ssize;
>   int i;
> + unsigned int use_local;
> +
> + use_local = local && mmu_has_feature(MMU_FTR_TLBIEL) &&
> + mmu_psize_defs[psize].tlbiel && !cxl_ctx_in_use();
>  
>   local_irq_save(flags);
>  
> @@ -667,8 +671,7 @@ static void native_flush_hash_range(unsigned long number, int local)
>   } pte_iterate_hashed_end();
>   }
>  
> - if (mmu_has_feature(MMU_FTR_TLBIEL) &&
> -    mmu_psize_defs[psize].tlbiel && local) {
> + if (use_local) {
>   asm volatile("ptesync":::"memory");
>   for (i = 0; i < number; i++) {
>   vpn = batch->vpn[i];
>

Upstream cherry pick, make sense with respect to commit message and
reference to 4c6d9acce1f4 and is a stable fix, so...

Acked-by: Colin Ian King <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK: [PATCH X/Y/Z SRU] powerpc/mm: Add missing global TLB invalidate if cxl is active

Joseph Salisbury-3
In reply to this post by Tim Gardner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

APPLIED[Y/master-next] SKIP[X/master-next]: [PATCH X/Y/Z SRU] powerpc/mm: Add missing global TLB invalidate if cxl is active

Stefan Bader-2
In reply to this post by Tim Gardner-2
Already included by most recent upstream stable update (4.4.60) for Xenial.


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH X/Y/Z SRU] powerpc/mm: Add missing global TLB invalidate if cxl is active

Seth Forshee
In reply to this post by Tim Gardner-2
On Wed, Apr 12, 2017 at 05:57:17AM -0600, Tim Gardner wrote:

> From: Frederic Barrat <[hidden email]>
>
> BugLink: http://bugs.launchpad.net/bugs/1681469
>
> Commit 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl") converted local
> TLB invalidates to global if the cxl driver is active. This is necessary
> because the CAPP snoops invalidations to forward them to the PSL on the
> cxl adapter. However one path was forgotten. native_flush_hash_range()
> still does local TLB invalidates, as found out the hard way recently.
>
> This patch fixes it by following the same logic as previously: if the
> cxl driver is active, the local TLB invalidates are 'upgraded' to
> global.
>
> Fixes: 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl")
> Cc: [hidden email] # v3.18+
> Signed-off-by: Frederic Barrat <[hidden email]>
> Reviewed-by: Aneesh Kumar K.V <[hidden email]>
> Signed-off-by: Michael Ellerman <[hidden email]>
> (cherry picked from commit 88b1bf7268f56887ca88eb09c6fb0f4fc970121a)
> Signed-off-by: Tim Gardner <[hidden email]>

This was applied to zesty as part of the 4.10.10 stable update.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Loading...