Skip to content

Commit 794c38e

Browse files
stefanbergerJarkko Sakkinen
authored andcommitted
tpm: Proxy driver for supporting multiple emulated TPMs
This patch implements a proxy driver for supporting multiple emulated TPMs in a system. The driver implements a device /dev/vtpmx that is used to created a client device pair /dev/tpmX (e.g., /dev/tpm10) and a server side that is accessed using a file descriptor returned by an ioctl. The device /dev/tpmX is the usual TPM device created by the core TPM driver. Applications or kernel subsystems can send TPM commands to it and the corresponding server-side file descriptor receives these commands and delivers them to an emulated TPM. The driver retrievs the TPM 1.2 durations and timeouts. Since this requires the startup of the TPM, we send a startup for TPM 1.2 as well as TPM 2. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> CC: linux-kernel@vger.kernel.org CC: linux-doc@vger.kernel.org CC: linux-api@vger.kernel.org Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
1 parent 26a0889 commit 794c38e

File tree

5 files changed

+692
-0
lines changed

5 files changed

+692
-0
lines changed

drivers/char/tpm/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,15 @@ config TCG_CRB
122122
from within Linux. To compile this driver as a module, choose
123123
M here; the module will be called tpm_crb.
124124

125+
config TCG_VTPM_PROXY
126+
tristate "VTPM Proxy Interface"
127+
depends on TCG_TPM
128+
---help---
129+
This driver proxies for an emulated TPM (vTPM) running in userspace.
130+
A device /dev/vtpmx is provided that creates a device pair
131+
/dev/vtpmX and a server-side file descriptor on which the vTPM
132+
can receive commands.
133+
134+
125135
source "drivers/char/tpm/st33zp24/Kconfig"
126136
endif # TCG_TPM

drivers/char/tpm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
2323
obj-$(CONFIG_TCG_TIS_ST33ZP24) += st33zp24/
2424
obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
2525
obj-$(CONFIG_TCG_CRB) += tpm_crb.o
26+
obj-$(CONFIG_TCG_VTPM_PROXY) += tpm_vtpm_proxy.o

0 commit comments

Comments
 (0)