On 26/04/2023 21:29, Jason Andryuk wrote:
On Tue, Apr 25, 2023 at 1:48 PM Jennifer Herbert
<jennifer.herb...@citrix.com> wrote:
This patch introduces an optional TPM 2 interface definition to the ACPI table,
which is to be used as part of a vTPM 2 implementation.

Signed-off-by: Jennifer Herbert <jennifer.herb...@citrix.com>
---
...
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index f39a8e584f..51272530fe 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -1009,6 +1009,15 @@ void hvmloader_acpi_build_tables(struct acpi_config 
*config,
          config->table_flags |= ACPI_HAS_TPM;
          config->tis_hdr = (uint16_t *)ACPI_TIS_HDR_ADDRESS;
          break;
+
+    case 2:
+        config->table_flags |= ACPI_HAS_TPM;
+        config->crb_id = (uint16_t *)TPM_CRB_INTF_ID;
+
+        mem_hole_populate_ram(TPM_LOG_AREA_ADDRESS >> PAGE_SHIFT,
+                              TPM_LOG_SIZE >> PAGE_SHIFT);
+        memset((void *)TPM_LOG_AREA_ADDRESS, 0, TPM_LOG_SIZE);
TPM_LOG_AREA_ADDRESS is reserved in the e820 table since it is the
high memory range after the ACPI data, correct?

This is my understanding yes.  We made sure to put it well clear of the qemu impremnted TPM, just incase it later decided to support more localitie levels,  but still well within the RESERVED area, in the e820.


-jenny



Reviewed-by: Jason Andryuk <jandr...@gmail.com>

Thanks,
Jason


Reply via email to