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

Stanley Jhu posted 8 patches 1 month ago
Failed in applying to current master (apply log)
docs/system/devices/ufs.rst |   7 +-
hw/ufs/trace-events         |   2 +
hw/ufs/ufs-pci.c            |   7 +
hw/ufs/ufs-sysbus.c         |   7 +
hw/ufs/ufs.c                | 260 +++++++++-
hw/ufs/ufs.h                |  65 +++
tests/qtest/ufs-test.c      | 970 ++++++++++++++++++++++++++++++++++++
7 files changed, 1314 insertions(+), 4 deletions(-)
[PATCH v3 0/8] hw/ufs: Add fault injection, update TMR doc, and add qtests
Posted by Stanley Jhu 1 month 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 v2:
- On QUERY TASK in in-transition mode, execute the held request through
  the normal path and return real task status instead of completing with
  synthetic success.
- Map x-fault-inject-mode to an enum property with QEnumLookup
  validation and reject values greater than 255 in x-fault-inject-tag.
- Match 16-byte SCSI read and write commands in fault injection and
  update trace events to 64-bit LBA.
- Verify reset queue tail pointers in HCE reset and add doorbell fault
  injection test coverage for legacy UFS mode.

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

Tested with qos-test on aarch64 (all 29 UFS test 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         |   2 +
 hw/ufs/ufs-pci.c            |   7 +
 hw/ufs/ufs-sysbus.c         |   7 +
 hw/ufs/ufs.c                | 260 +++++++++-
 hw/ufs/ufs.h                |  65 +++
 tests/qtest/ufs-test.c      | 970 ++++++++++++++++++++++++++++++++++++
 7 files changed, 1314 insertions(+), 4 deletions(-)

-- 
2.56.0.307.g5fe7bd680c-goog
Re: [PATCH v3 0/8] hw/ufs: Add fault injection, update TMR doc, and add qtests
Posted by Jeuk Kim 3 weeks, 6 days ago
On Fri, 23 Oct 2026 19:38:22 +0800, Stanley Jhu <stanleyjhu@google.com> wrote:
> hw/ufs: Add fault injection, update TMR doc, and add qtests
> 
> 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.
> 
> [...]

Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>

-- 
Jeuk Kim <jeuk20.kim@samsung.com>