RFC drm/amd/sriov: add PF SR-IOV host driver
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest34 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/34 | drm/amd/sriov: add PF host build wiringMAINTAINERS drivers/ | +27 | 0 replies | |
| 2/34 | drm/amd/sriov: add PF host boot parametersdrivers/ drivers/ drivers/ +2 more | +118 | 0 replies | |
| 3/34 | drm/amd/sriov: disable PF host PM defaultsdrivers/ drivers/ drivers/ +1 more | +33 | 0 replies | |
| 4/34 | drm/amd/sriov: block PF host user submissionsdrivers/ drivers/ drivers/ +2 more | +82 | 0 replies | |
| 5/34 | drm/amd/sriov: block PF host KFD user queuesdrivers/ drivers/ | +84 | 0 replies | |
| 6/34 | drm/amd/sriov: skip MM IP blocks on PF hostdrivers/ | +16 | 0 replies | |
| 7/34 | drm/amd/sriov: skip display blocks on PF hostdrivers/ | +5 | 0 replies | |
| 8/34 | drm/amd/sriov: add PF host IP block init and finidrivers/ drivers/ drivers/ +7 more | +594 | 0 replies | |
| 9/34 | drm/amd/sriov: load PF RLC firmware variantdrivers/ drivers/ | +11 | 0 replies | |
| 10/34 | drm/amd/sriov: extend PSP GFX interface for IOVMdrivers/ drivers/ drivers/ +1 more | +64 | 0 replies | |
| 11/34 | drm/amd/sriov: add PSP 15.0.3 IOVM driver bootloader callbackdrivers/ drivers/ drivers/ | +18 | 0 replies | |
| 12/34 | drm/amd/sriov: update PF PSP init for IOVM firmwaredrivers/ | +77 | 0 replies | |
| 13/34 | drm/amd/sriov: add IOVM driver PSP command submissiondrivers/ drivers/ | +36 | 0 replies | |
| 14/34 | drm/amd/sriov: add IOVM PSP command helpersdrivers/ drivers/ drivers/ | +827 | 0 replies | |
| 15/34 | drm/amd/sriov: add GPUIOV servicedrivers/ drivers/ drivers/ +2 more | +683 | 0 replies | |
| 16/34 | drm/amd/sriov: add GC 13.0.1 GPUIOV providerdrivers/ drivers/ drivers/ +4 more | +463 | 0 replies | |
| 17/34 | drm/amd/sriov: add GMC 13.0.1 GPUIOV providerdrivers/ drivers/ drivers/ +3 more | +147 | 0 replies | |
| 18/34 | drm/amd/sriov: add PF mailbox servicedrivers/ drivers/ drivers/ +1 more | +144 | 0 replies | |
| 19/34 | drm/amd/sriov: add NBIF 7.10.0 PF mailbox backenddrivers/ drivers/ drivers/ +5 more | +794 | 0 replies | |
| 20/34 | drm/amd/sriov: add FFBM servicedrivers/ drivers/ drivers/ +2 more | +407 | 0 replies | |
| 21/34 | drm/amd/sriov: add VF managerdrivers/ drivers/ drivers/ +2 more | +215 | 0 replies | |
| 22/34 | drm/amd/sriov: add VF resource setupdrivers/ drivers/ drivers/ +3 more | +374 | 0 replies | |
| 23/34 | drm/amd/sriov: add PSP 15.0.3 VF access gate providerdrivers/ drivers/ drivers/ +4 more | +370 | 0 replies | |
| 24/34 | drm/amd/sriov: add NBIF 7.10.0 VF access gate headersdrivers/ drivers/ | +17 | 0 replies | |
| 25/34 | drm/amd/sriov: add NBIF 7.10.0 VF access gate backenddrivers/ drivers/ drivers/ | +258 | 0 replies | |
| 26/34 | drm/amd/sriov: add VF mailbox boot layoutdrivers/ drivers/ drivers/ +1 more | +275 | 0 replies | |
| 27/34 | drm/amd/sriov: add VF IP discovery table builderdrivers/ drivers/ drivers/ +2 more | +688 | 0 replies | |
| 28/34 | drm/amd/sriov: add guest VBIOS image builderdrivers/ | +93 | 0 replies | |
| 29/34 | drm/amd/sriov: export VF boot data to guest FBdrivers/ drivers/ drivers/ | +506 | 0 replies | |
| 30/34 | drm/amd/sriov: add PF scheduler documentationDocumentation/ Documentation/ | +738 | 0 replies | |
| 31/34 | drm/amd/sriov: add scheduler event handlingdrivers/ drivers/ drivers/ +11 more | +1996 | 0 replies | |
| 32/34 | drm/amd/sriov: add manual scheduler topologydrivers/ drivers/ drivers/ +8 more | +1000 | 0 replies | |
| 33/34 | drm/amd/sriov: add manual world switch supportdrivers/ drivers/ drivers/ +8 more | +2138 | 0 replies | |
| 34/34 | drm/amd/sriov: add VF guard event limitsdrivers/ drivers/ drivers/ +4 more | +430 | 0 replies |
Reviews trailers per patch
8 of 34 patches have a Reviewed-by or Acked-by.
| Patch | Alex Deucher |
|---|---|
| 1/34 | |
| 2/34 | |
| 3/34 | A-b |
| 4/34 | A-b |
| 5/34 | A-b |
| 6/34 | A-b |
| 7/34 | A-b |
| 8/34 | |
| 9/34 | A-b |
| 10/34 | |
| 11/34 | A-b |
| 12/34 | |
| 13/34 | |
| 14/34 | |
| 15/34 | |
| 16/34 | |
| 17/34 | |
| 18/34 | |
| 19/34 | |
| 20/34 | |
| 21/34 | |
| 22/34 | |
| 23/34 | |
| 24/34 | A-b |
| 25/34 | |
| 26/34 | |
| 27/34 | |
| 28/34 | |
| 29/34 | |
| 30/34 | |
| 31/34 | |
| 32/34 | |
| 33/34 | |
| 34/34 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH v1 00/34] drm/amd/sriov: add PF SR-IOV host driver
This RFC adds SR-IOV PF host mode to the amdgpu driver. It introduces a new drivers/gpu/drm/amd/sriov/ control plane under the existing amdgpu PF device lifecycle. The validation target is 1VF bring-up on real asic:
after a clean PF host load with one VF configured, a single VF is created, the guest amdgpu driver load and reload complete, and a guest workload runs.
Thirty-four patches are attached.
Ownership map
-------------
struct amdgpu_device remains the single source of truth for PF physical
state: PCI lifecycle, BAR, IP discovery, firmware, IRQ, reset, RAS, PSP, SMU, GMC, GART, TTM, VRAM, and other hardware-facing PF initialization stay in the existing amdgpu owner paths.
SR-IOV PF host mode adds:
- adev->num_vfs — resolved VF count from boot-time module parameters
- adev->sriov — SR-IOV host subsystem root object
- drivers/gpu/drm/amd/sriov/ — PF-side control plane for VF management and service orchestration
Integration uses one host-style IP block, sriov_host_v1_0_ip_block, mounted through the existing amdgpu IP block discovery path. GPUIOV, mailbox, FFBM, VFMGR, and scheduler are service objects under adev->sriov; they are not registered as separate physical IP blocks.
Request flow
------------
Guest VF lifecycle request (VF2PF mailbox message):
VF2PF mailbox ingress
-> decode message, manage valid/ACK state
scheduler event service
-> queue/worker, timeout, full-access state, PF2VF response
manual world switch (single-VF path)
-> idle/save/load/run/shutdown/reset through scheduler-owned actions
middle services
-> VFMGR (resource view, boot data)
-> GPUIOV (command/state, VF PCI exposure)
-> FFBM (VF backing map/unmap, GPA-to-SPA)
hardware / firmware providers
-> IOVM PSP command transport
-> NBIF mailbox registers
-> GC/GMC provider hooksPF physical bring-up (firmware, discovery, PM/user-path policy) stays in the existing amdgpu owner paths and gates entry into the flow above.
Boot-time contract
------------------
The user-visible module parameter remains amdgpu.sriov_numvfs.
Supported forms:
amdgpu.sriov_numvfs=all,N
amdgpu.sriov_numvfs=dddd:bb:dd.f,N
amdgpu_parse_sriov_host_params() runs immediately after IP discovery data is parsed and adev->ip_versions[] is available, before display, multimedia, and SR-IOV host IP block registration that depend on amdgpu_sriov_pf(adev).
Mode helpers:
amdgpu_sriov_pf_supported(adev) — hardware / IP version capability amdgpu_sriov_pf(adev) — adev->num_vfs > 0
Unsupported devices, malformed parameters, zero VF count, or a device without SR-IOV VFs fail closed and keep the bare-metal path unchanged. If the requested count exceeds the device TotalVFs, the driver warns and falls back to one VF.
Patch list
----------
0001 drm/amd/sriov: add PF host build wiring
0002 drm/amd/sriov: add PF host boot parameters
0003 drm/amd/sriov: disable PF host PM defaults
0004 drm/amd/sriov: block PF host user submissions
0005 drm/amd/sriov: block PF host KFD user queues
0006 drm/amd/sriov: skip MM IP blocks on PF host
0007 drm/amd/sriov: skip display blocks on PF host
0008 drm/amd/sriov: add PF host IP block init and fini 0009 drm/amd/sriov: load PF RLC firmware variant
0010 drm/amd/sriov: extend PSP GFX interface for IOVM 0011 drm/amd/sriov: add PSP 15.0.3 IOVM driver bootloader callback 0012 drm/amd/sriov: update PF PSP init for IOVM firmware 0013 drm/amd/sriov: add IOVM driver PSP command submission 0014 drm/amd/sriov: add IOVM PSP command helpers
0015 drm/amd/sriov: add GPUIOV service
0016 drm/amd/sriov: add GC 13.0.1 GPUIOV provider
0017 drm/amd/sriov: add GMC 13.0.1 GPUIOV provider
0018 drm/amd/sriov: add PF mailbox service
0019 drm/amd/sriov: add NBIF 7.10.0 PF mailbox backend 0020 drm/amd/sriov: add FFBM service
0021 drm/amd/sriov: add VF manager
0022 drm/amd/sriov: add VF resource setup
0023 drm/amd/sriov: add PSP 15.0.3 VF access gate provider 0024 drm/amd/sriov: add NBIF 7.10.0 VF access gate headers 0025 drm/amd/sriov: add NBIF 7.10.0 VF access gate backend 0026 drm/amd/sriov: add VF mailbox boot layout
0027 drm/amd/sriov: add VF IP discovery table builder 0028 drm/amd/sriov: add guest VBIOS image builder
0029 drm/amd/sriov: export VF boot data to guest FB 0030 drm/amd/sriov: add PF scheduler documentation
0031 drm/amd/sriov: add scheduler event handling
0032 drm/amd/sriov: add manual scheduler topology
0033 drm/amd/sriov: add manual world switch support 0034 drm/amd/sriov: add VF guard event limits
Thanks,
Emily Deng
Emily Deng (34):
drm/amd/sriov: add PF host build wiring drm/amd/sriov: add PF host boot parameters drm/amd/sriov: disable PF host PM defaults drm/amd/sriov: block PF host user submissions drm/amd/sriov: block PF host KFD user queues drm/amd/sriov: skip MM IP blocks on PF host drm/amd/sriov: skip display blocks on PF host drm/amd/sriov: add PF host IP block init and fini drm/amd/sriov: load PF RLC firmware variant drm/amd/sriov: extend PSP GFX interface for IOVM drm/amd/sriov: add PSP 15.0.3 IOVM driver bootloader callback drm/amd/sriov: update PF PSP init for IOVM firmware drm/amd/sriov: add IOVM driver PSP command submission drm/amd/sriov: add IOVM PSP command helpers drm/amd/sriov: add GPUIOV service
drm/amd/sriov: add GC 13.0.1 GPUIOV provider drm/amd/sriov: add GMC 13.0.1 GPUIOV provider drm/amd/sriov: add PF mailbox service drm/amd/sriov: add NBIF 7.10.0 PF mailbox backend drm/amd/sriov: add FFBM service
drm/amd/sriov: add VF manager
drm/amd/sriov: add VF resource setup
drm/amd/sriov: add PSP 15.0.3 VF access gate provider drm/amd/sriov: add NBIF 7.10.0 VF access gate headers drm/amd/sriov: add NBIF 7.10.0 VF access gate backend drm/amd/sriov: add VF mailbox boot layout drm/amd/sriov: add VF IP discovery table builder drm/amd/sriov: add guest VBIOS image builder drm/amd/sriov: export VF boot data to guest FB drm/amd/sriov: add PF scheduler documentation drm/amd/sriov: add scheduler event handling drm/amd/sriov: add manual scheduler topology drm/amd/sriov: add manual world switch support drm/amd/sriov: add VF guard event limits
Documentation/gpu/amdgpu/index.rst | 1 + Documentation/gpu/amdgpu/sriov-scheduler.rst | 737 ++++++++ MAINTAINERS | 1 + drivers/gpu/drm/amd/amdgpu/Makefile | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu.h | 7 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 138 +- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 54 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 60 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ip.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 22 +- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 132 +- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 21 + .../gpu/drm/amd/amdgpu/amdgpu_sriov_host.h | 37 + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 103 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 13 +- drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c | 23 +- drivers/gpu/drm/amd/amdgpu/nbif_v7_10.c | 4 + drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h | 55 +- drivers/gpu/drm/amd/amdgpu/psp_v15_0_3.c | 13 + drivers/gpu/drm/amd/amdgpu/sdma_v8_0.c | 5 + drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 38 + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 55 +- drivers/gpu/drm/amd/include/amd_shared.h | 2 + .../asic_reg/nbif/nbif_7_10_0_offset.h | 6 + .../asic_reg/nbif/nbif_7_10_0_sh_mask.h | 11 + drivers/gpu/drm/amd/sriov/Makefile | 46 + drivers/gpu/drm/amd/sriov/sriov.c | 590 +++++++ drivers/gpu/drm/amd/sriov/sriov.h | 162 ++ drivers/gpu/drm/amd/sriov/sriov_ffbm.c | 332 ++++ drivers/gpu/drm/amd/sriov/sriov_ffbm.h | 71 + drivers/gpu/drm/amd/sriov/sriov_gfx_v13_0.c | 295 ++++ drivers/gpu/drm/amd/sriov/sriov_gfx_v13_0.h | 32 + drivers/gpu/drm/amd/sriov/sriov_gmc_v13_0.c | 77 + drivers/gpu/drm/amd/sriov/sriov_gmc_v13_0.h | 32 + drivers/gpu/drm/amd/sriov/sriov_gpuiov.c | 695 ++++++++ drivers/gpu/drm/amd/sriov/sriov_gpuiov.h | 184 ++ drivers/gpu/drm/amd/sriov/sriov_guard.c | 255 +++ drivers/gpu/drm/amd/sriov/sriov_guard.h | 100 ++ drivers/gpu/drm/amd/sriov/sriov_hwsm.c | 235 +++ drivers/gpu/drm/amd/sriov/sriov_hwsm.h | 50 + drivers/gpu/drm/amd/sriov/sriov_iovm.c | 715 ++++++++ drivers/gpu/drm/amd/sriov/sriov_iovm.h | 111 ++ .../gpu/drm/amd/sriov/sriov_ip_discovery.c | 627 +++++++ .../gpu/drm/amd/sriov/sriov_ip_discovery.h | 47 + drivers/gpu/drm/amd/sriov/sriov_mailbox.c | 582 ++++++ drivers/gpu/drm/amd/sriov/sriov_mailbox.h | 89 + drivers/gpu/drm/amd/sriov/sriov_nbif_v7_10.c | 401 +++++ drivers/gpu/drm/amd/sriov/sriov_nbif_v7_10.h | 32 + drivers/gpu/drm/amd/sriov/sriov_psp_15_0_3.c | 298 ++++ drivers/gpu/drm/amd/sriov/sriov_psp_15_0_3.h | 32 + drivers/gpu/drm/amd/sriov/sriov_sched.c | 192 ++ drivers/gpu/drm/amd/sriov/sriov_sched_event.c | 1428 +++++++++++++++ drivers/gpu/drm/amd/sriov/sriov_sched_event.h | 190 ++ .../drm/amd/sriov/sriov_sched_event_data.h | 84 + .../amd/sriov/sriov_sched_event_dispatch.c | 88 + .../amd/sriov/sriov_sched_event_dispatch.h | 62 + .../amd/sriov/sriov_sched_event_handlers.c | 179 ++ .../amd/sriov/sriov_sched_event_handlers.h | 55 + .../drm/amd/sriov/sriov_sched_event_priv.h | 78 + .../gpu/drm/amd/sriov/sriov_sched_switch.c | 1564 +++++++++++++++++ .../gpu/drm/amd/sriov/sriov_sched_switch.h | 209 +++ .../gpu/drm/amd/sriov/sriov_sched_ws_manual.c | 512 ++++++ .../gpu/drm/amd/sriov/sriov_sched_ws_manual.h | 33 + drivers/gpu/drm/amd/sriov/sriov_vfmgr.c | 1295 ++++++++++++++ drivers/gpu/drm/amd/sriov/sriov_vfmgr.h | 130 ++ 70 files changed, 13696 insertions(+), 57 deletions(-) create mode 100644 Documentation/gpu/amdgpu/sriov-scheduler.rst create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_sriov_host.h create mode 100644 drivers/gpu/drm/amd/sriov/Makefile create mode 100644 drivers/gpu/drm/amd/sriov/sriov.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_ffbm.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_ffbm.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_gfx_v13_0.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_gfx_v13_0.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_gmc_v13_0.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_gmc_v13_0.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_gpuiov.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_gpuiov.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_guard.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_guard.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_hwsm.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_hwsm.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_iovm.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_iovm.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_ip_discovery.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_ip_discovery.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_mailbox.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_mailbox.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_nbif_v7_10.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_nbif_v7_10.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_psp_15_0_3.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_psp_15_0_3.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event_data.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event_dispatch.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event_dispatch.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event_handlers.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event_handlers.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_event_priv.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_switch.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_switch.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_ws_manual.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_sched_ws_manual.h create mode 100644 drivers/gpu/drm/amd/sriov/sriov_vfmgr.c create mode 100644 drivers/gpu/drm/amd/sriov/sriov_vfmgr.h
Signature · 1 line
2.34.1