|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 2/4] hvmloader: Support the TIS interface for TPM 2.0
Read platform/tpm-interface to determine whether a TPM 2.0 device uses
the TIS or CRB interface, and pass it to libacpi so the matching SSDT
and TPM2 table are built. The key defaults to "crb" when absent,
preserving the existing behaviour. TPM 1.2 always uses TIS.
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
tpm-interface is inconsistent with tpm_version, but it seems like "-" is
more common than "_".
docs/misc/xenstore-paths.pandoc | 12 +++++++++++-
tools/firmware/hvmloader/util.c | 12 +++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/docs/misc/xenstore-paths.pandoc b/docs/misc/xenstore-paths.pandoc
index b8b02e007a..c24ffe342e 100644
--- a/docs/misc/xenstore-paths.pandoc
+++ b/docs/misc/xenstore-paths.pandoc
@@ -280,10 +280,20 @@ circumstances where the generation ID needs to be changed.
The TPM version to be probed for.
A value of 1 indicates to probe for TPM 1.2, whereas a value of 2
-indicates that a TPM 2.0 using CRB should be probed.
+indicates that a TPM 2.0 should be probed, using the interface given by
+~/platform/tpm-interface.
A value of 0 or an invalid value will result in no TPM being probed.
If unset, a default of 1 is assumed.
+#### ~/platform/tpm-interface = ("tis"|"crb") [HVM,INTERNAL]
+
+The TPM interface to be probed for when ~/platform/tpm_version is 2.
+
+A value of "tis" indicates the TPM Interface Specification (FIFO)
+interface, whereas "crb" indicates the Command Response Buffer
+interface. If unset or set to any other value, "crb" is assumed.
+TPM 1.2 always uses the TIS interface and ignores this key.
+
### Frontend device paths
Paravirtual device frontends are generally specified by their own
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index e651342681..fe3e6ab1b9 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -922,7 +922,17 @@ void hvmloader_acpi_build_tables(struct acpi_config
*config,
case 2:
config->table_flags |= ACPI_HAS_TPM;
- config->crb_id = (uint16_t *)TPM_CRB_INTF_ID;
+ if ( !strcmp(xenstore_read("platform/tpm-interface", "crb"),
+ "tis") )
+ {
+ config->tis_hdr = (uint16_t *)ACPI_TIS_HDR_ADDRESS;
+ config->tpm_interface = ACPI_TPM_INTERFACE_TIS;
+ }
+ else
+ {
+ config->crb_id = (uint16_t *)TPM_CRB_INTF_ID;
+ config->tpm_interface = ACPI_TPM_INTERFACE_CRB;
+ }
mem_hole_populate_ram(TPM_LOG_AREA_ADDRESS >> PAGE_SHIFT,
TPM_LOG_SIZE >> PAGE_SHIFT);
--
2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |