From nobody Thu May 2 10:48:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1624631285; cv=none; d=zohomail.com; s=zohoarc; b=TUFWPcEjgtn7xjcQYuB6x5sFlj8igCWiJD9P9a7yGRsmEsWo+fTXLBkFjX1rtpz8IIYPTIuYfjNY+5xpxwyZO8QP3MU9SBXei65O1Pzql6VsuxcL2NKhG7w7CL1f65TK4kcMC/lxMCl0k2w5Z78B6yF2RIz9k/SLzShIK5ZssTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624631285; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mGTLx9bzOeXlXFgn0TQeFHx/mRqdgAJJJjnC9K42UnQ=; b=kTdbjEnmNsGOGwLH+OWYQsbxFs98x+/4nq6bAFLZhoOMn4z8Eog8bCJyXcIDRO1buQMjrRKry6p3eipCgGtiLam4E28bnL2uaYY/I6TnWwuqzyhrFxRMpkg7MFamhaSapwC8PBQRUoE72eePHSt3xpdvDb5F+nk+N32kfHGd9ts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1624631285901205.35115362374052; Fri, 25 Jun 2021 07:28:05 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-2-ylZg6_gJOnmD5cKaPrWfHw-1; Fri, 25 Jun 2021 10:28:02 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 82312804140; Fri, 25 Jun 2021 14:27:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2D1860CCC; Fri, 25 Jun 2021 14:27:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 85ED31809C9A; Fri, 25 Jun 2021 14:27:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15PERraN017762 for ; Fri, 25 Jun 2021 10:27:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 279125C1D5; Fri, 25 Jun 2021 14:27:53 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C5425C1D1 for ; Fri, 25 Jun 2021 14:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624631284; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=mGTLx9bzOeXlXFgn0TQeFHx/mRqdgAJJJjnC9K42UnQ=; b=ixtEEO+WPSMkmmA9z8MO14WmxuVVc/2TS5NsihOze16zlDvfXTx+yNe3UUkKNX+mX3oDOI UWZyWkPXmlLuh4ACNO+pHCgiFKn0UQWySk6OCvR5/nhzQgywcE07pBBlqn6ywMxL9W9RTh aWjfAgbB2V6ujSYrxo8q3urinIzPoOA= X-MC-Unique: ylZg6_gJOnmD5cKaPrWfHw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] docs: Fix information for default TPM version Date: Fri, 25 Jun 2021 16:27:41 +0200 Message-Id: <20210625142745.117287-2-abologna@redhat.com> In-Reply-To: <20210625142745.117287-1-abologna@redhat.com> References: <20210625142745.117287-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The current information is not accurate, because the default is 2.0 instead of 1.2 for the tpm-crb and tpm-spapr models. Any detailed list will surely become obsolete and out of sync with reality over time, so let's just document that the default model depends on a number of factors and avoid getting any more specific than that. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- docs/formatdomain.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index c6dede053f..25e6bf73ba 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -7540,13 +7540,16 @@ Example: usage of the TPM Emulator each QEMU guest requesting access to it. =20 ``version`` - The ``version`` attribute indicates the version of the TPM. By default = a TPM - 1.2 is created. This attribute only works with the ``emulator`` backend= . The - following versions are supported: + The ``version`` attribute indicates the version of the TPM. This attrib= ute + only works with the ``emulator`` backend. The following versions are + supported: =20 - '1.2' : creates a TPM 1.2 - '2.0' : creates a TPM 2.0 =20 + The default version used depends on the combination of hypervisor, guest + architecture, TPM model and backend. + ``persistent_state`` The ``persistent_state`` attribute indicates whether 'swtpm' TPM state = is kept or not when a transient domain is powered off or undefined. This --=20 2.31.1 From nobody Thu May 2 10:48:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1624631286; cv=none; d=zohomail.com; s=zohoarc; b=a4n0rY66SnxInduCIEZFwyPTlLuwLjtv9NXeMNaCHh8smJzjFHg2QWmneIfa4hXyLqa+HHDH1hfEVyNPxna0YaVoEMHzfJwyCL1KT1G9oqiNddmA2JdPSUkSLlotIwUXWewCpQdiPb8h5KxKMmKiZBRCvO2Jyan45MBaW2nBOi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624631286; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xUOqxSWssGXk2QhxyRdaWRKeoEWe8nw6ZaMe6O8k/D4=; b=kCzjo3gYKaSCRMlj3m1FQXJFPsvJpUQrPMfxQCmgALdXyfIqCxZWZMbmdqU36YyAQTspjz9oR6ZMy4l+QZ0u7LCczWnn5X4HNxBiwFE1/+u6vEvej1vN2xlyUJ4uYmReeEaTyL4/pMu8fHev0twptKPjUiLNtGJnh0Pnh/k+j3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1624631286884849.6601759835856; Fri, 25 Jun 2021 07:28:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-303-ngyvZK5gMkqzGXfkAKdD6Q-1; Fri, 25 Jun 2021 10:28:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFD6780414A; Fri, 25 Jun 2021 14:27:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA64226FB3; Fri, 25 Jun 2021 14:27:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 82CCF1809CB3; Fri, 25 Jun 2021 14:27:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15PERsL1017772 for ; Fri, 25 Jun 2021 10:27:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1EC915C1D5; Fri, 25 Jun 2021 14:27:54 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8404D5C1D1 for ; Fri, 25 Jun 2021 14:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624631285; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xUOqxSWssGXk2QhxyRdaWRKeoEWe8nw6ZaMe6O8k/D4=; b=HjixVuZttbdNzt52OKo4TCTWAV+ZDErntGpGGcAUR3BMGNig2nTjtW7P7eJcxc0kUZZVIe r5EE0dI6PFFPM0/pGq3OlrumnOpCSD0tFyQxhLIYs2VFCc2NxLcfVZQSkPsuTKQPZ+Nc4T dmSdSFjieDYje/uK6evlzMhsdvjYpqg= X-MC-Unique: ngyvZK5gMkqzGXfkAKdD6Q-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/5] tests: Add aarch64-tpm test to qemuxml2xml Date: Fri, 25 Jun 2021 16:27:42 +0200 Message-Id: <20210625142745.117287-3-abologna@redhat.com> In-Reply-To: <20210625142745.117287-1-abologna@redhat.com> References: <20210625142745.117287-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We're going to change the input file later, and having this additional coverage will demonstrate that such a change does not alter the behavior. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- .../aarch64-tpm.aarch64-latest.xml | 29 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 2 files changed, 30 insertions(+) create mode 100644 tests/qemuxml2xmloutdata/aarch64-tpm.aarch64-latest.xml diff --git a/tests/qemuxml2xmloutdata/aarch64-tpm.aarch64-latest.xml b/test= s/qemuxml2xmloutdata/aarch64-tpm.aarch64-latest.xml new file mode 100644 index 0000000000..e97f39aec3 --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-tpm.aarch64-latest.xml @@ -0,0 +1,29 @@ + + aarch64test + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1048576 + 1 + + hvm + + + + + + + cortex-a15 + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 40e027aaa4..8b7538f666 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -783,6 +783,7 @@ mymain(void) DO_TEST_CAPS_LATEST("tpm-emulator-tpm2"); DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-enc"); DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-pstate"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-tpm", "aarch64"); =20 DO_TEST("metadata", NONE); DO_TEST("metadata-duplicate", NONE); --=20 2.31.1 From nobody Thu May 2 10:48:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1624631343; cv=none; d=zohomail.com; s=zohoarc; b=mEmYxmEgOYb3wtwz7EZsxLoygkuWkzxNsgGHnMs2l4L/EQjdrOGL5Dx09S2EViOZXtqKL7y3La4M8bJeiC/7MxYhLgAWCsj6YVFWrQnmd2uenGGQ0o63c/b16dsui4L3Y1boaKXwqjIW0Zn6TyJfiRuq+GBEYvCPSHFi0my+LsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624631343; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3JWtqoswU6B2lXzayoxWB+VNqR9ncO813UwJ7Kzg3F0=; b=b5iR1hZecaaHZmUHg+t5bBOL3KRxJGx6udxGuZdUj5INyxXXHYnr9I6HWNikSC6HpKrRnzny1948xeBhZ5fhBptAYhikaaedJrBjX7zZxW+bQcRlc8e6MXy8QYCP8J/QkOYsfPqxl+M5tm3nyhqqP3D7hOTPkNH7nmYNKvQ0TXQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1624631343380424.66707055192296; Fri, 25 Jun 2021 07:29:03 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-wNWlqAi3N8yHro3iC7y8bA-1; Fri, 25 Jun 2021 10:28:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C159F1926DA6; Fri, 25 Jun 2021 14:28:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95DB25D703; Fri, 25 Jun 2021 14:28:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3391518005A2; Fri, 25 Jun 2021 14:28:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15PERwA7017792 for ; Fri, 25 Jun 2021 10:27:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8720D5C22B; Fri, 25 Jun 2021 14:27:58 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAB9F5C1D5 for ; Fri, 25 Jun 2021 14:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624631342; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3JWtqoswU6B2lXzayoxWB+VNqR9ncO813UwJ7Kzg3F0=; b=AXIqktpP3tUjF1D3Bp4yEUeDe7S6TPQtkWs1amE8DZl+NLUyoFRXF3xdhlyd5ex1zJVS9j l2GtW1QquXb3+gD+uwHBkdlhMT1uge13NyGeii9YNZ/9QWOvDWApOFrasnxo9/6VCvNiyq uVJvmvvv1GrGUyKe0iwAlW7nc83glN8= X-MC-Unique: wNWlqAi3N8yHro3iC7y8bA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 3/5] qemu: Default to TPM 2.0 for ARM virt guests Date: Fri, 25 Jun 2021 16:27:43 +0200 Message-Id: <20210625142745.117287-4-abologna@redhat.com> In-Reply-To: <20210625142745.117287-1-abologna@redhat.com> References: <20210625142745.117287-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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=3D1970310 Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Tested-by: Liu Yiding Tested-by: liuyd.fnst@fujitsu.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 versi= on here */ if (tpm->version =3D=3D VIR_DOMAIN_TPM_VERSION_DEFAULT) { if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR || - tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_CRB) + tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_CRB || + qemuDomainIsARMVirt(def)) tpm->version =3D VIR_DOMAIN_TPM_VERSION_2_0; else tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; --=20 2.31.1 From nobody Thu May 2 10:48:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1624631294; cv=none; d=zohomail.com; s=zohoarc; b=UYalD2jo9g3yrIkQQVDZHlr5pjzYGdq964ed7E1nKw4+X4l8v32W2fMoLfoSJESsKoVWTZS4+mk2YHmlqyzk6E/Wy7wfelXUmxXtSb9IO+QRjwiXmwSHdurgZ2Yi/OC2coxpmtBtiJUBZHdwwDknNldd9tYB+3VEYvlpEJPJfAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624631294; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eLZDeBMv+eL3cYDnzsw3PRmqziHLQGNXItfGAx/JB/Q=; b=gNSBaoayA4+sslIA2D7A58R/B+MlxZ5LJLtw5BWIwKtgPyV8RwIVgcHM/gM24RK9VE986jaDCf0zt/LDz/osPZh1qxkrMupTR/1x//lU61ypf19Rk/9vz1zmwwu6+MKsQI5W+6QQB/60NLGgIDQlrjfCF0ps4ic4aLD8csmzu9Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1624631294615585.7208781516571; Fri, 25 Jun 2021 07:28:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-p11tENkSNK26L7vdd1p48Q-1; Fri, 25 Jun 2021 10:28:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C114A1084F53; Fri, 25 Jun 2021 14:28:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9863110013D6; Fri, 25 Jun 2021 14:28:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 372EF4EA2A; Fri, 25 Jun 2021 14:28:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15PES2qR017803 for ; Fri, 25 Jun 2021 10:28:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9A9635C1D5; Fri, 25 Jun 2021 14:28:02 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A1105C1B4 for ; Fri, 25 Jun 2021 14:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624631293; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eLZDeBMv+eL3cYDnzsw3PRmqziHLQGNXItfGAx/JB/Q=; b=FpDkHBXyrvq+7vyveuxU5hJMyZtB4QmVTBIU1uVCEuI/xcfmRK0kWHpGuvfdASUB+SrpeX fWK/V1Qsp/BeE2oENIczmcN66x2XvEbItBNu6A4b6uZIOmShiz5OmVoWx3KfyO0LaSTVVk VwAGuKBbC4j8EJO5rN6m44j7lHIO1EE= X-MC-Unique: p11tENkSNK26L7vdd1p48Q-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] tests: Test the defaults for TPM on ARM virt guests Date: Fri, 25 Jun 2021 16:27:44 +0200 Message-Id: <20210625142745.117287-5-abologna@redhat.com> In-Reply-To: <20210625142745.117287-1-abologna@redhat.com> References: <20210625142745.117287-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Instead of providing the configuration explicitly, let libvirt fill in the blanks. After the recent changes, this results in a working configuration without the need for user input. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- tests/qemuxml2argvdata/aarch64-tpm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemuxml2argvdata/aarch64-tpm.xml b/tests/qemuxml2argvdat= a/aarch64-tpm.xml index d338a20f17..b22dbee71e 100644 --- a/tests/qemuxml2argvdata/aarch64-tpm.xml +++ b/tests/qemuxml2argvdata/aarch64-tpm.xml @@ -8,8 +8,8 @@ /usr/bin/qemu-system-aarch64 - - + + --=20 2.31.1 From nobody Thu May 2 10:48:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1624631298; cv=none; d=zohomail.com; s=zohoarc; b=iWQsyFxlF3FQQ4Ix3KjReu5eHaAIATDPkxOydPCq5ziKxACnQsBF/agZQ+DMeIXjcWhhp3yRWV+rAZccR0LGi+P0QpXazvWXYPGldKWm6JscSqk4sPODt0uoGjN7n0jqFapINV00xdVzshg0jtQj3lArWXwLHSRnUjwym5leSoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624631298; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CAb7PUos4lru42Ebv3u1L1Q3+udOgEEas9kxUrP8DAE=; b=Xk1NIzujUdklXP02Fh/3B0XK8DL2C2KumzwXE897ehPvOdY2Zo4ygz/ZfWMZxWM8ZCpzcwdofF24z3i+AmOnPacBV6zpQzRO66mYLExWHHUnqW01b8dFXBHyLSztMLu7wWH9ATf63kZvPYmlw1rMfG08CSloVOmEBSdJ5PN1bHk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1624631298275736.5282518401472; Fri, 25 Jun 2021 07:28:18 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-OXVhwf4JOLie4fPtWLnq_A-1; Fri, 25 Jun 2021 10:28:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8D55E1084F5B; Fri, 25 Jun 2021 14:28:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41F655C1D5; Fri, 25 Jun 2021 14:28:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1231C4EA38; Fri, 25 Jun 2021 14:28:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15PES79M017813 for ; Fri, 25 Jun 2021 10:28:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5286F5C1D5; Fri, 25 Jun 2021 14:28:07 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6D805C1B4 for ; Fri, 25 Jun 2021 14:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624631297; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CAb7PUos4lru42Ebv3u1L1Q3+udOgEEas9kxUrP8DAE=; b=UhJNu2wckdnUbxRl5YKbHjcyHg4rR/zd7Cz8yJP9uFGFkQdzxBJgQklsjOqqFe0FvXa68g tvUZA5xbtFq8+G6jkFVZvtKbujfNb5CPemufv8cnkv7+nMg2A7MVg9GJ4JP5g786WvBC9K MlLxFJIZ5+iapi7uiuxYvPfOTD3l9pI= X-MC-Unique: OXVhwf4JOLie4fPtWLnq_A-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] qemu: Reject TPM 1.2 for ARM virt guests Date: Fri, 25 Jun 2021 16:27:45 +0200 Message-Id: <20210625142745.117287-6-abologna@redhat.com> In-Reply-To: <20210625142745.117287-1-abologna@redhat.com> References: <20210625142745.117287-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We already reject TPM 1.2 in a number of scenarios; let's add ARM virt guests to the list. https://bugzilla.redhat.com/show_bug.cgi?id=3D1970310 Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Tested-by: liuyd.fnst@fujitsu.com --- src/qemu/qemu_validate.c | 6 ++++++ .../qemuxml2argvdata/aarch64-tpm-wrong-model.err | 1 + .../qemuxml2argvdata/aarch64-tpm-wrong-model.xml | 15 +++++++++++++++ tests/qemuxml2argvtest.c | 1 + 4 files changed, 23 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-tpm-wrong-model.err create mode 100644 tests/qemuxml2argvdata/aarch64-tpm-wrong-model.xml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 382473d03b..b133ce3cd6 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4517,6 +4517,12 @@ qemuValidateDomainDeviceDefTPM(virDomainTPMDef *tpm, _("TPM 1.2 is not supported with the SPAPR devi= ce model")); return -1; } + /* TPM 1.2 + ARM does not work */ + if (qemuDomainIsARMVirt(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("TPM 1.2 is not supported on ARM")); + return -1; + } break; case VIR_DOMAIN_TPM_VERSION_2_0: case VIR_DOMAIN_TPM_VERSION_DEFAULT: diff --git a/tests/qemuxml2argvdata/aarch64-tpm-wrong-model.err b/tests/qem= uxml2argvdata/aarch64-tpm-wrong-model.err new file mode 100644 index 0000000000..a3a82fdcf5 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-tpm-wrong-model.err @@ -0,0 +1 @@ +unsupported configuration: TPM 1.2 is not supported on ARM diff --git a/tests/qemuxml2argvdata/aarch64-tpm-wrong-model.xml b/tests/qem= uxml2argvdata/aarch64-tpm-wrong-model.xml new file mode 100644 index 0000000000..9441c4d05a --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-tpm-wrong-model.xml @@ -0,0 +1,15 @@ + + aarch64test + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 9df28658b9..16236f0331 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2565,6 +2565,7 @@ mymain(void) DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-pstate"); DO_TEST_CAPS_LATEST_PPC64("tpm-emulator-spapr"); DO_TEST_CAPS_ARCH_LATEST("aarch64-tpm", "aarch64"); + DO_TEST_PARSE_ERROR("aarch64-tpm-wrong-model", "aarch64"); =20 DO_TEST_PARSE_ERROR("pci-domain-invalid", NONE); DO_TEST_PARSE_ERROR("pci-bus-invalid", NONE); --=20 2.31.1