qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	stefanb@linux.vnet.ibm.com,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	f4bug@amsat.org, "Stefan Berger" <stefanb@linux.ibm.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH v13 1/6] tpm: add a "ppi" boolean property
Date: Thu, 13 Dec 2018 02:26:43 +0400	[thread overview]
Message-ID: <20181212222648.595-2-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20181212222648.595-1-marcandre.lureau@redhat.com>

The following patches implement the TPM Physical Presence Interface,
make use of a new memory region and a fw_cfg entry. Enable PPI by
default with >=4.0 machine type, to avoid migration issues.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
---
 include/hw/compat.h | 11 ++++++++++-
 hw/tpm/tpm_crb.c    |  3 +++
 hw/tpm/tpm_tis.c    |  3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/hw/compat.h b/include/hw/compat.h
index 70958328fe..db368c5c74 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -2,7 +2,16 @@
 #define HW_COMPAT_H
 
 #define HW_COMPAT_3_1 \
-    /* empty */
+    { \
+        .driver   = "tpm-crb", \
+        .property = "ppi", \
+        .value    = "false", \
+    }, \
+    { \
+        .driver   = "tpm-tis", \
+        .property = "ppi", \
+        .value    = "false", \
+    },
 
 #define HW_COMPAT_3_0 \
     /* empty */
diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index a92dd50437..d5b0ac5920 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -41,6 +41,8 @@ typedef struct CRBState {
     MemoryRegion cmdmem;
 
     size_t be_buffer_size;
+
+    bool ppi_enabled;
 } CRBState;
 
 #define CRB(obj) OBJECT_CHECK(CRBState, (obj), TYPE_TPM_CRB)
@@ -221,6 +223,7 @@ static const VMStateDescription vmstate_tpm_crb = {
 
 static Property tpm_crb_properties[] = {
     DEFINE_PROP_TPMBE("tpmdev", CRBState, tpmbe),
+    DEFINE_PROP_BOOL("ppi", CRBState, ppi_enabled, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index d9322692ee..cbb9a84a5b 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -81,6 +81,8 @@ typedef struct TPMState {
     TPMVersion be_tpm_version;
 
     size_t be_buffer_size;
+
+    bool ppi_enabled;
 } TPMState;
 
 #define TPM(obj) OBJECT_CHECK(TPMState, (obj), TYPE_TPM_TIS)
@@ -950,6 +952,7 @@ static const VMStateDescription vmstate_tpm_tis = {
 static Property tpm_tis_properties[] = {
     DEFINE_PROP_UINT32("irq", TPMState, irq_num, TPM_TIS_IRQ),
     DEFINE_PROP_TPMBE("tpmdev", TPMState, be_driver),
+    DEFINE_PROP_BOOL("ppi", TPMState, ppi_enabled, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
2.20.0

  reply	other threads:[~2018-12-12 22:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 22:26 [Qemu-devel] [PATCH v13 0/6] Add support for TPM Physical Presence interface Marc-André Lureau
2018-12-12 22:26 ` Marc-André Lureau [this message]
2018-12-13 11:07   ` [Qemu-devel] [PATCH v13 1/6] tpm: add a "ppi" boolean property Philippe Mathieu-Daudé
2018-12-12 22:26 ` [Qemu-devel] [PATCH v13 2/6] tpm: allocate/map buffer for TPM Physical Presence interface Marc-André Lureau
2018-12-13 11:10   ` Philippe Mathieu-Daudé
2018-12-12 22:26 ` [Qemu-devel] [PATCH v13 3/6] acpi: expose TPM/PPI configuration parameters to firmware via fw_cfg Marc-André Lureau
2018-12-13 11:11   ` Philippe Mathieu-Daudé
2018-12-12 22:26 ` [Qemu-devel] [PATCH v13 4/6] acpi: build TPM Physical Presence interface Marc-André Lureau
2018-12-12 22:26 ` [Qemu-devel] [PATCH v13 5/6] acpi: add ACPI memory clear interface Marc-André Lureau
2018-12-12 22:26 ` [Qemu-devel] [PATCH v13 6/6] tpm: clear RAM when "memory overwrite" requested Marc-André Lureau
2018-12-13 11:17   ` Philippe Mathieu-Daudé
2018-12-18  1:37 ` [Qemu-devel] [PATCH v13 0/6] Add support for TPM Physical Presence interface Michael S. Tsirkin
2018-12-18  9:28   ` Marc-André Lureau
2018-12-18 14:20     ` Michael S. Tsirkin
2018-12-18 17:56       ` Marc-André Lureau
2018-12-18 23:17         ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181212222648.595-2-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=imammedo@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanb@linux.ibm.com \
    --cc=stefanb@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).