From patchwork Mon Jul 8 23:53:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 811380 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 519E93A27B; Mon, 8 Jul 2024 23:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720482935; cv=none; b=t/pJCzA3xj/eeqkzwjwEjrhmSS2JyrFa8R2RtvuhkykJVl2GDj7UhbULot+OnG1gT0xEbcbg18mYCM1Pd6JiwKBtjkNFCN/4nCCJ6qzKSDDPwJQ7mslHNxf8C1PaO/pTez4d4g2sY+Sl/4B2nXlN0fulSUvJWmQal1XM3gWszg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720482935; c=relaxed/simple; bh=4eLoOGMlNiXI0uXZXhcDQoeJVinC1toydpbMDt2g5A8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RadQ7Ljln+mDUrhKYMwX3GnrSlejhY4DFk88/aXe+qBu6DrytZgb89epsJV9VFl5hHz+ec4dwvp2MSx4SVDzZhOwbZY7fetbuaEtTfUuQAtPH3OIrAg29FOgFFpETd4+7ih5ZfGX7pTdPL8wrTFAkOy2VISLqkl91zei966jBFw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZIvLZBh9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZIvLZBh9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89748C116B1; Mon, 8 Jul 2024 23:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720482934; bh=4eLoOGMlNiXI0uXZXhcDQoeJVinC1toydpbMDt2g5A8=; h=From:To:Cc:Subject:Date:From; b=ZIvLZBh9EXLn6HB4NsuIujz2PJKxK9O5n9Qgn9Zjk/weaqkhzkMV+ASk804pdbhaT UrqgpuXHh1JSiK5euxrh/r/Vvme0Uka9CBq2le1ngfIo03Phpnym15gFVCUkaRVhok qgdGIrPg+5eOaxsswZp7HhTztpPytowzRf5zJVtW+RsJ66pLbWpCCaOBqewPMKlR2g T9UyZ0QOqUFOjMqKjA310NAVkU/kP9xYMB6MgmvCVgdYprvotGlN58ZqiIgsCq1N+w JCs6ye/CcPNQUDTZCyNAi3rip9t/nvjjdj+XuA45fSKSiM1o3Of8Ig4sUG7GBpSscI v2jwTno2fc+tQ== From: Eric Biggers To: linux-scsi@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-fscrypt@vger.kernel.org, Alim Akhtar , Avri Altman , Bart Van Assche , "Martin K . Petersen" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , William McVicker Subject: [PATCH v3 0/6] Basic inline encryption support for ufs-exynos Date: Mon, 8 Jul 2024 16:53:24 -0700 Message-ID: <20240708235330.103590-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for Flash Memory Protector (FMP), which is the inline encryption hardware on Exynos and Exynos-based SoCs. Specifically, add support for the "traditional FMP mode" that works on many Exynos-based SoCs including gs101. This is the mode that uses "software keys" and is compatible with the upstream kernel's existing inline encryption framework in the block and filesystem layers. I plan to add support for the wrapped key support on gs101 at a later time. Tested on gs101 (specifically Pixel 6) by running the 'encrypt' group of xfstests on a filesystem mounted with the 'inlinecrypt' mount option. This patchset applies to v6.10-rc6, and it has no prerequisites that aren't already upstream. Changed in v3: - Made the FMP support depend on EXYNOS_UFS_OPT_UFSPR_SECURE, since the !EXYNOS_UFS_OPT_UFSPR_SECURE case has not yet been tested - Replaced LOG2_DATA_UNIT_SIZE with ilog2(DATA_UNIT_SIZE) - Added Reviewed-by tags Changed in v2: - Added DATA_UNIT_SIZE macro - Changed a comment into kerneldoc - Used ARM_SMCCC_CALL_VAL() to define SMC codes - Used arm_smccc_smc() directly instead of via a wrapper function Eric Biggers (6): scsi: ufs: core: Add UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE scsi: ufs: core: fold ufshcd_clear_keyslot() into its caller scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_CRYPTO_ENABLE scsi: ufs: core: Add fill_crypto_prdt variant op scsi: ufs: core: Add UFSHCD_QUIRK_KEYS_IN_PRDT scsi: ufs: exynos: Add support for Flash Memory Protector (FMP) drivers/ufs/core/ufshcd-crypto.c | 34 +++-- drivers/ufs/core/ufshcd-crypto.h | 36 +++++ drivers/ufs/core/ufshcd.c | 3 +- drivers/ufs/host/ufs-exynos.c | 240 ++++++++++++++++++++++++++++++- include/ufs/ufshcd.h | 28 ++++ 5 files changed, 320 insertions(+), 21 deletions(-) base-commit: 22a40d14b572deb80c0648557f4bd502d7e83826