qemu: Default to TPM 2.0 for ARM virt guests

The TPM 2.0 specification predates ARM virtualization, and so
implementing TPM 1.2 support on ARM was not considered a useful
endeavor.

This is technically a breaking change, but TPM support on ARM was
only introduced fairly recently (libvirt 7.1.0) and the previous
default resulted in non working TPM devices; anyone who has a
working configuration is not going to be affected.

https://bugzilla.redhat.com/show_bug.cgi?id=1970310

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2021-06-25 15:57:38 +02:00
parent 7ad6f8dde0
commit 7ace0fd221

View File

@ -4445,7 +4445,8 @@ qemuDomainDefTPMsPostParse(virDomainDef *def)
/* TPM 1.2 and 2 are not compatible, so we choose a specific version here */
if (tpm->version == VIR_DOMAIN_TPM_VERSION_DEFAULT) {
if (tpm->model == VIR_DOMAIN_TPM_MODEL_SPAPR ||
tpm->model == VIR_DOMAIN_TPM_MODEL_CRB)
tpm->model == VIR_DOMAIN_TPM_MODEL_CRB ||
qemuDomainIsARMVirt(def))
tpm->version = VIR_DOMAIN_TPM_VERSION_2_0;
else
tpm->version = VIR_DOMAIN_TPM_VERSION_1_2;