Skip to content

Rework GPU TLB invalidation

Alex Deucher amd-gfx 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest23 patches 0 repliesNew
  2. v231 patches 11 repliesSuperseded
  3. v130 patches 1 replySuperseded

Changes in v3 from the cover letter

- Move the code clean up to the start drop
most of the behavior changes.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23drm/amdgpu/gmc9: disallow gfxoff around TLB flushesdrivers/gpu/drm/amd/amdgpu/gmc_v9_0.c+7 -00 replies
2/23drm/amdgpu/gmc10: disallow gfxoff around TLB flushesdrivers/gpu/drm/amd/amdgpu/gmc_v10_0.c+7 -00 replies
3/23drm/amdgpu/gmc11: disallow gfxoff around TLB flushesdrivers/gpu/drm/amd/amdgpu/gmc_v11_0.c+7 -00 replies
4/23drm/amdgpu/gmc12: disallow gfxoff around TLB flushesdrivers/gpu/drm/amd/amdgpu/gmc_v12_0.c+7 -10 replies
5/23drm/amdgpu/gmc9: set vmhub funcs for gfxhub and mmhubdrivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 more+197 -210 replies
6/23drm/amdgpu: add a buffer funcs callback for TLB invalidationdrivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h+18 -00 replies
7/23drm/amdgpu/sdma5.0: add tlb invalidation buffer func callbackdrivers/gpu/drm/amd/amdgpu/sdma_v5_0.c+49 -00 replies
8/23drm/amdgpu/sdma5.2: add tlb invalidation buffer func callbackdrivers/gpu/drm/amd/amdgpu/sdma_v5_2.c+49 -00 replies
9/23drm/amdgpu/sdma6: add tlb invalidation buffer func callbackdrivers/gpu/drm/amd/amdgpu/sdma_v6_0.c+49 -00 replies
10/23drm/amdgpu/sdma7: add tlb invalidation buffer func callbackdrivers/gpu/drm/amd/amdgpu/sdma_v7_0.c+48 -00 replies
11/23drm/amdgpu: add tlb invalidation method enumdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h+10 -00 replies
12/23drm/amdgpu: plumb tlb inv method in amdgpu_gmc_flush_gpu_tlb()drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+15 -30 replies
13/23drm/amdgpu: uplevel reset check in amdgpu_gmc_flush_gpu_tlb()drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+9 -70 replies
14/23drm/amdgpu/gmc: add new callback to lookup vmid to pasid mappingdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +3 more+23 -90 replies
15/23drm/amdgpu: add a gmc callback for the inv semaphoredrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +3 more+8 -00 replies
16/23drm/amdgpu/gmc: rework pasid flushingdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +5 more+209 -960 replies
17/23drm/amdgpu/gmc: add helpers for various tlb inv functionsdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +5 more+221 -8910 replies
18/23drm/amdgpu/gmc10: use SDMA for gart TLB invalidationdrivers/gpu/drm/amd/amdgpu/gmc_v10_0.c+1 -00 replies
19/23drm/amdgpu/gmc11: use SDMA for gart TLB invalidationdrivers/gpu/drm/amd/amdgpu/gmc_v11_0.c+1 -00 replies
20/23drm/amdgpu/gmc12: use SDMA for gart TLB invalidationdrivers/gpu/drm/amd/amdgpu/gmc_v12_0.c+2 -00 replies
21/23drm/amdgpu/gmc10: use SDMA for pasid TLB invalidationdrivers/gpu/drm/amd/amdgpu/gmc_v10_0.c+1 -20 replies
22/23drm/amdgpu/gmc11: use SDMA for pasid TLB invalidationdrivers/gpu/drm/amd/amdgpu/gmc_v11_0.c+1 -20 replies
23/23drm/amdgpu/gmc12: use MES or SDMA for pasid TLB invalidationdrivers/gpu/drm/amd/amdgpu/gmc_v12_0.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH V3 00/23] Rework GPU TLB invalidation

This departs a bit from the first two revisions. This series is split into two parts:
1. Patches 1-17: clean up the duplicated code across GMC 9-12 and move most of it to common GMC code. No intended functional change. It also adds an new SDMA invalidation path which is unused until the second part of the series.
2. Patches 18-23: switch to using SDMA (or MES) for invalidations on GMC 10-12. Conditions that currently use MES continue to use MES. Using SDMA for the other cases aligns with the hubs team's advice and what other OSes do.

I think part 1 is a worthwile cleanup, part 2 is open to debate.

Code is available on this branch as well:
https://gitlab.freedesktop.org/agd5f/linux/-/commits/tlb_inv_rework?ref_type=heads

V2:
- Add missing hub callbacks in gmc9 hubs
V3:
- Move the code clean up to the start drop
most of the behavior changes.

*** BLURB HERE ***

Alex Deucher (23):
drm/amdgpu/gmc9: disallow gfxoff around TLB flushes drm/amdgpu/gmc10: disallow gfxoff around TLB flushes drm/amdgpu/gmc11: disallow gfxoff around TLB flushes drm/amdgpu/gmc12: disallow gfxoff around TLB flushes drm/amdgpu/gmc9: set vmhub funcs for gfxhub and mmhub drm/amdgpu: add a buffer funcs callback for TLB invalidation drm/amdgpu/sdma5.0: add tlb invalidation buffer func callback drm/amdgpu/sdma5.2: add tlb invalidation buffer func callback drm/amdgpu/sdma6: add tlb invalidation buffer func callback drm/amdgpu/sdma7: add tlb invalidation buffer func callback drm/amdgpu: add tlb invalidation method enum drm/amdgpu: plumb tlb inv method in amdgpu_gmc_flush_gpu_tlb() drm/amdgpu: uplevel reset check in amdgpu_gmc_flush_gpu_tlb() drm/amdgpu/gmc: add new callback to lookup vmid to pasid mapping drm/amdgpu: add a gmc callback for the inv semaphore drm/amdgpu/gmc: rework pasid flushing
drm/amdgpu/gmc: add helpers for various tlb inv functions drm/amdgpu/gmc10: use SDMA for gart TLB invalidation drm/amdgpu/gmc11: use SDMA for gart TLB invalidation drm/amdgpu/gmc12: use SDMA for gart TLB invalidation drm/amdgpu/gmc10: use SDMA for pasid TLB invalidation drm/amdgpu/gmc11: use SDMA for pasid TLB invalidation drm/amdgpu/gmc12: use MES or SDMA for pasid TLB invalidation

 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c  | 474 ++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h  |  27 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h |  18 +
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c   |   2 +
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c |  33 ++
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c |  33 ++
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c   | 199 +---------
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c   | 204 +---------
 drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c   | 237 +-----------
 drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c   | 224 +----------
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c    | 127 +-----
 drivers/gpu/drm/amd/amdgpu/mes_v12_0.c   |   4 +
 drivers/gpu/drm/amd/amdgpu/mes_v12_1.c   |   4 +
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  |  33 ++
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c  |  32 ++
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c  |  32 ++
 drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c  |  32 ++
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c   |  49 +++
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c   |  49 +++
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c   |  49 +++
 drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c   |  48 +++
 21 files changed, 909 insertions(+), 1001 deletions(-)
Signature · 1 line
2.55.0