[PATCH v2 0/8] hw/ufs: Add fault injection, update TMR doc, and add qtests

Stanley Jhu posted 8 patches 11 hours ago
docs/system/devices/ufs.rst |   7 +-
hw/ufs/trace-events         |   3 +
hw/ufs/ufs-pci.c            |   6 +
hw/ufs/ufs-sysbus.c         |   6 +
hw/ufs/ufs.c                | 341 +++++++++++++++++++-
hw/ufs/ufs.h                |  62 ++++
tests/qtest/ufs-test.c      | 618 ++++++++++++++++++++++++++++++++++++
7 files changed, 1039 insertions(+), 4 deletions(-)
[PATCH v2 0/8] hw/ufs: Add fault injection, update TMR doc, and add qtests
Posted by Stanley Jhu 11 hours ago
This series adds experimental fault injection to the UFS device model
so host drivers can exercise task abort and power management recovery,
updates the task management description in the UFS docs, and adds
qtest cases for controller reset, MCQ runtime registers, task
management and fault-injected task abort.

The series applies on top of Daejun Park's Zoned UFS v3 series.

- Patches 1-2: x-fault-inject-tag and x-fault-inject-mode properties
  to hold a transfer request, and task management handling for the
  held request.
- Patch 3: ssu-timeout mode for power management recovery testing.
- Patch 4: document the supported task management functions (QUERY
  TASK and ABORT TASK).
- Patches 5-8: qtest helpers and test cases.

The fault injection properties are experimental (x- prefix) and off
by default.

Differences from v1:
- Rebased on top of Daejun Park's Zoned UFS v3 series.
- Clarified in patch 2 that in-transition mode completes without
  executing the SCSI command or transferring data.

v1: https://lore.kernel.org/qemu-devel/20261015060827.341298-1-stanleyjhu@google.com/

Tested with qos-test on aarch64 (all 28 UFS cases pass, including 10
zoned UFS cases).

Based-on: <20261020001647epcms2p52cd58173164a43e252c33a3eb5935dc8@epcms2p5>

Stanley Jhu (8):
  hw/ufs: Add experimental fault injection properties for holding
    requests
  hw/ufs: Handle task management requests for fault-injected held
    requests
  hw/ufs: Add ssu-timeout mode for power management recovery testing
  docs/system/ufs: Update task management request support status
  tests/qtest/ufs-test: Add TMR and async MCQ SCSI submission helpers
  tests/qtest/ufs-test: Add HCE reset unit test
  tests/qtest/ufs-test: Add MCQ runtime register and TMR handling test
  tests/qtest/ufs-test: Add QOM fault injection task abort test

 docs/system/devices/ufs.rst |   7 +-
 hw/ufs/trace-events         |   3 +
 hw/ufs/ufs-pci.c            |   6 +
 hw/ufs/ufs-sysbus.c         |   6 +
 hw/ufs/ufs.c                | 341 +++++++++++++++++++-
 hw/ufs/ufs.h                |  62 ++++
 tests/qtest/ufs-test.c      | 618 ++++++++++++++++++++++++++++++++++++
 7 files changed, 1039 insertions(+), 4 deletions(-)

-- 
2.56.0.218.g1ec904b173-goog