[libvirt PATCH 3/5] qemu: Default to TPM 2.0 for ARM virt guests

Andrea Bolognani posted 5 patches 4 years, 7 months ago
[libvirt PATCH 3/5] qemu: Default to TPM 2.0 for ARM virt guests
Posted by Andrea Bolognani 4 years, 7 months ago
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>
---
 src/qemu/qemu_domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fc60e15eea..8488f58e09 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -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;
-- 
2.31.1

Re: [libvirt PATCH 3/5] qemu: Default to TPM 2.0 for ARM virt guests
Posted by liuyd.fnst@fujitsu.com 4 years, 7 months ago
That works for me. Thanks.

Tested-by: liuyd.fnst@fujitsu.com


On 6/25/21 10:27 PM, Andrea Bolognani wrote:
> 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>
> ---
>   src/qemu/qemu_domain.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index fc60e15eea..8488f58e09 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -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;

-- 
Best Regards.
Yiding Liu

Re: [libvirt PATCH 3/5] qemu: Default to TPM 2.0 for ARM virt guests
Posted by Andrea Bolognani 4 years, 7 months ago
On Tue, Jun 29, 2021 at 02:54:24AM +0000, liuyd.fnst@fujitsu.com wrote:
> That works for me. Thanks.
>
> Tested-by: liuyd.fnst@fujitsu.com

Glad to hear that! Can you please provide a full Tested-by tag in the
expected format

  Tested-by: FirstName LastName <email@address.tld>

so that it's suitable for inclusion in the git log? Thanks!

-- 
Andrea Bolognani / Red Hat / Virtualization

Re: [libvirt PATCH 3/5] qemu: Default to TPM 2.0 for ARM virt guests
Posted by liuyd.fnst@fujitsu.com 4 years, 7 months ago
Sorry for the inconvenience.

Tested-by: Liu Yiding <liuyd.fnst@fujitsu.com>

Thanks,
Liu

On 6/29/21 9:08 PM, Andrea Bolognani wrote:
> On Tue, Jun 29, 2021 at 02:54:24AM +0000, liuyd.fnst@fujitsu.com wrote:
>> That works for me. Thanks.
>>
>> Tested-by: liuyd.fnst@fujitsu.com
> Glad to hear that! Can you please provide a full Tested-by tag in the
> expected format
>
>    Tested-by: FirstName LastName <email@address.tld>
>
> so that it's suitable for inclusion in the git log? Thanks!
>
-- 
Best Regards.
Yiding Liu