|
From: | Stefan Berger |
Subject: | Re: [Qemu-devel] [PATCH v2 4/4] acpi: build TPM Physical Presence interface |
Date: | Mon, 12 Feb 2018 15:17:21 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 02/12/2018 02:45 PM, Kevin O'Connor wrote:
On Fri, Feb 09, 2018 at 03:19:31PM -0500, Stefan Berger wrote:I have played around with this patch and some modifications to EDK2. Though for EDK2 the question is whether to try to circumvent their current implementation that uses SMM or use SMM. With this patch so far I circumvent it, which is maybe not a good idea. The facts for EDK2's PPI: - from within the OS a PPI code is submitted to ACPI and ACPI enters SMM via an SMI and the PPI code is written into a UEFI variable. For this ACPI uses the memory are at 0xFFFF 0000 to pass parameters from the OS (via ACPI) to SMM. This is declared in ACPI with an OperationRegion() at that address. Once the machine is rebooted, UEFI reads the variable and finds the PPI code and reacts to it.I'm a bit confused by this. The top 1M of the first 4G of ram is generally mapped to the flash device on real machines. Indeed, this is part of the mechanism used to boot an X86 machine - it starts execution from flash at 0xfffffff0. This is true even on modern machines. So, it seems strange that UEFI is pushing a code through a memory device at 0xffff0000. I can't see how that would be portable. Are you sure the memory write to 0xffff0000 is not just a trigger to invoke the SMI?
I base this on the code here: https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl#L81 OperationRegion (TNVS, SystemMemory, 0xFFFF0000, 0xF0)
It sounds as if the ultimate TPM interface that must be supported is the ACPI DSDT methods. Since you're crafting the DSDT table yourself, why does there need to be two different backends - why can't the same mechanism be used for both SeaBIOS and UEFI? Is this because you are looking to reuse TPM code already in UEFI that requires a specific interface?
UEFI uses SMM to write the PPI code into a UEFI variable that it then presumably stores back to NVRAM. With SeaBIOS I would go the path of having the ACPI code write the code in the OperationRegion() and leave it at that, so not invoke SMM. EDK2 also reads the result of the operation from a register that SMM uses to pass a return value through. We wouldn't need that for SeaBIOS.
Stefan
-Kevin
[Prev in Thread] | Current Thread | [Next in Thread] |