提交 88b1bf72 编写于 作者: F Frederic Barrat 提交者: Michael Ellerman

powerpc/mm: Add missing global TLB invalidate if cxl is active

Commit 4c6d9acc ("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: 4c6d9acc ("powerpc/mm: Add hooks for cxl")
Cc: stable@vger.kernel.org # v3.18+
Signed-off-by: NFrederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 8f5f525d
...@@ -638,6 +638,10 @@ static void native_flush_hash_range(unsigned long number, int local) ...@@ -638,6 +638,10 @@ static void native_flush_hash_range(unsigned long number, int local)
unsigned long psize = batch->psize; unsigned long psize = batch->psize;
int ssize = batch->ssize; int ssize = batch->ssize;
int i; 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); local_irq_save(flags);
...@@ -667,8 +671,7 @@ static void native_flush_hash_range(unsigned long number, int local) ...@@ -667,8 +671,7 @@ static void native_flush_hash_range(unsigned long number, int local)
} pte_iterate_hashed_end(); } pte_iterate_hashed_end();
} }
if (mmu_has_feature(MMU_FTR_TLBIEL) && if (use_local) {
mmu_psize_defs[psize].tlbiel && local) {
asm volatile("ptesync":::"memory"); asm volatile("ptesync":::"memory");
for (i = 0; i < number; i++) { for (i = 0; i < number; i++) {
vpn = batch->vpn[i]; vpn = batch->vpn[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册