[PATCH v4 0/3] scsi: ufs: Add crypto_keyslot_remap support

zheng.gong posted 3 patches 1 week, 3 days ago
.../bindings/ufs/samsung,exynos-ufs.yaml         |  5 +++++
drivers/ufs/core/ufshcd-crypto.h                 | 10 ++++++++--
drivers/ufs/core/ufshcd.c                        |  9 +++++----
drivers/ufs/host/ufs-exynos.c                    | 16 ++++++++++++++++
include/ufs/ufshcd.h                             |  6 ++++++
5 files changed, 40 insertions(+), 6 deletions(-)
[PATCH v4 0/3] scsi: ufs: Add crypto_keyslot_remap support
Posted by zheng.gong 1 week, 3 days ago
Hello Eric,

Sorry for late due to other affairs.

Readjuest the patchset adds support for platform-specific crypto keyslot
remapping in the exynos UFS host driver.

The 1st patch raise a new variant op:
  ufs_hba_variant_ops::crypto_keyslot_remap
which allows platforms to adjust the keyslot index at io request period.

The 2nd patch adds a real, upstream user in ufs-exynos.c that supports
remapping via device tree. This makes the hook justifiable for mainline
inclusion.

The 3rd patch adds DT binding description for the new property
'ufs-keyslot-offset'.

zheng.gong (3):
  scsi: ufs: crypto: Add ufs_hba_variant_ops::crypto_keyslot_remap
  scsi: ufs: exynos: Support crypto keyslot remapping via DT
  dt-bindings: ufs: Add binding for ufs-keyslot-offset

 .../bindings/ufs/samsung,exynos-ufs.yaml         |  5 +++++
 drivers/ufs/core/ufshcd-crypto.h                 | 10 ++++++++--
 drivers/ufs/core/ufshcd.c                        |  9 +++++----
 drivers/ufs/host/ufs-exynos.c                    | 16 ++++++++++++++++
 include/ufs/ufshcd.h                             |  6 ++++++
 5 files changed, 40 insertions(+), 6 deletions(-)

-- 
2.50.1
Re: [PATCH v4 0/3] scsi: ufs: Add crypto_keyslot_remap support
Posted by Eric Biggers 1 week, 3 days ago
On Thu, Jan 29, 2026 at 11:10:30AM +0800, zheng.gong wrote:
> Hello Eric,
> 
> Sorry for late due to other affairs.
> 
> Readjuest the patchset adds support for platform-specific crypto keyslot
> remapping in the exynos UFS host driver.
> 
> The 1st patch raise a new variant op:
>   ufs_hba_variant_ops::crypto_keyslot_remap
> which allows platforms to adjust the keyslot index at io request period.
> 
> The 2nd patch adds a real, upstream user in ufs-exynos.c that supports
> remapping via device tree. This makes the hook justifiable for mainline
> inclusion.
> 
> The 3rd patch adds DT binding description for the new property
> 'ufs-keyslot-offset'.

I don't think it's plausible that this actually works, considering that
ufs-exynos.c installs a custom blk_crypto_profile that doesn't have any
keyslots.  (It does that because the Exynos UFS host controller takes
the raw key directly in the PRDT on a per-block basis.)  With no
keyslots, the concept of remapping them is meaningless.

Could you clarify what exactly this patchset is meant to do, and how you
tested it?

Do you perhaps have additional patches that this depends on?  Perhaps
patches that add support for a version of the Exynos UFS host controller
that does have keyslots?

- Eric