From nobody Mon Apr 29 10:38:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594327792; cv=none; d=zohomail.com; s=zohoarc; b=Ypt7uMlGhRstMcBx52A3GNEBbB5zBIf8ANJbmMyUZn8suR+xwkxBVd9p8KYV7aKm3Mp0OtnudIFZozWSMQSVhfVc7vBtKyoutwXZjQZPfMHT288F0xyQyrBG3FUG1smrDyIybw6qS2iXWcnra41Yjajm+GAkm+eJl8zyYhg7XA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594327792; h=Content-Type:Content-Transfer-Encoding:Cc: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=46AnI2tUgZhT9E4LIO9IRKqt8+4wWePc4lz4kh4Idks=; b=HoH2u3lBajebY7aATZdf1DYuCxSCa18do1YLH70UlAyUw9RQzdiYWzd2A2r9Ytzk2HZrywRPtoHFFElRArO04s7Z0D4u/9IFeewWUOiofDPBhayooCQmkHB6y/6GPdZspSE7LqMu0L6SbwDk+RL9Qr+Wj525+iFyCF43f//tRPo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1594327792036560.2253800735596; Thu, 9 Jul 2020 13:49:52 -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-257-0dqCv5SHOpmJhPKu9tJbgg-1; Thu, 09 Jul 2020 16:49:48 -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 3BD3A80BCA3; Thu, 9 Jul 2020 20:49:41 +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 1DCDC19733; Thu, 9 Jul 2020 20:49:40 +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 E14FD8435A; Thu, 9 Jul 2020 20:49:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069Kkap9006299 for ; Thu, 9 Jul 2020 16:46:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id C5FCF8143; Thu, 9 Jul 2020 20:46:36 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0A6086D94 for ; Thu, 9 Jul 2020 20:46:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3D5FD80CDDF for ; Thu, 9 Jul 2020 20:46:34 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-g6pS0DAoPCmfIPpnyqVuyA-1; Thu, 09 Jul 2020 16:46:29 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 069KVJgF056335; Thu, 9 Jul 2020 16:46:28 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 325ktt7cn8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 16:46:28 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 069KWToO060549; Thu, 9 Jul 2020 16:46:28 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 325ktt7cmm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 16:46:28 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 069KdYjt022167; Thu, 9 Jul 2020 20:46:27 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03dal.us.ibm.com with ESMTP id 325k1muajn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 20:46:27 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 069KkQfC23396842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Jul 2020 20:46:26 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B20BC6057; Thu, 9 Jul 2020 20:46:26 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A5DF5C6055; Thu, 9 Jul 2020 20:46:25 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 9 Jul 2020 20:46:25 +0000 (GMT) X-MC-Unique: 0dqCv5SHOpmJhPKu9tJbgg-1 X-MC-Unique: g6pS0DAoPCmfIPpnyqVuyA-1 From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v5 1/3] qemu: Move setting of TPM default to post parse function Date: Thu, 9 Jul 2020 16:46:18 -0400 Message-Id: <20200709204620.156606-2-stefanb@linux.vnet.ibm.com> In-Reply-To: <20200709204620.156606-1-stefanb@linux.vnet.ibm.com> References: <20200709204620.156606-1-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-09_10:2020-07-09, 2020-07-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 phishscore=0 suspectscore=1 impostorscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007090135 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , marcandre.lureau@redhat.com, pkrempa@redhat.com, Stefan Berger 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Berger Move setting the TPM default version out of the validation function into the post parse function. Signed-off-by: Stefan Berger Reviewed-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza Reviewed-by: Marc-Andr=C3=A9 Lureau --- src/qemu/qemu_domain.c | 7 ++++--- src/qemu/qemu_validate.c | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 42cc78ac1b..f916d840e2 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4347,12 +4347,13 @@ qemuDomainDefTPMsPostParse(virDomainDefPtr def) virDomainTPMDefPtr regularTPM =3D NULL; size_t i; =20 - if (def->ntpms < 2) - return 0; - for (i =3D 0; i < def->ntpms; i++) { virDomainTPMDefPtr tpm =3D def->tpms[i]; =20 + /* 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) + tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; + if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY) { if (proxyTPM) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index bd7590a00a..d130b52bf2 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3644,10 +3644,6 @@ qemuValidateDomainDeviceDefTPM(virDomainTPMDef *tpm, { virQEMUCapsFlags flag; =20 - /* TPM 1.2 and 2 are not compatible, so we choose a specific version h= ere */ - if (tpm->version =3D=3D VIR_DOMAIN_TPM_VERSION_DEFAULT) - tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; - switch (tpm->version) { case VIR_DOMAIN_TPM_VERSION_1_2: /* TPM 1.2 + CRB do not work */ --=20 2.17.1 From nobody Mon Apr 29 10:38:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594327753; cv=none; d=zohomail.com; s=zohoarc; b=HAB3Kpi/7Z1KEFfHs99xeHbeNlwAi+yN/Dq1bNXn1PRvDgcN5ZvzsUgGP9B4C7KRuryxFjS87sVQZ0t59sTbj8j9WYdJdzNeCMt+RYP5KWPVT/uxI9EA8VcqNBYXbxlz27i16HHlznqBHR53ebh4pSOhrYQt9VdoNtHFdILOIzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594327753; h=Content-Type:Content-Transfer-Encoding:Cc: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=m3WcW+Xh/l+8gVfdX/NhpJQPoICRJZUiFuuDnvBOdlk=; b=TKsRl/PJkTRrII44T5gk9RDCa0v6tvAuqs9qjVENyurBbkMgSgu4T1CBsPXbxdoK4RnKQgYOXT9YX6xdxhIySD+DP7vJTBkKyGVJpJSG6o/Ee16ldkRFhF4zClh2W1zWW995gdpVRGYojHb/BcaDSKAJDQKHGzH4uHoO3P2paWg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594327753158177.12404987190598; Thu, 9 Jul 2020 13:49:13 -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-395-Jjuddo-INiS7sCkPyhHiMQ-1; Thu, 09 Jul 2020 16:49:09 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DD5B6106B242; Thu, 9 Jul 2020 20:49:02 +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 A65B279CF1; Thu, 9 Jul 2020 20:49:01 +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 C20EA84357; Thu, 9 Jul 2020 20:48:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069Kkcuk006314 for ; Thu, 9 Jul 2020 16:46:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19D31207B2B0; Thu, 9 Jul 2020 20:46:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06DD92026D5D for ; Thu, 9 Jul 2020 20:46:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B1A29858EE4 for ; Thu, 9 Jul 2020 20:46:35 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63-RhRlxc3jOnSRlbmGQquHpw-1; Thu, 09 Jul 2020 16:46:30 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 069KZjkZ072059; Thu, 9 Jul 2020 16:46:29 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 325kh4e96n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 16:46:29 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 069KZnvp072430; Thu, 9 Jul 2020 16:46:28 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 325kh4e964-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 16:46:28 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 069KdjTJ023253; Thu, 9 Jul 2020 20:46:27 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03wdc.us.ibm.com with ESMTP id 325k1r11qu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 20:46:27 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 069KkQla20513102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Jul 2020 20:46:26 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C56ECC6055; Thu, 9 Jul 2020 20:46:26 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4AAE9C6059; Thu, 9 Jul 2020 20:46:26 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 9 Jul 2020 20:46:26 +0000 (GMT) X-MC-Unique: Jjuddo-INiS7sCkPyhHiMQ-1 X-MC-Unique: RhRlxc3jOnSRlbmGQquHpw-1 From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v5 2/3] qemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice Date: Thu, 9 Jul 2020 16:46:19 -0400 Message-Id: <20200709204620.156606-3-stefanb@linux.vnet.ibm.com> In-Reply-To: <20200709204620.156606-1-stefanb@linux.vnet.ibm.com> References: <20200709204620.156606-1-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-09_10:2020-07-09, 2020-07-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 clxscore=1015 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 adultscore=0 impostorscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007090135 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , marcandre.lureau@redhat.com, pkrempa@redhat.com, Stefan Berger 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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Berger The firmware (SLOF) on QEMU for ppc64 does not support TPM 1.2, so prevent the choice of TPM 1.2 when the SPAPR device model is chosen and use a default of '2.0' (TPM 2) for the backend. This patch addresses BZ 1781913: https://bugzilla.redhat.com/show_bug.cgi?i= d=3D1781913 Signed-off-by: Stefan Berger Reviewed-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza Reviewed-by: Marc-Andr=C3=A9 Lureau --- src/qemu/qemu_domain.c | 8 ++++++-- src/qemu/qemu_validate.c | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f916d840e2..b0f5e17613 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4351,8 +4351,12 @@ qemuDomainDefTPMsPostParse(virDomainDefPtr def) virDomainTPMDefPtr tpm =3D def->tpms[i]; =20 /* 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) - tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; + if (tpm->version =3D=3D VIR_DOMAIN_TPM_VERSION_DEFAULT) { + if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR) + tpm->version =3D VIR_DOMAIN_TPM_VERSION_2_0; + else + tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; + } =20 if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY) { if (proxyTPM) { diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index d130b52bf2..488f258d00 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3654,6 +3654,12 @@ qemuValidateDomainDeviceDefTPM(virDomainTPMDef *tpm, virDomainTPMModelTypeToString(tpm->model)); return -1; } + /* TPM 1.2 + SPAPR do not work with any 'type' (backend) */ + if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("TPM 1.2 is not supported with the SPAPR devi= ce model")); + return -1; + } break; case VIR_DOMAIN_TPM_VERSION_2_0: case VIR_DOMAIN_TPM_VERSION_DEFAULT: --=20 2.17.1 From nobody Mon Apr 29 10:38:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594327787; cv=none; d=zohomail.com; s=zohoarc; b=TB/C9g/0nzSmVvzhF6b/LWkfa5zFmnOVSzsCrxleJa/Jpog/c0x86foNhWSZM2rcAIs2BTflvg97qKa8gU5QOgJXj7xbojJeF/VgjT+L4hkMHhgcqnMrYtSpdShY1zFaWfDN4Uhlryzjem/fzp33+jS2dJW4cn9n6lmhSAkgAeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594327787; h=Content-Type:Content-Transfer-Encoding:Cc: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=DbB7F8c5sD5b9YoovbLj5X+4u3rx/N0H6VdHVuLJU0Q=; b=leIoAY9fkWlvGAQUQDSbFD9wHQwBBsg0VLDeHQxXHIV06hyCejnoLBI/OuJ2qgj5+DLvDBU8p2TXAI3S3ktMt1/8R6tqGhT7VG9Ta+WjzvGL9Vnn7+9U5fpTaB78N5JSx+Niox80/5Ycq3+d0u67a27OLqnb9O3V2CR2YBmwGts= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594327787781611.953850760819; Thu, 9 Jul 2020 13:49:47 -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-146-4BlfjP_RMJ-dojy3yfKQNA-1; Thu, 09 Jul 2020 16:49:43 -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 8958CE919; Thu, 9 Jul 2020 20:49:37 +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 5E0BB19D7D; Thu, 9 Jul 2020 20:49:37 +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 DF3311809547; Thu, 9 Jul 2020 20:49:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069Kkcn5006315 for ; Thu, 9 Jul 2020 16:46:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A1B2207B2B8; Thu, 9 Jul 2020 20:46:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06E442026D67 for ; Thu, 9 Jul 2020 20:46:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2961D80CDDF for ; Thu, 9 Jul 2020 20:46:37 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-NH5SrBc1MUi01C3ZEpktnQ-1; Thu, 09 Jul 2020 16:46:32 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 069KVo7p047770; Thu, 9 Jul 2020 16:46:31 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 325p3j82h6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 16:46:30 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 069KWErt048605; Thu, 9 Jul 2020 16:46:30 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 325p3j82gx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 16:46:30 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 069Kdhtb027180; Thu, 9 Jul 2020 20:46:28 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma02dal.us.ibm.com with ESMTP id 325k1nu9bk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2020 20:46:28 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 069KkRqw44106082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Jul 2020 20:46:27 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72B58C605B; Thu, 9 Jul 2020 20:46:27 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3BCFC6057; Thu, 9 Jul 2020 20:46:26 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 9 Jul 2020 20:46:26 +0000 (GMT) X-MC-Unique: 4BlfjP_RMJ-dojy3yfKQNA-1 X-MC-Unique: NH5SrBc1MUi01C3ZEpktnQ-1 From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v5 3/3] qemu: Choose TPM 2 for backend as default for CRB interface Date: Thu, 9 Jul 2020 16:46:20 -0400 Message-Id: <20200709204620.156606-4-stefanb@linux.vnet.ibm.com> In-Reply-To: <20200709204620.156606-1-stefanb@linux.vnet.ibm.com> References: <20200709204620.156606-1-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-09_10:2020-07-09, 2020-07-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 phishscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007090135 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , marcandre.lureau@redhat.com, pkrempa@redhat.com, Stefan Berger 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Berger Choose a TPM 2 device for the backend as default for the CRB interface since TPM 1.2 would not work. This patch addresses BZ 1781913: https://bugzilla.redhat.com/show_bug.cgi?i= d=3D1781913 Signed-off-by: Stefan Berger Reviewed-by: Daniel Henrique Barboza Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 b0f5e17613..161421b602 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4352,7 +4352,8 @@ qemuDomainDefTPMsPostParse(virDomainDefPtr def) =20 /* 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) + if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR || + tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_CRB) tpm->version =3D VIR_DOMAIN_TPM_VERSION_2_0; else tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; --=20 2.17.1