container-imx: enable the Microsoft fTPM TA on i.MX8MP - #5
Closed
mmxsrup wants to merge 2 commits into
Closed
Conversation
Make the meta-arm optee-ftpm recipe (ms-tpm-20-ref as an OP-TEE early TA) usable on imx8mpevk. meta-arm gates COMPATIBLE_MACHINE to QEMU/genericarm64, so a bbappend allows imx8mpevk and builds the TA as AArch64; a linux-imx bbappend enables the tpm_ftpm_tee driver as a module (CONFIG_TCG_FTPM_TEE=m — the fTPM persists its state through tee-supplicant, so the driver must probe after the supplicant is up). Opt in via MACHINE_FEATURES "optee-ftpm" plus the optee-ftpm, tpm2-tools and kernel-module-tpm-ftpm-tee packages; default builds are unchanged. Documented in docs/ftpm-imx8mp.md (EN/JA), including the REE-FS state storage caveat (no RPMB, no rollback protection) and that nothing measures into the PCRs during boot on this platform.
The linux-imx bbappend applied CONFIG_TCG_FTPM_TEE=m unconditionally, so builds without the optee-ftpm machine feature also got the config change — and since imx_v8_defconfig has CONFIG_IKCONFIG=y, that makes even a feature-off kernel Image byte-different, which matters for a repo whose whole point is signing and measuring boot artifacts. Add the fragment to SRC_URI only when MACHINE_FEATURES contains optee-ftpm and make the do_configure step a no-op when the fragment is absent. (The appended task code itself still alters the do_configure signature once, but the resulting kernel is unchanged.) Also fix two doc inaccuracies: CFG_CORE_HEAP_SIZE=131072 from meta-arm is not a raise on i.MX (the NXP tree already defaults i.MX platforms to 128 KiB; the raise only applies vs OP-TEE's generic 64 KiB), and state explicitly where local.conf lives and that re-running "yocto.sh full" performs the documented rebuild sequence.
Collaborator
Author
|
実機テスト前かつ本 PR シリーズ(性能計測)とは独立した内容のため、いったんクローズします。ボードでの動作確認後に改めて PR を出します。ブランチ pr/ftpm-enable は残してあります。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables the Microsoft firmware TPM (
ms-tpm-20-ref, OP-TEE early TA) on the i.MX8MP EVK image.What
optee-ftpm_%.bbappend: allowimx8mpevkinCOMPATIBLE_MACHINE(meta-arm gates the recipe to QEMU/genericarm64) and build the TA as AArch64.linux-imx_%.bbappend+ftpm.cfg: enableCONFIG_TCG_FTPM_TEE=m, gated on theoptee-ftpmmachine feature. The driver is a module on purpose — the fTPM persists state throughtee-supplicant, so it must probe after the supplicant is running.docs/ftpm-imx8mp.md/-j.md: build/enable/verify instructions and caveats.How to enable
Without the machine feature, nothing changes: neither the OP-TEE binary (meta-arm's early-TA hook is feature-gated) nor the kernel config (the fragment is only added to
SRC_URIwhen the feature is set — this matters becauseCONFIG_IKCONFIG=yembeds the config in the kernelImage, so an ungated fragment would make even default kernels byte-different).Verification
tee.elf,tpm_ftpm_tee.kopresent in the rootfs, HAB signing flow unchanged.modprobe tpm_ftpm_tee→/dev/tpm0→tpm2_getcap properties-fixed/tpm2_pcrread, plus an RA regression run. Results will be posted here.Caveats
Stacked on #4 (branched from
pr/perf-logging).