mbox series

[v2,-qemu,0/5] cxl: Background commands and device Sanitation

Message ID 20230418172337.19207-1-dave@stgolabs.net
Headers show
Series cxl: Background commands and device Sanitation | expand

Message

Davidlohr Bueso April 18, 2023, 5:23 p.m. UTC
Hi,

This adds support for device Sanitation, per CXL 3.0 specs. While device
sanitation makes little sense for virtual machines, I am posting this
series as it was used to test the driver equivalent in a sane manner and
might come in handy for others.

Furthermore this adds core functionality requirements for the actual command,
the background mailbox handling (first two patches) will be needed anyway
for other bg-capable commands when introduced (we already have a
cmd_infostat_bg_op_sts(), which while updated, it is untested).

Changes from v1 (https://lore.kernel.org/all/20230224194443.1990440-1-dave@stgolabs.net/):

o Patch 1: added missing timer_free() in ct3_exit.
  	   removed define SECURITY_STATE_CHANGE (unused).
	   simplified some of the register handling in cxl_process_mailbox().
	   removed superfluous qemu_log() debugging splats.

o Patch 2: increased msi_n + use PCI_DEV().

o Patch 3 is new, which makes the Media Disabled handling separate from
  the implementation of the Sanitation functionality. This also considers
  arm64 and uses little endian reads and writes (the mbox processing updates
  could follow this series).

o Patch 4: s/overwrite/sanitize.
  	   __do_sanitization() rely on cmd effect (cel) for knowing bg effect.
	   __do_sanitization() uses address_space destroy+init.
	   remove sanitize_running() altogether, instead rely on media state.
	   remove superfluous references to scan media.

o Patch 5 is a new cleanup patch.

Applies on top of branch 'cxl-2023-02-21' of Jonathan's tree:
	https://gitlab.com/jic23/qemu/-/tree/cxl-2023-02-21

Davidlohr Bueso (5):
  cxl/mbox: Add support for background operations
  cxl/mbox: Wire up interrupts for background completion
  cxl/device: Handle Media Disabled state
  hw/cxl: Add support for device sanitation
  cxl/type3: Remove superfluous statements

 hw/cxl/cxl-device-utils.c   |  13 +-
 hw/cxl/cxl-mailbox-utils.c  | 244 +++++++++++++++++++++++++++++++++++-
 hw/mem/cxl_type3.c          |  18 ++-
 include/hw/cxl/cxl_device.h |  44 +++++++
 4 files changed, 309 insertions(+), 10 deletions(-)

--
2.40.0