From nobody Thu Apr 25 01:23:03 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 15807456002790.7844075392721379; Mon, 3 Feb 2020 08:00:00 -0800 (PST) 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-254-YDvRPJXzNvaPSIfXgn-rHQ-1; Mon, 03 Feb 2020 10:59:55 -0500 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 5D17E920E25; Mon, 3 Feb 2020 15:59:50 +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 30DE78642F; Mon, 3 Feb 2020 15:59:50 +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 CE05781746; Mon, 3 Feb 2020 15:59:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 013FxcdB013447 for ; Mon, 3 Feb 2020 10:59:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 83B1010E60EE; Mon, 3 Feb 2020 15:59:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7ED3D10E60F4 for ; Mon, 3 Feb 2020 15:59:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 6662E185AB70 for ; Mon, 3 Feb 2020 15:59:38 +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-328-Ce6MT4noMyGgIiMxjqtHJQ-1; Mon, 03 Feb 2020 10:59:30 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 013Fn4rU076069; Mon, 3 Feb 2020 10:59:28 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xxkdc7hk2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 10:59:28 -0500 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 013FnSF4079393; Mon, 3 Feb 2020 10:59:27 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xxkdc7hjn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 10:59:27 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 013FpE7A000826; Mon, 3 Feb 2020 15:59:26 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01dal.us.ibm.com with ESMTP id 2xw0y6ehs2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 15:59:26 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 013FxPTi60555734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Feb 2020 15:59:25 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5315B78063; Mon, 3 Feb 2020 15:59:25 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC2757805F; Mon, 3 Feb 2020 15:59:24 +0000 (GMT) Received: from newfield.pok.ibm.com (unknown [9.47.158.66]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 3 Feb 2020 15:59:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580745599; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc: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=UFu/X+dJXsk+osZLnVByut73i1T+03DTIQI8zyP0j9M=; b=GPUpK2fUdpB/L20h5BrIxJr2vHb7sAUKPDGNzgE0gjpISfgvLn4zfBL80yjcDSoc+4kcN5 2Oxm7QKQNrJBWb6tSsBAEkswZH3ELau1SyVOy4zUIGv0ksKCbwXMoa24MNBLkh7KTJRMat IS9OoeO0WmLXZOttUqGHW9asErCbvq4= From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v2 2/6] conf: Add support for tpm-spapr to domain XML Date: Mon, 3 Feb 2020 10:59:17 -0500 Message-Id: <20200203155921.127300-3-stefanb@linux.ibm.com> In-Reply-To: <20200203155921.127300-1-stefanb@linux.ibm.com> References: <20200203155921.127300-1-stefanb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-03_05:2020-02-02, 2020-02-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 suspectscore=15 phishscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1911200001 definitions=main-2002030118 X-MC-Unique: Ce6MT4noMyGgIiMxjqtHJQ-1 X-MC-Unique: YDvRPJXzNvaPSIfXgn-rHQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 013FxcdB013447 X-loop: libvir-list@redhat.com Cc: aik@ozlabs.ru, marcandre.lureau@redhat.com, jtomko@redhat.com, david@gibson.dropbear.id.au 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 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefan Berger This patch adds support for the tpm-spapr device model for ppc64. The XML f= or this type of TPM looks as follows: Extend the documentation. Signed-off-by: Stefan Berger Reviewed-by: J=C3=A1n Tomko --- docs/formatdomain.html.in | 7 +++++-- docs/schemas/domaincommon.rng | 4 ++++ src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain.c | 19 +++++++++++++------ 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 60a103d7c6..44e2062d01 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8508,10 +8508,13 @@ qemu-kvm -net nic,model=3D? /dev/null

The model attribute specifies what device model QEMU provides to the guest. If no model name is provided, - tpm-tis will automatically be chosen. + tpm-tis will automatically be chosen for non-PPC64 + architectures. Since 4.4.0, another available choi= ce is the tpm-crb, which should only be used when the - backend device is a TPM 2.0. + backend device is a TPM 2.0. Since 6.1.0, + pSeries guests on PPC64 are supported and the default is + tpm-spapr.

backend
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index ea237a05e5..9577d26c2a 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4383,6 +4383,7 @@ tpm-tis tpm-crb + tpm-spapr @@ -4390,6 +4391,9 @@ + + + =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 79aa3e3699..82590a4339 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1128,6 +1128,7 @@ VIR_ENUM_IMPL(virDomainTPMModel, "default", "tpm-tis", "tpm-crb", + "tpm-spapr", ); =20 VIR_ENUM_IMPL(virDomainTPMBackend, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8b4b0b467a..34543bcca0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1255,6 +1255,7 @@ typedef enum { VIR_DOMAIN_TPM_MODEL_DEFAULT, VIR_DOMAIN_TPM_MODEL_TIS, VIR_DOMAIN_TPM_MODEL_CRB, + VIR_DOMAIN_TPM_MODEL_SPAPR, =20 VIR_DOMAIN_TPM_MODEL_LAST } virDomainTPMModel; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 46fd44bbec..1bf3102f59 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7756,9 +7756,9 @@ qemuDomainDeviceDefValidateTPM(virDomainTPMDef *tpm, =20 switch (tpm->version) { case VIR_DOMAIN_TPM_VERSION_1_2: - /* only TIS available for emulator */ + /* TPM 1.2 + CRB do not work */ if (tpm->type =3D=3D VIR_DOMAIN_TPM_TYPE_EMULATOR && - tpm->model !=3D VIR_DOMAIN_TPM_MODEL_TIS) { + tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_CRB) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported interface %s for TPM 1.2"), virDomainTPMModelTypeToString(tpm->model)); @@ -7793,6 +7793,7 @@ qemuDomainDeviceDefValidateTPM(virDomainTPMDef *tpm, case VIR_DOMAIN_TPM_MODEL_CRB: flag =3D QEMU_CAPS_DEVICE_TPM_CRB; break; + case VIR_DOMAIN_TPM_MODEL_SPAPR: case VIR_DOMAIN_TPM_MODEL_LAST: default: virReportEnumRangeError(virDomainTPMModel, tpm->model); @@ -9032,10 +9033,16 @@ qemuDomainHostdevDefPostParse(virDomainHostdevDefPt= r hostdev, =20 =20 static int -qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm) +qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm, + virArch arch) { - if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_DEFAULT) - tpm->model =3D VIR_DOMAIN_TPM_MODEL_TIS; + if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_DEFAULT) { + if (ARCH_IS_PPC64(arch)) + tpm->model =3D VIR_DOMAIN_TPM_MODEL_SPAPR; + else + tpm->model =3D VIR_DOMAIN_TPM_MODEL_TIS; + } + return 0; } =20 @@ -9094,7 +9101,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr de= v, break; =20 case VIR_DOMAIN_DEVICE_TPM: - ret =3D qemuDomainTPMDefPostParse(dev->data.tpm); + ret =3D qemuDomainTPMDefPostParse(dev->data.tpm, def->os.arch); break; =20 case VIR_DOMAIN_DEVICE_LEASE: --=20 2.17.1