]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Default to TPM 2.0 for ARM virt guests
authorAndrea Bolognani <abologna@redhat.com>
Fri, 25 Jun 2021 13:57:38 +0000 (15:57 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 1 Jul 2021 14:15:05 +0000 (16:15 +0200)
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>
src/qemu/qemu_domain.c

index fc60e15eea0d6ef07f3a99e5b4d725f46f855d48..8488f58e09e6c6a0f53c26e7be752d0dc1b2b3c0 100644 (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;