dm: TPM2 passthrough for post-launched VM with eventlog support

This patch enables TPM2 passthrough to post-launched VM with eventlog
support.
User starts by providing command line "--acpidev_pt <TPM2_HID>",
of which the <TPM2_HID> will be searched from /proc/iomem for TPM2 buffer
start address and size. Furthermore, If TPM2 eventlog is supported,
TPM2 eventlog information will be retrieved from sysfs TPM2 table and
passed-through as well.

v4 -> v5:
move tpm2 related logic from acpi.c to tpm.c
multiple API rename

Tracked-On: #6686
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Yifan Liu
2021-10-15 14:34:23 +08:00
committed by wenlingz
parent ad5eb6e23d
commit 00631f113f
6 changed files with 226 additions and 80 deletions

View File

@@ -65,6 +65,9 @@ struct acpi_table_hdr {
/* All dynamic table entry no. */
#define NHLT_ENTRY_NO 8
#define EFPRINTF(...) fprintf(__VA_ARGS__)
#define EFFLUSH(x) fflush(x)
void acpi_table_enable(int num);
uint32_t get_acpi_base(void);
uint32_t get_acpi_table_length(void);