Skip to content

hw/ufs: Add RPMB well-known logical unit emulation

Stanley Jhu qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7include/scsi, block/ufs: Add security protocol and RPMB definitionsinclude/block/ufs.h include/scsi/constants.h+57 -30 replies
2/7hw/ufs: Add RPMB unit descriptor and SECURITY PROTOCOL IN/OUT dispatchhw/ufs/lu.c hw/ufs/meson.build hw/ufs/rpmb.c +3 more+250 -40 replies
3/7tests/qtest/ufs-test: Add RPMB descriptor and CDB validation testtests/qtest/ufs-test.c+285 -00 replies
4/7hw/ufs: Add RPMB key programming and write counter read handlinghw/ufs/rpmb.c+63 -00 replies
5/7tests/qtest/ufs-test: Add RPMB key programming and write counter testtests/qtest/ufs-test.c+105 -00 replies
6/7hw/ufs: Add RPMB authenticated data write and read handlingdocs/system/devices/ufs.rst hw/ufs/rpmb.c hw/ufs/ufs.c+223 -20 replies
7/7tests/qtest/ufs-test: Add RPMB authenticated data read and write testtests/qtest/ufs-test.c+569 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] hw/ufs: Add RPMB well-known logical unit emulation

This series implements RPMB (Replay Protected Memory Block) well-known logical unit emulation (W-LUN 0xc4) for QEMU UFS per JESD220H Section 12.4.

Summary of Changes:
- Patch 1: Add SCSI security protocol opcodes and RPMB definitions.
- Patch 2: Set bSecurityLU to 0x01, enable RPMB unit descriptor, wire SECURITY PROTOCOL IN/OUT CDB and PRDT buffer capacity validation via ufs_fit_data_buffer(), add Result Register read handling in hw/ufs/rpmb.c, and clear volatile RPMB state in ufs_hce_reset().
- Patch 3: Add qtest case for DeviceDescriptor bSecurityLU, RPMB unit descriptor, CDB, W-LUN dispatch, and PRDT validation.
- Patch 4: Add HMAC-SHA256 key programming and write counter read handling.
- Patch 5: Add qtest case for key programming and write counter reads.
- Patch 6: Add single- and multi-frame authenticated data write and read handling and update docs/system/devices/ufs.rst.
- Patch 7: Add qtest case for authenticated data writes, reads, check ordering, general-failure paths, multi-region isolation, and HCE reset state handling.

Outside hw/ufs and tests, the series only adds the SECURITY PROTOCOL IN/OUT opcodes to include/scsi/constants.h and RPMB definitions to the UFS-only include/block/ufs.h. There is no change to block layer or SCSI core code.

Tested: QEMU ARM64/x86_64 qos-test and Linux guest SDB/MCQ RPMB, pass.

Based-on: <[email protected]>

Stanley Jhu (7):
include/scsi, block/ufs: Add security protocol and RPMB definitions hw/ufs: Add RPMB unit descriptor and SECURITY PROTOCOL IN/OUT dispatch tests/qtest/ufs-test: Add RPMB descriptor and CDB validation test hw/ufs: Add RPMB key programming and write counter read handling tests/qtest/ufs-test: Add RPMB key programming and write counter test hw/ufs: Add RPMB authenticated data write and read handling tests/qtest/ufs-test: Add RPMB authenticated data read and write test

 docs/system/devices/ufs.rst |   6 +-
 hw/ufs/lu.c                 |  34 ++
 hw/ufs/meson.build          |   2 +-
 hw/ufs/rpmb.c               | 447 +++++++++++++++++
 hw/ufs/trace-events         |   3 +
 hw/ufs/ufs.c                |  26 +-
 hw/ufs/ufs.h                |  24 +
 include/block/ufs.h         |  58 ++-
 include/scsi/constants.h    |   2 +
 tests/qtest/ufs-test.c      | 959 ++++++++++++++++++++++++++++++++++++
 10 files changed, 1552 insertions(+), 9 deletions(-)
 create mode 100644 hw/ufs/rpmb.c
Signature · 1 line
2.56.0.307.g5fe7bd680c-goog