]> www.infradead.org Git - users/jedix/linux-maple.git/commit
firmware: qcom: scm: add calls for wrapped key support
authorGaurav Kashyap <quic_gaurkash@quicinc.com>
Fri, 13 Dec 2024 04:19:51 +0000 (20:19 -0800)
committerBjorn Andersson <andersson@kernel.org>
Wed, 8 Jan 2025 23:11:07 +0000 (17:11 -0600)
commit1d45a1cd9f3ae849db868e07e5fee5e5b37eff55
treecbde7aec8404ccaad02aa1842c64419b42a8a54d
parent8e6854efd4738d3c9e6fdfeff8df726d454d4c7d
firmware: qcom: scm: add calls for wrapped key support

Add helper functions for the SCM calls required to support
hardware-wrapped inline storage encryption keys.  These SCM calls manage
wrapped keys via Qualcomm's Hardware Key Manager (HWKM), which can only
be accessed from TrustZone.

QCOM_SCM_ES_GENERATE_ICE_KEY and QCOM_SCM_ES_IMPORT_ICE_KEY create a new
long-term wrapped key, with the former making the hardware generate the
key and the latter importing a raw key.  QCOM_SCM_ES_PREPARE_ICE_KEY
converts the key to ephemerally-wrapped form so that it can be used for
inline storage encryption.  These are planned to be wired up to new
ioctls via the blk-crypto framework; see the proposed documentation for
the hardware-wrapped keys feature for more information.

Similarly there's also QCOM_SCM_ES_DERIVE_SW_SECRET which derives a
"software secret" from an ephemerally-wrapped key and will be wired up
to the corresponding operation in the blk_crypto_profile.

These will all be used by the ICE driver in drivers/soc/qcom/ice.c.

[EB: merged related patches, fixed error handling, fixed naming, fixed
     docs for size parameters, fixed qcom_scm_has_wrapped_key_support(),
     improved comments, improved commit message.]

Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20241213041958.202565-9-ebiggers@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/firmware/qcom/qcom_scm.c
drivers/firmware/qcom/qcom_scm.h
include/linux/firmware/qcom/qcom_scm.h