mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 00/44] dmaengine: sdxi: add userspace control and management support
@ 2026-11-19 20:22 Wei Huang
  2026-11-19 20:22 ` [PATCH v1 01/44] dmaengine: sdxi: cache hardware version for feature gating Wei Huang
                   ` (43 more replies)
  0 siblings, 44 replies; 45+ messages in thread
From: Wei Huang @ 2026-11-19 20:22 UTC (permalink / raw)
  To: dmaengine
  Cc: vkoul, Frank.Li, shuah, nathan.lynch, wei.huang2,
	mario.limonciello, Stephen.Bates, tycho, suravee.suthikulpanit,
	rientjes, John.Kariuki, jic23, weixugc, bhelgaas, Shyam.Iyer,
	linux-kernel, linux-kselftest, linux-pci

This series extends the existing SDXI phase 1 "base" driver with versioned
userspace-facing interfaces for the native SDXI software stack: device
discovery and management, process-owned execution contexts, and a
constrained vendor-extension framework.

This series applies on top of Nathan Lynch's phase 1 "base" v4 patchset,
ending at commit b8b01d7ab1e5 ("dmaengine: sdxi: Add DMA engine provider").
This series is available at:

    https://github.com/AMDESE/linux-sdxi/tree/sdxi-phase2-upstream-v1

At a high level, this new series adds:

  - A versioned ioctl UAPI and character-device interface for discovery
    and management.
  - Userspace contexts with process-bound context fds, SVA-backed rings,
    per-context doorbell mappings, and eventfd interrupt delivery.
  - A typed vendor-extension path that accepts structured requests rather
    than raw descriptors, plus an AMD QoS implementation.
  - Test coverage (KUnit + kselftests) and MAINTAINERS updates.

Patch map:

  - Patches 1-9: hardware and admin groundwork (feature gating, hardware
    layouts, admin operations, context hierarchy, RKey setup, error logs).
  - Patches 10-13: userspace-context foundations (resource separation,
    process/SVA and context lifetimes, eventfd delivery, and fatal-error
    cleanup).
  - Patches 14-27: versioned ioctl UAPI + character device (discovery and
    management, context-fd operations, vendor plumbing, tracing,
    suspend/resume).
  - Patches 28-34: AMD QoS vendor feature (capabilities, configuration,
    assignment, telemetry), with KUnit coverage.
  - Patches 35-44: kselftests (context creation, dataplane basics, error
    paths, ioctls), plus MAINTAINERS updates.

The interface is structured to separate management from the dataplane. A
device fd represents one SDXI function and is used for discovery and
function-wide management. SDXI_CREATE_CXT binds the caller's mm through
IOMMU SVA, programs userspace-owned ring state, and returns a process-bound
context fd for context-scoped control and mapping only that context's
doorbell. Userspace submits native descriptors through the SVA-backed ring
and mapped doorbell; context interrupts are delivered through a bound
eventfd. The kernel owns and validates context and key tables and issues
administrative operations for lifecycle and management requests.

Function-wide mutation and RKey management require CAP_SYS_ADMIN. Context
ioctls and doorbell mappings are restricted to the creating thread group
and mm. AKeys written by non-admin callers are limited to the local
function and bound PASID. Vendor handlers authorize typed requests. AMD
QoS composes descriptors on the kernel-owned admin context and is PF-only
and CAP_SYS_ADMIN-gated.

Companion userspace projects are available at:

  - libsdxi: userspace library
    https://github.com/AMDESE/libsdxi/tree/sdxi-phase2-upstream-v1

  - sdxi-cli: command-line tool
    https://github.com/AMDESE/sdxi-cli/tree/sdxi-phase2-upstream-v1

libsdxi wraps the UAPI and provides device discovery, context lifecycle,
key management, event handling, and vendor helpers. Sample programs
provide quick tests:

  $ ./samples/memcopy --dev /dev/sdxi0
  $ ./samples/cxt_intr --dev sdxi1

sdxi-cli is an SDXI management tool built on libsdxi. Representative
device inspection commands are:

  $ sdxi devices
  $ sdxi show sdxi0 --verbose
  $ sdxi attrs sdxi0

SDXI supports vendor-specific extensions. This patchset adds AMD QoS
management through a separate vendor handler (sdxi-amd-qos when built as
a module). AMD QoS userspace management is provided in sdxi-cli under a
vendor namespace:

  $ sdxi amd qos cap sdxi0
  $ sdxi amd qos status sdxi0
  $ sdxi amd qos assign sdxi0 --pool 1 --cxt 1

This patchset has been tested on both bare metal and virtual machines with
a passed-through VF, with the SDXI core, PCI driver, and KUnit tests built
as modules.

SDXI (Smart Data Accelerator Interface) is a SNIA standard for a
memory-to-memory data mover and acceleration interface, developed by
industry contributors including Dell, AMD, VMware, etc. The SDXI
specifications and related material are available at:

  - SDXI v1.0a and v1.1 specifications: https://www.snia.org/sdxi

Thanks,
-Wei

Wei Huang (44):
  dmaengine: sdxi: cache hardware version for feature gating
  dmaengine: sdxi: define key and error MMIO registers
  dmaengine: sdxi: define SDXI hardware layouts
  dmaengine: sdxi: encode admin descriptors
  dmaengine: sdxi: support timeout-aware completion waits
  dmaengine: sdxi: support the full context table hierarchy
  dmaengine: sdxi: implement synchronous admin operations
  dmaengine: sdxi: add core RKey table management
  dmaengine: sdxi: handle hardware error logs
  dmaengine: sdxi: separate context and submission resources
  dmaengine: sdxi: support userspace context lifetimes
  dmaengine: sdxi: route context interrupts to eventfd
  dmaengine: sdxi: kill user contexts on fatal errors
  dmaengine: sdxi: define the ioctl UAPI surface
  dmaengine: sdxi: add internal ioctl definitions
  dmaengine: sdxi: register core character devices
  dmaengine: sdxi: implement fixed-size ioctl dispatch
  dmaengine: sdxi: implement userspace context file operations
  dmaengine: sdxi: validate and copy key ioctl payloads
  dmaengine: sdxi: implement RKey management ioctls
  dmaengine: sdxi: implement AKey management ioctls
  dmaengine: sdxi: expose operation-group discovery
  dmaengine: sdxi: implement typed vendor admin transport
  dmaengine: sdxi: expose character device attributes
  dmaengine: sdxi: add PF and VF device naming
  dmaengine: sdxi: add SDXI trace events
  dmaengine: sdxi: support suspend and resume
  dmaengine: sdxi: amd: define QoS request formats
  dmaengine: sdxi: amd: add QoS validation scaffolding
  dmaengine: sdxi: amd: build QoS admin descriptors
  dmaengine: sdxi: amd: prevalidate QoS operations
  dmaengine: sdxi: amd: execute QoS vendor operations
  dmaengine: sdxi: amd: register QoS vendor handler
  dmaengine: sdxi: amd: test QoS validation with KUnit
  selftests: sdxi: add build scaffold
  selftests: sdxi: add shared descriptor and context helpers
  selftests: sdxi: test context creation
  selftests: sdxi: test NOP descriptor submission
  selftests: sdxi: test copy submission and ring wrap
  selftests: sdxi: exercise dataplane error paths
  selftests: sdxi: test device ioctls
  selftests: sdxi: test vendor admin ioctls
  selftests: sdxi: test RKey ioctls
  MAINTAINERS: cover SDXI UAPI, vendor files, and selftests

 MAINTAINERS                                   |    3 +
 drivers/dma/sdxi/.kunitconfig                 |    1 +
 drivers/dma/sdxi/Kconfig                      |   25 +-
 drivers/dma/sdxi/Makefile                     |   13 +-
 drivers/dma/sdxi/admin.c                      |  290 ++++
 drivers/dma/sdxi/admin.h                      |   45 +
 drivers/dma/sdxi/amd/Makefile                 |    6 +
 drivers/dma/sdxi/amd/qos.c                    | 1135 ++++++++++++++
 drivers/dma/sdxi/amd/qos.h                    |   95 ++
 drivers/dma/sdxi/amd/qos_kunit.c              |  180 +++
 drivers/dma/sdxi/completion.c                 |   37 +-
 drivers/dma/sdxi/completion.h                 |    4 +
 drivers/dma/sdxi/context.c                    |  980 ++++++++++--
 drivers/dma/sdxi/context.h                    |   74 +-
 drivers/dma/sdxi/descriptor.c                 |   89 ++
 drivers/dma/sdxi/descriptor.h                 |   27 +
 drivers/dma/sdxi/descriptor_kunit.c           |  150 ++
 drivers/dma/sdxi/device.c                     |  423 +++++-
 drivers/dma/sdxi/dma.c                        |   22 +-
 drivers/dma/sdxi/error.c                      |  371 +++++
 drivers/dma/sdxi/error.h                      |   18 +
 drivers/dma/sdxi/hw.h                         |   80 +
 drivers/dma/sdxi/intr.c                       |  320 ++++
 drivers/dma/sdxi/intr.h                       |   21 +
 drivers/dma/sdxi/ioctl.c                      | 1331 +++++++++++++++++
 drivers/dma/sdxi/ioctl.h                      |   78 +
 drivers/dma/sdxi/keys.c                       |  577 +++++++
 drivers/dma/sdxi/keys.h                       |   29 +
 drivers/dma/sdxi/mmio.h                       |   27 +-
 drivers/dma/sdxi/pci.c                        |   91 +-
 drivers/dma/sdxi/process.c                    |  200 +++
 drivers/dma/sdxi/process.h                    |   43 +
 drivers/dma/sdxi/sdxi.h                       |   96 +-
 drivers/dma/sdxi/sysfs.c                      |   70 +
 drivers/dma/sdxi/sysfs.h                      |   13 +
 drivers/dma/sdxi/trace.c                      |    9 +
 drivers/dma/sdxi/trace.h                      |  137 ++
 drivers/dma/sdxi/vendor.c                     |  138 ++
 drivers/dma/sdxi/vendor.h                     |   42 +
 drivers/dma/sdxi/version.h                    |   32 +
 include/uapi/linux/sdxi.h                     |  569 +++++++
 tools/testing/selftests/Makefile              |    1 +
 tools/testing/selftests/sdxi/.gitignore       |    7 +
 tools/testing/selftests/sdxi/Makefile         |   35 +
 tools/testing/selftests/sdxi/admin_cmd.c      |  104 ++
 tools/testing/selftests/sdxi/config           |    2 +
 tools/testing/selftests/sdxi/context.c        |  343 +++++
 tools/testing/selftests/sdxi/copy.c           |   40 +
 tools/testing/selftests/sdxi/device.c         |  245 +++
 tools/testing/selftests/sdxi/error.c          |   24 +
 tools/testing/selftests/sdxi/lib/context.c    |  195 +++
 tools/testing/selftests/sdxi/lib/descriptor.h |   55 +
 .../selftests/sdxi/lib/fixture-context.h      |  126 ++
 .../selftests/sdxi/lib/fixture-device.h       |   44 +
 tools/testing/selftests/sdxi/lib/lib.c        |  206 +++
 tools/testing/selftests/sdxi/lib/lib.h        |   61 +
 tools/testing/selftests/sdxi/nop.c            |   30 +
 tools/testing/selftests/sdxi/rkey.c           |  413 +++++
 58 files changed, 9603 insertions(+), 219 deletions(-)
 create mode 100644 drivers/dma/sdxi/admin.c
 create mode 100644 drivers/dma/sdxi/admin.h
 create mode 100644 drivers/dma/sdxi/amd/Makefile
 create mode 100644 drivers/dma/sdxi/amd/qos.c
 create mode 100644 drivers/dma/sdxi/amd/qos.h
 create mode 100644 drivers/dma/sdxi/amd/qos_kunit.c
 create mode 100644 drivers/dma/sdxi/error.c
 create mode 100644 drivers/dma/sdxi/error.h
 create mode 100644 drivers/dma/sdxi/intr.c
 create mode 100644 drivers/dma/sdxi/intr.h
 create mode 100644 drivers/dma/sdxi/ioctl.c
 create mode 100644 drivers/dma/sdxi/ioctl.h
 create mode 100644 drivers/dma/sdxi/keys.c
 create mode 100644 drivers/dma/sdxi/keys.h
 create mode 100644 drivers/dma/sdxi/process.c
 create mode 100644 drivers/dma/sdxi/process.h
 create mode 100644 drivers/dma/sdxi/sysfs.c
 create mode 100644 drivers/dma/sdxi/sysfs.h
 create mode 100644 drivers/dma/sdxi/trace.c
 create mode 100644 drivers/dma/sdxi/trace.h
 create mode 100644 drivers/dma/sdxi/vendor.c
 create mode 100644 drivers/dma/sdxi/vendor.h
 create mode 100644 drivers/dma/sdxi/version.h
 create mode 100644 include/uapi/linux/sdxi.h
 create mode 100644 tools/testing/selftests/sdxi/.gitignore
 create mode 100644 tools/testing/selftests/sdxi/Makefile
 create mode 100644 tools/testing/selftests/sdxi/admin_cmd.c
 create mode 100644 tools/testing/selftests/sdxi/config
 create mode 100644 tools/testing/selftests/sdxi/context.c
 create mode 100644 tools/testing/selftests/sdxi/copy.c
 create mode 100644 tools/testing/selftests/sdxi/device.c
 create mode 100644 tools/testing/selftests/sdxi/error.c
 create mode 100644 tools/testing/selftests/sdxi/lib/context.c
 create mode 100644 tools/testing/selftests/sdxi/lib/descriptor.h
 create mode 100644 tools/testing/selftests/sdxi/lib/fixture-context.h
 create mode 100644 tools/testing/selftests/sdxi/lib/fixture-device.h
 create mode 100644 tools/testing/selftests/sdxi/lib/lib.c
 create mode 100644 tools/testing/selftests/sdxi/lib/lib.h
 create mode 100644 tools/testing/selftests/sdxi/nop.c
 create mode 100644 tools/testing/selftests/sdxi/rkey.c

-- 
2.56.1

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2026-11-19 20:34 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 20:22 [PATCH v1 00/44] dmaengine: sdxi: add userspace control and management support Wei Huang
2026-11-19 20:22 ` [PATCH v1 01/44] dmaengine: sdxi: cache hardware version for feature gating Wei Huang
2026-11-19 20:22 ` [PATCH v1 02/44] dmaengine: sdxi: define key and error MMIO registers Wei Huang
2026-11-19 20:22 ` [PATCH v1 03/44] dmaengine: sdxi: define SDXI hardware layouts Wei Huang
2026-11-19 20:22 ` [PATCH v1 04/44] dmaengine: sdxi: encode admin descriptors Wei Huang
2026-11-19 20:22 ` [PATCH v1 05/44] dmaengine: sdxi: support timeout-aware completion waits Wei Huang
2026-11-19 20:22 ` [PATCH v1 06/44] dmaengine: sdxi: support the full context table hierarchy Wei Huang
2026-11-19 20:22 ` [PATCH v1 07/44] dmaengine: sdxi: implement synchronous admin operations Wei Huang
2026-11-19 20:22 ` [PATCH v1 08/44] dmaengine: sdxi: add core RKey table management Wei Huang
2026-11-19 20:22 ` [PATCH v1 09/44] dmaengine: sdxi: handle hardware error logs Wei Huang
2026-11-19 20:22 ` [PATCH v1 10/44] dmaengine: sdxi: separate context and submission resources Wei Huang
2026-11-19 20:22 ` [PATCH v1 11/44] dmaengine: sdxi: support userspace context lifetimes Wei Huang
2026-11-19 20:22 ` [PATCH v1 12/44] dmaengine: sdxi: route context interrupts to eventfd Wei Huang
2026-11-19 20:22 ` [PATCH v1 13/44] dmaengine: sdxi: kill user contexts on fatal errors Wei Huang
2026-11-19 20:22 ` [PATCH v1 14/44] dmaengine: sdxi: define the ioctl UAPI surface Wei Huang
2026-11-19 20:22 ` [PATCH v1 15/44] dmaengine: sdxi: add internal ioctl definitions Wei Huang
2026-11-19 20:22 ` [PATCH v1 16/44] dmaengine: sdxi: register core character devices Wei Huang
2026-11-19 20:22 ` [PATCH v1 17/44] dmaengine: sdxi: implement fixed-size ioctl dispatch Wei Huang
2026-11-19 20:22 ` [PATCH v1 18/44] dmaengine: sdxi: implement userspace context file operations Wei Huang
2026-11-19 20:22 ` [PATCH v1 19/44] dmaengine: sdxi: validate and copy key ioctl payloads Wei Huang
2026-11-19 20:22 ` [PATCH v1 20/44] dmaengine: sdxi: implement RKey management ioctls Wei Huang
2026-11-19 20:22 ` [PATCH v1 21/44] dmaengine: sdxi: implement AKey " Wei Huang
2026-11-19 20:22 ` [PATCH v1 22/44] dmaengine: sdxi: expose operation-group discovery Wei Huang
2026-11-19 20:22 ` [PATCH v1 23/44] dmaengine: sdxi: implement typed vendor admin transport Wei Huang
2026-11-19 20:23 ` [PATCH v1 24/44] dmaengine: sdxi: expose character device attributes Wei Huang
2026-11-19 20:23 ` [PATCH v1 25/44] dmaengine: sdxi: add PF and VF device naming Wei Huang
2026-11-19 20:23 ` [PATCH v1 26/44] dmaengine: sdxi: add SDXI trace events Wei Huang
2026-11-19 20:23 ` [PATCH v1 27/44] dmaengine: sdxi: support suspend and resume Wei Huang
2026-11-19 20:23 ` [PATCH v1 28/44] dmaengine: sdxi: amd: define QoS request formats Wei Huang
2026-11-19 20:23 ` [PATCH v1 29/44] dmaengine: sdxi: amd: add QoS validation scaffolding Wei Huang
2026-11-19 20:23 ` [PATCH v1 30/44] dmaengine: sdxi: amd: build QoS admin descriptors Wei Huang
2026-11-19 20:23 ` [PATCH v1 31/44] dmaengine: sdxi: amd: prevalidate QoS operations Wei Huang
2026-11-19 20:23 ` [PATCH v1 32/44] dmaengine: sdxi: amd: execute QoS vendor operations Wei Huang
2026-11-19 20:23 ` [PATCH v1 33/44] dmaengine: sdxi: amd: register QoS vendor handler Wei Huang
2026-11-19 20:23 ` [PATCH v1 34/44] dmaengine: sdxi: amd: test QoS validation with KUnit Wei Huang
2026-11-19 20:23 ` [PATCH v1 35/44] selftests: sdxi: add build scaffold Wei Huang
2026-11-19 20:23 ` [PATCH v1 36/44] selftests: sdxi: add shared descriptor and context helpers Wei Huang
2026-11-19 20:23 ` [PATCH v1 37/44] selftests: sdxi: test context creation Wei Huang
2026-11-19 20:23 ` [PATCH v1 38/44] selftests: sdxi: test NOP descriptor submission Wei Huang
2026-11-19 20:23 ` [PATCH v1 39/44] selftests: sdxi: test copy submission and ring wrap Wei Huang
2026-11-19 20:23 ` [PATCH v1 40/44] selftests: sdxi: exercise dataplane error paths Wei Huang
2026-11-19 20:23 ` [PATCH v1 41/44] selftests: sdxi: test device ioctls Wei Huang
2026-11-19 20:23 ` [PATCH v1 42/44] selftests: sdxi: test vendor admin ioctls Wei Huang
2026-11-19 20:23 ` [PATCH v1 43/44] selftests: sdxi: test RKey ioctls Wei Huang
2026-11-19 20:23 ` [PATCH v1 44/44] MAINTAINERS: cover SDXI UAPI, vendor files, and selftests Wei Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®