Skip to content

cxl: Userspace background commands

Davidlohr Bueso linux-cxl 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest10 patches 0 repliesNew

Changes in v2 from the cover letter

o Dropped handling Activate FW asynchronously. Nothing bounds how long an activation may take, so there is no good answer to how long the firmware upload should wait for its result. Deferred until the spec has the device report it. Patch 4 is what is left of that patch, the decoupling from security, and Jonathan's tag is dropped as such.
o New fixes in patches 1 and 2, and new patch 7.
o Fixed the cxl_test build. (Unsung)
o Converted to scoped_guard() and clarified comments. (Jonathan)
o Rebased on v7.4-rc5.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10cxl/pci: Reschedule the poller with the capped timeoutdrivers/cxl/pci.c+2 -20 replies
2/10cxl/pci: Preserve Mailbox Control bits when ringing the doorbelldrivers/cxl/pci.c+3 -10 replies
3/10cxl/mbox: Track background commands from CELdrivers/cxl/core/mbox.c drivers/cxl/cxlmem.h+58 -00 replies
4/10cxl/mbox: Decouple async background handling from securitydrivers/cxl/core/hdm.c drivers/cxl/core/memdev.c drivers/cxl/cxlmem.h +2 more+57 -380 replies
5/10cxl/pci: Lockless background synchronous pollingdrivers/cxl/core/mbox.c drivers/cxl/pci.c include/cxl/mailbox.h+90 -490 replies
6/10cxl/mbox: Stronger cxl_mbox_background_complete() semanticsdrivers/cxl/pci.c+8 -80 replies
7/10cxl/mbox: Add missing mailbox return codesdrivers/cxl/cxlmem.h+7 -10 replies
8/10cxl/mbox: Allow userspace background commandsdrivers/cxl/core/mbox.c drivers/cxl/cxlmem.h drivers/cxl/pci.c +1 more+117 -240 replies
9/10cxl/mbox: Shout upon async bgcmd racedrivers/cxl/pci.c+1 -10 replies
10/10cxl/mbox: Add Populate Log supportdrivers/cxl/core/mbox.c drivers/cxl/cxlmem.h drivers/cxl/pci.c +1 more+9 -00 replies

Reviews trailers per patch

2 of 10 patches have a Reviewed-by or Acked-by.

PatchJonathan Cameron
1/10
2/10
3/10
4/10
5/10
6/10R-b
7/10
8/10
9/10
10/10R-b

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

Read the v2 thread

Cover letter [PATCH v2 00/10] cxl: Userspace background commands

Hi,

Changes from v1:
o Dropped handling Activate FW asynchronously. Nothing bounds how long an activation may take, so there is no good answer to how long the firmware upload should wait for its result. Deferred until the spec has the device report it. Patch 4 is what is left of that patch, the decoupling from security, and Jonathan's tag is dropped as such.
o New fixes in patches 1 and 2, and new patch 7.
o Fixed the cxl_test build. (Unsung)
o Converted to scoped_guard() and clarified comments. (Jonathan)
o Rebased on v7.4-rc5.

This is v2 of the mailbox background command series[1]. It lets userspace make use of the background operation capability, with the kernel aborting such an operation whenever it needs the device for one of its own, and adds Populate Log as the first command to use it.

v1 has been sitting since June of last year. Unsung's work on online firmware activation[2] ran into the same background handling, and the discussion there is what brought this back.

o Patches 1-2 are fixes to the existing background handling, and can go in on their own.
o Patch 3 tracks which commands the CEL has as background capable.
o Patch 4 moves the async handling out of the security state.
o Patches 5-6 no longer hold the mbox_mutex while polling for a background command the kernel waits for.
o Patch 7 adds the return codes an abort request can come back with.
o Patches 8-9 allow userspace background commands.
o Patch 10 adds Populate Log.

Testing was done with cxl_test and the ndctl suite, and with the qemu based tests at [3], which also carry the qemu fixes they rely on.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://github.com/davidlohr/cxl-bg-tests

Thanks!

Davidlohr Bueso (9):
cxl/pci: Reschedule the poller with the capped timeout cxl/pci: Preserve Mailbox Control bits when ringing the doorbell cxl/mbox: Track background commands from CEL cxl/mbox: Decouple async background handling from security cxl/pci: Lockless background synchronous polling cxl/mbox: Stronger cxl_mbox_background_complete() semantics cxl/mbox: Add missing mailbox return codes
cxl/mbox: Allow userspace background commands cxl/mbox: Shout upon async bgcmd race

Ravi Shankar (1):
cxl/mbox: Add Populate Log support

 drivers/cxl/core/hdm.c       |   2 +-
 drivers/cxl/core/mbox.c      |  45 ++++-
 drivers/cxl/core/memdev.c    |   7 +-
 drivers/cxl/cxlmem.h         |  53 +++++-
 drivers/cxl/pci.c            | 318 +++++++++++++++++++++++++----------
 include/cxl/mailbox.h        |   4 +
 include/uapi/linux/cxl_mem.h |   1 +
 tools/testing/cxl/test/mem.c |  10 +-
 8 files changed, 334 insertions(+), 106 deletions(-)

base-commit: 693c2e04e3f1d4c59af236e1211b7b8cb165a790

Signature · 1 line
2.39.5