Emulated TPM2 support requires OVMF support, from commit d20ae95a13e851d56c6618108b18c93526505ca2 and earlier.
That commit is part of the edk2 tag "edk2-stable201903", which RHEL-8.1 targets (https://bugzilla.redhat.com/show_bug.cgi?id=1687731)
however, we'd need to modify the build flags in the SPEC file (and the
ad-hoc testing instructions in the README), to specify TPM2_ENABLE. (And
maybe TPM2_CONFIG_ENABLE too, but I'd strongly prefer if we left out
TPM2_CONFIG_ENABLE -- I think we can promise supporting TPM2_ENABLE, but
TPM2_CONFIG_ENABLE is totally immature for that.)
Once an official Brew build is available for prerequisite bug 1687731, I'll prepare a scratch build (with the build flag changes that are necessary), for Marc-André to check. I'll set devel_ack+ when he confirms the build is OK.
FuXiangChun, this BZ should be sanity checked both with and without an
swtpm configured. Regarding the former case, I defer to Marc-André. In
the latter case (no swtpm), the following two changes in behavior are
- the boot might take slightly longer
- in the OVMF debug log, you should see messages like:
> Tcg2ConfigPeimEntryPoint: no TPM2 detected
> No TPM2 instance required!
> DxeTpm2MeasureBootHandler - Tcg2 - Not Found
> WARNING: Tpm2RegisterTpm2DeviceLib - does not support
> 286BF25A-C2C3-408C-B3B4-25E6758B7317 registration
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.