History

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>

Stefan Berger committed 10 years ago

Commit 6f996121 parent 2f9f5375 files · +692 −0Browse files

Showing the changes to include/uapi/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/Kbuild +1 −0
  2. include/uapi/linux/vtpm_proxy.h +36 −0
include/uapi/linux/Kbuild+1−0
@@ -454,6 +454,7 @@ header-y += virtio_scsi.h · 453 unmodified lines
454454 header-y += virtio_types.h
455455 header-y += vm_sockets.h
456456 header-y += vt.h
457+header-y += vtpm_proxy.h
457458 header-y += wait.h
458459 header-y += wanrouter.h
459460 header-y += watchdog.h
include/uapi/linux/vtpm_proxy.h+36−0
@@ -0,0 +1,36 @@
1+/*
2+ * Definitions for the VTPM proxy driver
3+ * Copyright (c) 2015, 2016, IBM Corporation
4+ *
5+ * This program is free software; you can redistribute it and/or modify it
6+ * under the terms and conditions of the GNU General Public License,
7+ * version 2, as published by the Free Software Foundation.
8+ *
9+ * This program is distributed in the hope it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12+ * more details.
13+ */
14+
15+#ifndef _UAPI_LINUX_VTPM_PROXY_H
16+#define _UAPI_LINUX_VTPM_PROXY_H
17+
18+#include <linux/types.h>
19+#include <linux/ioctl.h>
20+
21+/* ioctls */
22+
23+struct vtpm_proxy_new_dev {
24+ __u32 flags; /* input */
25+ __u32 tpm_num; /* output */
26+ __u32 fd; /* output */
27+ __u32 major; /* output */
28+ __u32 minor; /* output */
29+};
30+
31+/* above flags */
32+#define VTPM_PROXY_FLAG_TPM2 1 /* emulator is TPM 2 */
33+
34+#define VTPM_PROXY_IOC_NEW_DEV _IOWR(0xa1, 0x00, struct vtpm_proxy_new_dev)
35+
36+#endif /* _UAPI_LINUX_VTPM_PROXY_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t