Skip to content

Commit a67004a

Browse files
Frederic Barratgregkh
authored andcommitted
powerpc/mm: Add missing global TLB invalidate if cxl is active
commit 88b1bf7268f56887ca88eb09c6fb0f4fc970121a upstream. 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") 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 435cc43 commit a67004a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

arch/powerpc/mm/hash_native_64.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,10 @@ static void native_flush_hash_range(unsigned long number, int local)
645645
unsigned long psize = batch->psize;
646646
int ssize = batch->ssize;
647647
int i;
648+
unsigned int use_local;
649+
650+
use_local = local && mmu_has_feature(MMU_FTR_TLBIEL) &&
651+
mmu_psize_defs[psize].tlbiel && !cxl_ctx_in_use();
648652

649653
local_irq_save(flags);
650654

@@ -671,8 +675,7 @@ static void native_flush_hash_range(unsigned long number, int local)
671675
} pte_iterate_hashed_end();
672676
}
673677

674-
if (mmu_has_feature(MMU_FTR_TLBIEL) &&
675-
mmu_psize_defs[psize].tlbiel && local) {
678+
if (use_local) {
676679
asm volatile("ptesync":::"memory");
677680
for (i = 0; i < number; i++) {
678681
vpn = batch->vpn[i];

0 commit comments

Comments
 (0)