Skip to content

Commit 27c77b1

Browse files
committed
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-06-23-1' into staging
Merge tpm 2020/06/23 v1 # gpg: Signature made Tue 23 Jun 2020 12:35:03 BST # gpg: using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <[email protected]>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * remotes/stefanberger/tags/pull-tpm-2020-06-23-1: tpm: Move backend code under the 'backends/' directory hw/tpm: Make 'tpm_util.h' publicly accessible as "sysemu/tpm_util.h" hw/tpm: Move DEFINE_PROP_TPMBE() macro to 'tmp_prop.h' local header hw/tpm: Move few declarations from 'tpm_util.h' to 'tpm_int.h' hw/tpm: Make TRACE_TPM_UTIL_SHOW_BUFFER check local to tpm_util.c hw/tpm: Remove unnecessary 'tpm_int.h' header inclusion hw/tpm: Move 'hw/acpi/tpm.h' inclusion from header to sources hw/tpm: Include missing 'qemu/option.h' header hw/tpm: Do not include 'qemu/osdep.h' in header hw/tpm: Rename TPMDEV as TPM_BACKEND in Kconfig backends: Add TPM files into their own directory docs/specs/tpm: Correct header path name Signed-off-by: Peter Maydell <[email protected]>
2 parents d4b7831 + ca64b08 commit 27c77b1

29 files changed

+136
-103
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,7 @@ F: hw/tpm/*
24312431
F: include/hw/acpi/tpm.h
24322432
F: include/sysemu/tpm*
24332433
F: qapi/tpm.json
2434-
F: backends/tpm.c
2434+
F: backends/tpm/
24352435
F: tests/qtest/*tpm*
24362436
T: git https://github.com/stefanberger/qemu-tpm.git tpm-next
24372437

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ MINIKCONF_ARGS = \
418418
CONFIG_LINUX=$(CONFIG_LINUX) \
419419
CONFIG_PVRDMA=$(CONFIG_PVRDMA)
420420

421-
MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
421+
MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
422422
MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
423423
MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
424424

Makefile.objs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ trace-events-subdirs =
125125
trace-events-subdirs += accel/kvm
126126
trace-events-subdirs += accel/tcg
127127
trace-events-subdirs += backends
128+
trace-events-subdirs += backends/tpm
128129
trace-events-subdirs += crypto
129130
trace-events-subdirs += monitor
130131
ifeq ($(CONFIG_USER_ONLY),y)

backends/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source tpm/Kconfig

backends/Makefile.objs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
common-obj-y += rng.o rng-egd.o rng-builtin.o
22
common-obj-$(CONFIG_POSIX) += rng-random.o
33

4-
common-obj-$(CONFIG_TPM) += tpm.o
4+
common-obj-$(CONFIG_TPM) += tpm/
55

66
common-obj-y += hostmem.o hostmem-ram.o
77
common-obj-$(CONFIG_POSIX) += hostmem-file.o

backends/tpm/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
config TPM_BACKEND
2+
bool
3+
depends on TPM
4+
5+
config TPM_PASSTHROUGH
6+
bool
7+
default y
8+
# FIXME: should check for x86 host as well
9+
depends on TPM_BACKEND && LINUX
10+
11+
config TPM_EMULATOR
12+
bool
13+
default y
14+
depends on TPM_BACKEND

backends/tpm/Makefile.objs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
common-obj-y += tpm_backend.o
2+
common-obj-y += tpm_util.o
3+
common-obj-$(CONFIG_TPM_PASSTHROUGH) += tpm_passthrough.o
4+
common-obj-$(CONFIG_TPM_EMULATOR) += tpm_emulator.o
File renamed without changes.

hw/tpm/tpm_emulator.c renamed to backends/tpm/tpm_emulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include "qemu/sockets.h"
3333
#include "io/channel-socket.h"
3434
#include "sysemu/tpm_backend.h"
35+
#include "sysemu/tpm_util.h"
3536
#include "tpm_int.h"
36-
#include "tpm_util.h"
3737
#include "tpm_ioctl.h"
3838
#include "migration/blocker.h"
3939
#include "migration/vmstate.h"

hw/tpm/tpm_int.h renamed to backends/tpm/tpm_int.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
* This work is licensed under the terms of the GNU GPL, version 2 or later.
1010
* See the COPYING file in the top-level directory.
1111
*/
12-
#ifndef TPM_TPM_INT_H
13-
#define TPM_TPM_INT_H
12+
#ifndef BACKENDS_TPM_INT_H
13+
#define BACKENDS_TPM_INT_H
14+
15+
#include "qemu/option.h"
16+
#include "sysemu/tpm.h"
1417

1518
#define TPM_STANDARD_CMDLINE_OPTS \
1619
{ \
@@ -72,4 +75,14 @@ struct tpm_resp_hdr {
7275
#define TPM_RC_FAILURE 0x101
7376
#define TPM_RC_LOCALITY 0x907
7477

75-
#endif /* TPM_TPM_INT_H */
78+
int tpm_util_get_buffer_size(int tpm_fd, TPMVersion tpm_version,
79+
size_t *buffersize);
80+
81+
typedef struct TPMSizedBuffer {
82+
uint32_t size;
83+
uint8_t *buffer;
84+
} TPMSizedBuffer;
85+
86+
void tpm_sized_buffer_reset(TPMSizedBuffer *tsb);
87+
88+
#endif /* BACKENDS_TPM_INT_H */

0 commit comments

Comments
 (0)