Skip to content

powerpc/mm: Mark memory contexts requiring global TLBIs

Frederic Barrat linuxppc-dev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 5 repliesIn review
  2. v2 RFC3 patches 0 repliesSuperseded
  3. v1 RFC2 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- convert from RFC to PATCH
- mark contexts used by XSL (cxllib) as needed global invalidation

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3powerpc/mm: Add marker for contexts requiring global TLB invalidationsarch/powerpc/include/asm/book3s/64/mmu.h arch/powerpc/include/asm/tlb.h arch/powerpc/mm/mmu_context_book3s64.c +2 more+48 -92 replies
2/3cxl: Mark context requiring global TLBIsdrivers/misc/cxl/api.c drivers/misc/cxl/cxllib.c drivers/misc/cxl/file.c+27 -42 replies
3/3cxl: Add memory barrier to guarantee TLBI scopeinclude/misc/cxl-base.h+19 -30 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchBalbir SinghAlistair Popple
1/3A-b T-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] powerpc/mm: Mark memory contexts requiring global TLBIs

capi2 and opencapi require the TLB invalidations being sent for addresses used on the cxl adapter or opencapi device to be global, as there's a translation cache in the PSL (for capi2) or NPU (for opencapi). The CAPP, on behalf of the PSL, and NPU snoop the power bus.

This is not new: for the hash memory model, as soon as the cxl driver is active, all local TLBIs become global. We need a similar mechanism for the radix memory model. This patch tries to improve things a bit by flagging the contexts requiring global TLBIs, therefore limiting the "upgrade" and not affecting contexts not used by the card.

A longer-term goal is to modify the current implementation for hash to follow the same direction, i.e. identify contexts needing global TLBIs, but that will be for later. It would be required to support hash for opencapi.

Changelog:
v3:
- convert from RFC to PATCH
- mark contexts used by XSL (cxllib) as needed global invalidation
RFC v2:
- address comments received
- rename MM_CONTEXT_GLOBAL_TLBI -> MM_GLOBAL_TLBIE
- add memory barriers to make sure the device doesn't miss any TLBI
- also add barrier for the hash implemention to fix the same issue

Frederic Barrat (3):
powerpc/mm: Add marker for contexts requiring global TLB invalidations
cxl: Mark context requiring global TLBIs
cxl: Add memory barrier to guarantee TLBI scope

 arch/powerpc/include/asm/book3s/64/mmu.h | 18 ++++++++++++++++++
 arch/powerpc/include/asm/tlb.h           | 27 +++++++++++++++++++++++----
 arch/powerpc/mm/mmu_context_book3s64.c   |  1 +
 arch/powerpc/mm/tlb-radix.c              |  8 ++++----
 arch/powerpc/mm/tlb_hash64.c             |  3 ++-
 drivers/misc/cxl/api.c                   | 12 ++++++++++--
 drivers/misc/cxl/cxllib.c                |  7 +++++++
 drivers/misc/cxl/file.c                  | 12 ++++++++++--
 include/misc/cxl-base.h                  | 22 +++++++++++++++++++---
 9 files changed, 94 insertions(+), 16 deletions(-)
Signature · 1 line
2.11.0