[SeaBIOS] [PATCH v2 2/3] tcgbios: Add TPM Physical Presence interface support
Laszlo Ersek
lersek at redhat.com
Tue Jan 16 21:47:55 CET 2018
On 01/16/18 19:36, Kevin O'Connor wrote:
> On Tue, Jan 16, 2018 at 11:41:02AM -0500, Stefan Berger wrote:
>> Add support for TPM 1.2 and TPM 2 Physical Presence interface (PPI).
>> A shared memory structure is located at 0xfffe f000 - 0xfffe f3ff
>> that SeaBIOS initializes (unless it has already been intialized) and
>> then searches for a code it is supposed to act upon. A code typically
>> requires that one or more TPM commands are being sent.
>
> If I'm understanding the code correctly, it no longer hardcodes
> 0xfffef000 (great!). The commit comment should also be updated.
>
>>
>> The underlying spec can be accessed from this page here:
>>
>> https://trustedcomputinggroup.org/tcg-physical-presence-interface-specification/
>>
>> Version 1.30 is implemented.
>>
>> Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
>> ---
>> src/post.c | 4 +++
>> src/std/acpi.h | 10 ++++++
>> src/std/tcg.h | 31 ++++++++++++++++++
>> src/tcgbios.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> src/tcgbios.h | 3 ++
>> 5 files changed, 147 insertions(+)
[...]
>> --- a/src/std/acpi.h
>> +++ b/src/std/acpi.h
>> @@ -320,4 +320,14 @@ struct tpm2_descriptor_rev2
>> u64 log_area_start_address;
>> } PACKED;
>>
>> +#define QEMU_SIGNATURE 0x554d4551
>> +struct qemu_descriptor
>> +{
>> + ACPI_TABLE_HEADER_DEF
>> + u32 tpmppi_address;
>> + u8 tpm_version; /* 1 = 1.2, 2 = 2 */
>> + u8 tpmppi_version;
>> +#define TPM_PPI_VERSION_1_30 1
>> +} PACKED;
>
> I'm confused at the purpose of this acpi table. If I'm understanding
> it correctly, it is purely to pass information from QEMU to SeaBIOS
> (and perhaps OVMF?). If so, I don't think this is a good way to do it
> - a regular fw_cfg setting seems simpler (and less likely to cause
> problems with OSes).
I agree; if the firmware is supposed to consume information from QEMU
for locating the register block of this platform device, please expose
the address in a new fw_cfg file.
Thanks!
Laszlo
More information about the SeaBIOS
mailing list