Skip to content

Commit 88b1bf7

Browse files
Frederic Barratmpe
authored andcommitted
powerpc/mm: Add missing global TLB invalidate if cxl is active
Commit 4c6d9ac ("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: 4c6d9ac ("powerpc/mm: Add hooks for cxl") Cc: stable@vger.kernel.org # v3.18+ Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 8f5f525 commit 88b1bf7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/powerpc/mm/hash_native_64.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ static void native_flush_hash_range(unsigned long number, int local)
638638
unsigned long psize = batch->psize;
639639
int ssize = batch->ssize;
640640
int i;
641+
unsigned int use_local;
642+
643+
use_local = local && mmu_has_feature(MMU_FTR_TLBIEL) &&
644+
mmu_psize_defs[psize].tlbiel && !cxl_ctx_in_use();
641645

642646
local_irq_save(flags);
643647

@@ -667,8 +671,7 @@ static void native_flush_hash_range(unsigned long number, int local)
667671
} pte_iterate_hashed_end();
668672
}
669673

670-
if (mmu_has_feature(MMU_FTR_TLBIEL) &&
671-
mmu_psize_defs[psize].tlbiel && local) {
674+
if (use_local) {
672675
asm volatile("ptesync":::"memory");
673676
for (i = 0; i < number; i++) {
674677
vpn = batch->vpn[i];

0 commit comments

Comments
 (0)