Hi,

This series adds emulation of the UFS Host Initiated Defragmentation
(HID) extended feature, plus a qtest covering its host-visible
interface.

HID lets the host trigger and control device-side defragmentation
through five attributes (IDN 0x35-0x39):

  bDefragOperation   trigger: Disable / Analysis / Defrag
  dHIDAvailableSize  fragmented 4KB units (published by analysis)
  dHIDSize           host-requested defrag target (4KB units)
  bHIDProgressRatio  0-100%; reading 100 resets HID
  bHIDState          current state; terminal-state read resets HID

Each successful user-data SCSI WRITE increments an internal fragment
counter, which analysis publishes via `dHIDAvailableSize`. The state
machine is driven from `ufs_process_idle()` and only advances while
the device is idle. Support is advertised via
`dExtendedUFSFeaturesSupport` bit 13.

Thanks,
Keoseong

Keoseong Park (2):
  hw/ufs: Add Host Initiated Defragmentation (HID) support
  tests/qtest: Add UFS HID qtest

 hw/ufs/lu.c            |  16 ++-
 hw/ufs/trace-events    |   4 +
 hw/ufs/ufs.c           | 155 +++++++++++++++++++++-
 hw/ufs/ufs.h           |   4 +
 include/block/ufs.h    |  18 +++
 tests/qtest/ufs-test.c | 290 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 480 insertions(+), 7 deletions(-)

-- 
2.25.1


Reply via email to