[PATCH 0/2] hw/ufs: Add Host Initiated Defragmentation (HID) support

Keoseong Park posted 2 patches 19 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260609023909epcms2p3f8856f12fed093168aff636f8dc8f994@epcms2p3
Maintainers: Jeuk Kim <jeuk20.kim@samsung.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
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(-)
[PATCH 0/2] hw/ufs: Add Host Initiated Defragmentation (HID) support
Posted by Keoseong Park 19 hours ago
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