Skip to contentSkip to conversation

Merge tpm 2017/10/24

GIT PULL Applied Stefan Berger 2 participants 7 messages Oct 25, 2017 – Oct 26, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

The following series of patches primarily fixes a recent build problem with --disable-tpm.

Stefan

The following changes since commit 3d7196d43bfe12efe98568cb60057e273652b99b:

Merge remote-tracking branch 'remotes/kraxel/tags/usb-20171023-pull-request' into staging (2017-10-24 16:05:57 +0100)

are available in the git repository at:

git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-10-24-1

for you to fetch changes up to 298d8b81d45d2297f88d93604bd5eebfd653d6cf:

tpm: print buffers received from TPM when debugging (2017-10-25 01:05:53 -0400)

----------------------------------------------------------------
Merge tpm 2017/10/24 v1

----------------------------------------------------------------
Philippe Mathieu-Daudé (4):
tpm: add missing include
tpm: add stubs
tpm: remove unnecessary #ifdef CONFIG_TPM
vl: remove unnecessary #ifdef CONFIG_TPM

Stefan Berger (1):
tpm: print buffers received from TPM when debugging

 MAINTAINERS          |  1 +
 Makefile.objs        |  2 +-
 hw/tpm/tpm_tis.c     |  2 ++
 include/sysemu/tpm.h |  1 +
 stubs/Makefile.objs  |  1 +
 stubs/tpm.c          | 33 +++++++++++++++++++++++++++++++++
 tpm.c                |  4 ----
 vl.c                 |  2 --
 8 files changed, 39 insertions(+), 7 deletions(-)
 create mode 100644 stubs/tpm.c
Signature · 1 line
2.5.5
#1 lore raw

[Qemu-devel] [PULL v1 1/5] tpm: add missing include

From: Philippe Mathieu-Daudé <[email protected]>

else file including "sysemu/tpm.h" fails to compile:

In file included from qemu/stubs/tpm.c:2:0:
qemu/include/sysemu/tpm.h:36:19: error: implicit declaration of function ‘object_resolve_path_type’ [-Werror=implicit-function-declaration]

       Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL);
                     ^~~~~~~~~~~~~~~~~~~~~~~~
---
 include/sysemu/tpm.h | 1 +
 1 file changed, 1 insertion(+)
include/sysemu/tpm.h +1 -0
index c8afa17..d7a2bd8 100644
@@ -13,6 +13,7 @@
 #define QEMU_TPM_H
 
 #include "qemu/option.h"
+#include "qom/object.h"
 
 typedef struct TPMState TPMState;
 
Signature · 1 line
2.5.5
#2 lore raw

[Qemu-devel] [PULL v1 3/5] tpm: remove unnecessary #ifdef CONFIG_TPM

In reply to Stefan Berger

From: Philippe Mathieu-Daudé <[email protected]>

Makefile.objs now checks for $(CONFIG_TPM).

---
 tpm.c | 4 ----
 1 file changed, 4 deletions(-)
tpm.c +0 -4
index 45520f5..ab5d29e 100644
@@ -30,8 +30,6 @@ void tpm_register_model(enum TpmModel model)
     tpm_models[model] = true;
 }
 
-#ifdef CONFIG_TPM
-
 static const TPMBackendClass *
 tpm_be_find_by_type(enum TpmType type)
 {
@@ -192,8 +190,6 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optarg)
     return 0;
 }
 
-#endif /* CONFIG_TPM */
-
 /*
  * Walk the list of active TPM backends and collect information about them
  * following the schema description in qapi-schema.json.
Signature · 1 line
2.5.5
#3 lore raw

[Qemu-devel] [PULL v1 2/5] tpm: add stubs

In reply to Stefan Berger

From: Philippe Mathieu-Daudé <[email protected]>

Commit c37cacabf22 moved tpm_cleanup() in the main loop exit, however this function is not available when compiling with --disable-tpm.

Provides necessary stubs to keep code clean of #ifdef'fery.

Message-Id: <[email protected]>

---
 MAINTAINERS         |  1 +
 Makefile.objs       |  2 +-
 stubs/Makefile.objs |  1 +
 stubs/tpm.c         | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 stubs/tpm.c
MAINTAINERS +1 -0
index 1217542..2650063 100644
@@ -1544,6 +1544,7 @@ TPM
 M: Stefan Berger <[email protected]>
 S: Maintained
 F: tpm.c
+F: stubs/tpm.c
 F: hw/tpm/*
 F: include/hw/acpi/tpm.h
 F: include/sysemu/tpm*
Makefile.objs +1 -1
index d4f973a..285c6f3 100644
@@ -62,7 +62,7 @@ bt-host.o-cflags := $(BLUEZ_CFLAGS)
 common-obj-y += dma-helpers.o
 common-obj-y += vl.o
 vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS)
-common-obj-y += tpm.o
+common-obj-$(CONFIG_TPM) += tpm.o
 
 common-obj-$(CONFIG_SLIRP) += slirp/
 
stubs/Makefile.objs +1 -0
index c759479..8cfe343 100644
@@ -28,6 +28,7 @@ stub-obj-y += runstate-check.o
 stub-obj-y += set-fd-handler.o
 stub-obj-y += slirp.o
 stub-obj-y += sysbus.o
+stub-obj-y += tpm.o
 stub-obj-y += trace-control.o
 stub-obj-y += uuid.o
 stub-obj-y += vm-stop.o
stubs/tpm.c new file +33 -0
new file mode 100644
index 0000000..c18aac1
@@ -0,0 +1,33 @@
+/*
+ * TPM stubs
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "qemu/osdep.h"
+#include "sysemu/tpm.h"
+#include "qmp-commands.h"
+
+int tpm_init(void)
+{
+    return 0;
+}
+
+void tpm_cleanup(void)
+{
+}
+
+TPMInfoList *qmp_query_tpm(Error **errp)
+{
+    return NULL;
+}
+
+TpmTypeList *qmp_query_tpm_types(Error **errp)
+{
+    return NULL;
+}
+
+TpmModelList *qmp_query_tpm_models(Error **errp)
+{
+    return NULL;
+}
Signature · 1 line
2.5.5
#4 lore raw

[Qemu-devel] [PULL v1 4/5] vl: remove unnecessary #ifdef CONFIG_TPM

In reply to Stefan Berger

From: Philippe Mathieu-Daudé <[email protected]>

a stub is now provided.

---
 vl.c | 2 --
 1 file changed, 2 deletions(-)
vl.c +0 -2
index 0723835..ec29909 100644
@@ -4624,11 +4624,9 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
-#ifdef CONFIG_TPM
     if (tpm_init() < 0) {
         exit(1);
     }
-#endif
 
     /* init the bluetooth world */
     if (foreach_device_config(DEV_BT, bt_parse))
Signature · 1 line
2.5.5
#5 lore raw

[Qemu-devel] [PULL v1 5/5] tpm: print buffers received from TPM when debugging

In reply to Stefan Berger
---
 hw/tpm/tpm_tis.c | 2 ++
 1 file changed, 2 insertions(+)
hw/tpm/tpm_tis.c +2 -0
index 8c5cac5..7402528 100644
@@ -422,6 +422,8 @@ static void tpm_tis_receive_bh(void *opaque)
     s->loc[locty].r_offset = 0;
     s->loc[locty].w_offset = 0;
 
+    tpm_tis_show_buffer(&s->loc[locty].r_buffer, "tpm_tis: From TPM");
+
     if (TPM_TIS_IS_VALID_LOCTY(s->next_locty)) {
         tpm_tis_abort(s, locty);
     }
Signature · 1 line
2.5.5
#6 lore raw
In reply to Stefan Berger
Quoted 12 lines · Stefan Berger

The following series of patches primarily fixes a recent build problem with --disable-tpm.

Stefan

The following changes since commit 3d7196d43bfe12efe98568cb60057e273652b99b:

Merge remote-tracking branch 'remotes/kraxel/tags/usb-20171023-pull-request' into staging (2017-10-24 16:05:57 +0100)

are available in the git repository at:

Quoted 8 lines

git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-10-24-1

for you to fetch changes up to 298d8b81d45d2297f88d93604bd5eebfd653d6cf:

tpm: print buffers received from TPM when debugging (2017-10-25 01:05:53 -0400)

----------------------------------------------------------------
Merge tpm 2017/10/24 v1

Applied, thanks.

-- PMM