[PATCH v3 0/2] acpi: Make TPM version configurable.

Jennifer Herbert posted 2 patches 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230425174733.795961-1-jennifer.herbert@citrix.com
There is a newer version of this series
docs/misc/xenstore-paths.pandoc |  10 +++
tools/firmware/hvmloader/util.c |  28 +++++++--
tools/libacpi/Makefile          |   3 +-
tools/libacpi/acpi2_0.h         |  32 ++++++++++
tools/libacpi/build.c           | 106 +++++++++++++++++++++++---------
tools/libacpi/libacpi.h         |   4 +-
tools/libacpi/ssdt_tpm2.asl     |  36 +++++++++++
7 files changed, 183 insertions(+), 36 deletions(-)
create mode 100644 tools/libacpi/ssdt_tpm2.asl
[PATCH v3 0/2] acpi: Make TPM version configurable.
Posted by Jennifer Herbert 1 year ago
This patch makes the TPM version, for which the ACPI library probes,
configurable.
Find following version 3 of this patche series.  Appoliges for it
taking so long, and my previous version missing some changes I intended to
share.

Have renamed the TPM_CRB constants to better match the TPM
specification.  (They where previously trying to stay consistent with the
TIS code)
Have moved some ACPI register locations to acpi2_0.h to such that both
TPM register offsets are defined together, so that their relation can be
better understood.  Have  also added additional comments to explain these
constants.

Changed the defaults, such that it will act exactly as is current,
(which is to attempt to probe for TPM 1.2) unless explicitly set to no
TPM or TPM 2, so not to regress anything.
Addressed veriouse style issues.
Moved tpm_version field up in acpi_config for better alignment.

Add a new xenstore key 'tpm_version', which xenopsd is setting to 2.  If
not set, it defaults to '1' probing for tpm 1.2 as before.

A note on the use of CRB:  QEMU implements both TIS and CRB interfaces
for TPM2. We use this CRB interface as defined by the TCG PTP
specification,
as it is thought to be the more modern interface and preferred for the
TPM2.0 only world.
TIS is PC specific, implemented with an ISA bus device in QEMU, whereas
I think CRB is more generic and would be suitable for
use on other platforms like ARM.  While I read here is some confusion
about the Mobile CRB specification regrading locality, I don't 
think this is a problem for our use case.  However, should someone
decide they need to use TIS with TPM2, I don't believe this patch series
would exclude the option for this to be added later, since struct
acpi_config does allow a TIS to be supplied instead of CRB for version
2.

Jennifer Herbert (2):
  acpi: Make TPM version configurable.
  acpi: Add TPM2 interface definition.

 docs/misc/xenstore-paths.pandoc |  10 +++
 tools/firmware/hvmloader/util.c |  28 +++++++--
 tools/libacpi/Makefile          |   3 +-
 tools/libacpi/acpi2_0.h         |  32 ++++++++++
 tools/libacpi/build.c           | 106 +++++++++++++++++++++++---------
 tools/libacpi/libacpi.h         |   4 +-
 tools/libacpi/ssdt_tpm2.asl     |  36 +++++++++++
 7 files changed, 183 insertions(+), 36 deletions(-)
 create mode 100644 tools/libacpi/ssdt_tpm2.asl

-- 
2.39.1