powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Tue, 24 Sep 2019 03:52:53 +0000 (09:22 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 24 Sep 2019 10:58:55 +0000 (20:58 +1000)
commit047e6575aec71d75b765c22111820c4776cd1c43
tree8742d25f78cbcf3add79662e241546d2d7e8846c
parent09ce98cacd51fcd0fa0af2f79d1e1d3192f4cbb0
powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9

On POWER9, under some circumstances, a broadcast TLB invalidation will
fail to invalidate the ERAT cache on some threads when there are
parallel mtpidr/mtlpidr happening on other threads of the same core.
This can cause stores to continue to go to a page after it's unmapped.

The workaround is to force an ERAT flush using PID=0 or LPID=0 tlbie
flush. This additional TLB flush will cause the ERAT cache
invalidation. Since we are using PID=0 or LPID=0, we don't get
filtered out by the TLB snoop filtering logic.

We need to still follow this up with another tlbie to take care of
store vs tlbie ordering issue explained in commit:
a5d4b5891c2f ("powerpc/mm: Fixup tlbie vs store ordering issue on
POWER9"). The presence of ERAT cache implies we can still get new
stores and they may miss store queue marking flush.

Cc: stable@vger.kernel.org
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190924035254.24612-3-aneesh.kumar@linux.ibm.com
arch/powerpc/include/asm/cputable.h
arch/powerpc/kernel/dt_cpu_ftrs.c
arch/powerpc/kvm/book3s_hv_rm_mmu.c
arch/powerpc/mm/book3s64/hash_native.c
arch/powerpc/mm/book3s64/radix_tlb.c