On 15.09.2022 22:40, Jennifer Herbert wrote: > --- a/tools/firmware/hvmloader/config.h > +++ b/tools/firmware/hvmloader/config.h > @@ -56,6 +56,7 @@ extern uint8_t ioapic_version; > #define PCI_ISA_IRQ_MASK 0x0c20U /* ISA IRQs 5,10,11 are PCI connected */ > > #define ACPI_TIS_HDR_ADDRESS 0xFED40F00UL > +#define ACPI_CRB_HDR_ADDRESS 0xFED40034UL
I understand it may not be feasible to express this here as a proper derivation from other constants, but then you want to have a BUILD_BUG_ON() somewhere making (and guaranteeing) the connection. Thi may of course involve moving the #define to a header which both hvmloader and libacpi can (legitimately) include. > --- a/tools/firmware/hvmloader/util.c > +++ b/tools/firmware/hvmloader/util.c > @@ -1009,6 +1009,13 @@ 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_hdr = (uint16_t *)ACPI_CRB_HDR_ADDRESS; > + > + mem_hole_populate_ram(TPM_LOG_AREA_ADDRESS >> PAGE_SHIFT, > TPM_LOG_SIZE >> PAGE_SHIFT); Nit: Long line. > + memset((void *)(TPM_LOG_AREA_ADDRESS), 0, TPM_LOG_SIZE); No need to parenthesize the operand of the cast? Jan