From nobody Wed May 15 02:59:54 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=1657636023; cv=none; d=zohomail.com; s=zohoarc; b=U6ZhxpxqZmQ1iJLePj7Rg74W37zhsVsn/yckLRELtH1X3UKlDpkIrDwYc74zqoobfdFypSewONDqtg6WktD4iw/Ymq/MSIdtq7v5kPZoLhGfZRWKTqSOrsBIX71vYbeFM5WX56Y0TJiBruvhjzS4JG+H4z1r8nCpVTt16/eZvC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657636023; 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=rks7GV4jhtumC5aQhO7WISVyUwcWGcZAeAz4SsDKaCs=; b=cGV6VGxRjcTnZ8tGmGyOh7dl9BQscEBsX1FQdfZ2LL9TvtB0g4yAWkFN9aQmA9mr/aDC/7LtS9WlLvYl7aW4HiQrqh5AzES6eEGMArpPppl8XxqeY1CQeC68xdRxm0N4v29lsqMcRLH6GcZyLd4FFGpD5pcX7e6FEjjhmEC5UTE= 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 1657636023807450.9195402234776; Tue, 12 Jul 2022 07:27:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-495-rXGbGqScNOuz_ifbzbm2zw-1; Tue, 12 Jul 2022 10:26:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A0C38037B5; Tue, 12 Jul 2022 14:25:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 828F518ECC; Tue, 12 Jul 2022 14:25:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 61BDB1947067; Tue, 12 Jul 2022 14:25:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5B0111947058 for ; Tue, 12 Jul 2022 14:25:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 49404492C3B; Tue, 12 Jul 2022 14:25:51 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FD1240315E for ; Tue, 12 Jul 2022 14:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657636022; 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=rks7GV4jhtumC5aQhO7WISVyUwcWGcZAeAz4SsDKaCs=; b=RtiP8Z4Xs0NFHXdwZcIM2E55TJTNpsABJo//7eTWu83HbG9tDCqy0siOV4VAxIuWyBPEXV N/lkobAfREEYgdrYMLF2L4tauGILj1dwSC+2c91ChEXCNOgQcKtO3QxTIVXW2G9bvPP8hF o8Nr8gou2wbO/8ML+K6U+QX5FM9mS1Q= X-MC-Unique: rXGbGqScNOuz_ifbzbm2zw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] docs: Document TPM portion of domcaps Date: Tue, 12 Jul 2022 16:25:46 +0200 Message-Id: <1ce16a9b3b4719ab91d951a14c5fb33a2835087b.1657635928.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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) X-ZM-MESSAGEID: 1657636025359100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Surprisingly, we don't document TPM part of domain capabilities. Fortunately, the information exposed is pretty much self explanatory, but we should document it regardless. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/formatdomaincaps.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 933469b2a2..384b5eb7ea 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -494,6 +494,36 @@ instance: ``driverType`` Options for the ``type`` attribute of the element. =20 +TPM device +^^^^^^^^^^ + +TPM device capabilities are exposed under the ``tpm`` element. For instanc= e: + +:: + + + ... + + + + tpm-tis + tpm-crb + + + passthrough + emulator + + + ... + + + +``model`` + Options for the ``model`` attribute of the element. +``backendModel`` + Options for the ``type`` attribute of the element. + + Features ~~~~~~~~ =20 --=20 2.35.1 From nobody Wed May 15 02:59:54 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=1657635961; cv=none; d=zohomail.com; s=zohoarc; b=T7Jl5Ig7qPN8EMFqLzS06y9ybcALIlUWmlCGKrIOOVg14SxxWhql0CHkYNKmHpTFlwJ9Whwqhh9n8ATGx0Q4ZELoHpWC4saMO/U1cO5V/O+Q8fTXb7JyXAg2Bo42WCORU71r+q27Dspls+IZe7Wx3O+o96BDaaJV0Ypw53vyYK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657635961; 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=fFLFzMJ23JV5eGHwJBFAXryqtvH8xtcHDX3OJCjPP/4=; b=gj+34RIst2fKsq7DuvZV3cfUMIX1BhTm3d24PKqgL+gPakii0C+Pb9MapPL4/o8L+1T2PJ/ukyKiRUDQAhAObDFjF6k6raBadJUp7ge2+WmXcN0oqCwRgBFtY/V/laJwpj0jQKbF3xR+m0Fb2BshepHKAB3FaXDKml/7iIghYlg= 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 1657635961910557.9655037811699; Tue, 12 Jul 2022 07:26:01 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-166-3fZD0kphOBS_YlVRyIo_yg-1; Tue, 12 Jul 2022 10:25:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3DFD329DD98D; Tue, 12 Jul 2022 14:25:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29AC340E80E1; Tue, 12 Jul 2022 14:25:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CCE301947060; Tue, 12 Jul 2022 14:25:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F1C6D1947058 for ; Tue, 12 Jul 2022 14:25:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D584B40315D; Tue, 12 Jul 2022 14:25:51 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FE4F492C3B for ; Tue, 12 Jul 2022 14:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657635960; 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=fFLFzMJ23JV5eGHwJBFAXryqtvH8xtcHDX3OJCjPP/4=; b=i/BuSSmCxXQNg71ei5s9V+kfSWakKQVO4jT3OVsXIzUSrNiLF96ftMccIUGg9nYux8HLQJ z/Iu5Dp0vf678dP56Nh2q7oO1IsYafZIiliRPXTTxi0lx4L9wIr/r29Y2j9u39Hwgh5QR/ u+pF+XqFXeevBudwClRVyFsDqWgFUyQ= X-MC-Unique: 3fZD0kphOBS_YlVRyIo_yg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] virtpm: Introduce TPM-1.2 and TPM-2.0 capabilieis Date: Tue, 12 Jul 2022 16:25:47 +0200 Message-Id: <1f6c74c1996026fb6e7d5442b624d834102d44c4.1657635928.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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) X-ZM-MESSAGEID: 1657635962595100002 Content-Type: text/plain; charset="utf-8"; x-default="true" These new capabilities will be used only to track whether swtpm_setup is capable of TPM-1.2 and/or TPM-2.0. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virtpm.c | 2 ++ src/util/virtpm.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index b898f3a6db..3c961c11cb 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -47,6 +47,8 @@ VIR_ENUM_IMPL(virTPMSwtpmSetupFeature, "cmdarg-create-config-files", "tpm12-not-need-root", "cmdarg-reconfigure-pcr-banks", + "tpm-1.2", + "tpm-2.0", ); =20 /** diff --git a/src/util/virtpm.h b/src/util/virtpm.h index 0a82a03b69..bbf379a54a 100644 --- a/src/util/virtpm.h +++ b/src/util/virtpm.h @@ -42,6 +42,8 @@ typedef enum { VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_CREATE_CONFIG_FILES, VIR_TPM_SWTPM_SETUP_FEATURE_TPM12_NOT_NEED_ROOT, VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_RECONFIGURE_PCR_BANKS, + VIR_TPM_SWTPM_SETUP_FEATURE_TPM_1_2, + VIR_TPM_SWTPM_SETUP_FEATURE_TPM_2_0, =20 VIR_TPM_SWTPM_SETUP_FEATURE_LAST } virTPMSwtpmSetupFeature; --=20 2.35.1 From nobody Wed May 15 02:59:54 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=1657635965; cv=none; d=zohomail.com; s=zohoarc; b=JW2+RRpD23+DReZu5ywzSPtl5Jh63SZKkJ0GSltZfMCvxOpq57GYOA94Uyrt6Zuj7wZEvRaHnBL4b9UC/lRZ5K56cxo4n3QJLe4VSrRXcdkiCecgIpKcwcO46Dp4S2Wr0TD8IgXCsq04nLrDeR1eVRjmKqruroTLtZi/qTTdhwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657635965; 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=AzO4aprnC4Angq0sxlw5MzY257RZln58QVsD7B2yFsM=; b=IrtbQSmV7pKSb45w24kgyyBa5DZssJD+0y2mzXLmTyBoEFfELth0R/uaMWZ92AAhdDE6ffLzdje/4vW1dwDoIFRhWebL8I/cxnu3bKHX7DsmTSSNUnJHX/cHr/Z9GySWeamnNOl069wy5qu4jNof+A/38zMLwC2dAkrCIyovvio= 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 165763596532245.28570494455016; Tue, 12 Jul 2022 07:26:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-QbmPydIbM8im7K8ZXOHUcQ-1; Tue, 12 Jul 2022 10:25:59 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5DC40296A602; Tue, 12 Jul 2022 14:25:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AB25492C3B; Tue, 12 Jul 2022 14:25:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2F940194705E; Tue, 12 Jul 2022 14:25:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7FF50194705F for ; Tue, 12 Jul 2022 14:25:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6D513401E54; Tue, 12 Jul 2022 14:25:52 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18669492C3B for ; Tue, 12 Jul 2022 14:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657635964; 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=AzO4aprnC4Angq0sxlw5MzY257RZln58QVsD7B2yFsM=; b=AgKWpIZnEtDwudRhJgyWEy31kSU29CI0Emf40/pqdu7CTUS8YXkNeQCEK15W9171Yfm1a8 8ZNq2imGOgV7V6pzDEGNLGsHeU6hRK7UxjUn0C0B4Qecc6vZ28F6S+ymiYpPADrykL9+XA Ek9yQ/+Ubff9XX3fUnrUf2DLPFvxgPA= X-MC-Unique: QbmPydIbM8im7K8ZXOHUcQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] domcaps: Introduce TPM backendVersion Date: Tue, 12 Jul 2022 16:25:48 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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) X-ZM-MESSAGEID: 1657635966602100007 Content-Type: text/plain; charset="utf-8"; x-default="true" We accept TPM version in the domain XML. However, supported version depends on the host configuration (swtpm_setup binary) and thus it may be tricky for users (or mgmt applications) chose a version. Introduce machinery for reporting supported version in domain capabilities. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/formatdomaincaps.rst | 6 ++++++ src/conf/domain_capabilities.c | 1 + src/conf/domain_capabilities.h | 1 + 3 files changed, 8 insertions(+) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 384b5eb7ea..a60e610c4c 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -513,6 +513,10 @@ TPM device capabilities are exposed under the ``tpm`` = element. For instance: passthrough emulator + + 1.2 + 2.0 + ... @@ -522,6 +526,8 @@ TPM device capabilities are exposed under the ``tpm`` e= lement. For instance: Options for the ``model`` attribute of the element. ``backendModel`` Options for the ``type`` attribute of the element. +``backendVersion`` + Options for the ``version`` attribute of the element. =20 =20 Features diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 895e8d00e8..33570a51db 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -539,6 +539,7 @@ virDomainCapsDeviceTPMFormat(virBuffer *buf, =20 ENUM_PROCESS(tpm, model, virDomainTPMModelTypeToString); ENUM_PROCESS(tpm, backendModel, virDomainTPMBackendTypeToString); + ENUM_PROCESS(tpm, backendVersion, virDomainTPMVersionTypeToString); =20 FORMAT_EPILOGUE(tpm); } diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index f2eed80b15..a526969cda 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -127,6 +127,7 @@ struct _virDomainCapsDeviceTPM { virTristateBool supported; virDomainCapsEnum model; /* virDomainTPMModel */ virDomainCapsEnum backendModel; /* virDomainTPMBackendType */ + virDomainCapsEnum backendVersion; /* virDomainTPMVersion */ }; =20 STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); --=20 2.35.1 From nobody Wed May 15 02:59:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1657635961; cv=none; d=zohomail.com; s=zohoarc; b=ILK08bjm7xq2o5AYuHqO7mFUks7gCrsKT+edLtKyEAp9lxwyBepi2bXZuwJPGiJqu3tO8KouXNhGygZvebAFncYNqgEW7/X0ChDpfl/VsYnpQkQJH+88n3yW4E/RYa1/UEGfKf86b7zFVHXPYhc6ebiglIPR6lEMsG1gadozefA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657635961; 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=IZHG4NE5jdm/L5pgNyLINwSO4POn6AQvsnpbmWnuB8g=; b=YGD0Gl+RrTvjuZs09I8PCAVvaOwiBIJEoqQC0gssKEfr8DjR+bErVAuVMb/j0pkSbf/7OWGJ13IPc0EYEqYTZMaKD0W4hpE7JD2dmyx8FrslchzcfbMLqIChZEgrV1yVVlxrpWjGHXyVcV7ihZS9t2St6TNf2uh/F2l86MfT+po= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 165763596182992.40208820752355; Tue, 12 Jul 2022 07:26:01 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-93--GdoSbKXOSSIWxR2LQgvyA-1; Tue, 12 Jul 2022 10:25:58 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90C3C806017; Tue, 12 Jul 2022 14:25:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B712401E54; Tue, 12 Jul 2022 14:25:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1568A194705E; Tue, 12 Jul 2022 14:25:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2256F1947058 for ; Tue, 12 Jul 2022 14:25:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 040BA40315D; Tue, 12 Jul 2022 14:25:53 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3739492C3B for ; Tue, 12 Jul 2022 14:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657635960; 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=IZHG4NE5jdm/L5pgNyLINwSO4POn6AQvsnpbmWnuB8g=; b=MSvSCFcqvHJXuoOlSp1gy4rs6g6y/YhpB6pTkgJJo6/eAo66rEONBrG8bIHk6PnLmu5pe8 u2vhmpWXYBzttmXlqVn0HucHxVbPmmswbXyJSB2QwNShcUeNYxL0I44sFxgO4m9bZX0Qbn bUUZB9BM5X5n11toT6EECn8ZfKY9Taw= X-MC-Unique: -GdoSbKXOSSIWxR2LQgvyA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] qemu: Report supported TPM version in domcaps Date: Tue, 12 Jul 2022 16:25:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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) X-ZM-MESSAGEID: 1657635962594100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Now that we have everything prepared, we can start detecting supported TPM versions and setting corresponding values in backendModel struct. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/340 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2103119 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c3be3ecec..8586930266 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6368,9 +6368,18 @@ virQEMUCapsFillDomainDeviceTPMCaps(virQEMUCaps *qemu= Caps, =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_PASSTHROUGH)) VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYPE_PA= SSTHROUGH); - if (virTPMHasSwtpm() && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_EMULATOR)) - VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYPE_EM= ULATOR); + if (virTPMHasSwtpm()) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_EMULATOR)) + VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYP= E_EMULATOR); + if (virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM_1_2)) { + VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendVersion, VIR_DOMAIN_TPM_V= ERSION_1_2); + tpm->backendVersion.report =3D true; + } + if (virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM_2_0)) { + VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendVersion, VIR_DOMAIN_TPM_V= ERSION_2_0); + tpm->backendVersion.report =3D true; + } + } =20 /* * Need at least one frontend if it is to be usable by applications --=20 2.35.1