]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: soc: qcom: ice: Add HWKM support to the ICE driver
authorGaurav Kashyap <quic_gaurkash@quicinc.com>
Fri, 4 Apr 2025 23:15:31 +0000 (16:15 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 12 Apr 2025 01:10:30 +0000 (21:10 -0400)
commit7cc6e0c34b21b6e981afde695132f38e174c7aa5
treebce1f4ffdcde51a486fa62dcb6a1031edbb2ad57
parent11d4c388a38ab6e95a7be82a44a55ecc32cd6a14
scsi: soc: qcom: ice: Add HWKM support to the ICE driver

Qualcomm's Inline Crypto Engine (ICE) version 3.2 and later includes a
key management hardware block called the Hardware Key Manager (HWKM).
Add support for HWKM to the ICE driver.  HWKM provides hardware-wrapped
key support where the ICE (storage) keys are not exposed to software and
instead are protected in hardware.  Later patches will wire up this
feature to ufs-qcom and sdhci-msm using the support added in this patch.

HWKM and legacy mode are currently mutually exclusive.  The selection of
which mode to use has to be made before the storage driver(s) registers
any inline encryption capable disk(s) with the block layer (i.e.,
generally at boot time) so that the appropriate crypto capabilities can
be advertised to upper layers.  Therefore, make the ICE driver select
HWKM mode when the all of the following are true:

 - The new module parameter qcom_ice.use_wrapped_keys=1 is specified.

 - HWKM is present and is at least v2, i.e. ICE is v3.2.1 or later.

 - The SCM calls needed to fully use HWKM are supported by TrustZone.

[EB: merged related patches; fixed the module parameter to work
     correctly; dropped unnecessary support for HWKM v1; fixed error
     handling; improved log messages, comments, and commit message;
     fixed naming; merged enable and init functions; and other cleanups]

Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Co-developed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20250404231533.174419-3-ebiggers@kernel.org
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/mmc/host/sdhci-msm.c
drivers/soc/qcom/ice.c
drivers/ufs/host/ufs-qcom.c
include/soc/qcom/ice.h