]> git.baikalelectronics.ru Git - kernel.git/commit
cxl: Enable global TLBIs for cxl contexts
authorFrederic Barrat <fbarrat@linux.vnet.ibm.com>
Sun, 3 Sep 2017 18:15:13 +0000 (20:15 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 28 Sep 2017 07:09:16 +0000 (17:09 +1000)
commit711f543a5e6447ddde6ab5c66e465f4929d85e9c
tree477b0118aedfca952b43149def528bcefbf8a8c8
parent930473f628280b37285c879d8a8019b62bc940f7
cxl: Enable global TLBIs for cxl contexts

The PSL and nMMU need to see all TLB invalidations for the memory
contexts used on the adapter. For the hash memory model, it is done by
making all TLBIs global as soon as the cxl driver is in use. For
radix, we need something similar, but we can refine and only convert
to global the invalidations for contexts actually used by the device.

The new mm_context_add_copro() API increments the 'active_cpus' count
for the contexts attached to the cxl adapter. As soon as there's more
than 1 active cpu, the TLBIs for the context become global. Active cpu
count must be decremented when detaching to restore locality if
possible and to avoid overflowing the counter.

The hash memory model support is somewhat limited, as we can't
decrement the active cpus count when mm_context_remove_copro() is
called, because we can't flush the TLB for a mm on hash. So TLBIs
remain global on hash.

Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Fixes: faadd32ed68b ("cxl: Add psl9 specific code")
Tested-by: Alistair Popple <alistair@popple.id.au>
[mpe: Fold in updated comment on the barrier from Fred]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/mmu_context.h
arch/powerpc/mm/mmu_context.c
drivers/misc/cxl/api.c
drivers/misc/cxl/context.c
drivers/misc/cxl/file.c