[edk2-devel] [PATCH v2 3/5] ArmVirtPkg/PlatformPeiLib: discover the TPM base address from the DT

Laszlo Ersek lersek at redhat.com
Wed Feb 26 00:31:07 UTC 2020


On 02/26/20 01:24, Laszlo Ersek wrote:
> On 02/25/20 11:44, Ard Biesheuvel wrote:
>> Introduce a boolean PCD that tells us whether TPM support is enabled
>> in the build, and if it is, record the TPM base address in the existing
>> routine that traverses the device tree in the platform PEIM.
>>
>> If a TPM is found, install the gOvmfTpmDiscoveredPpiGuid signalling PPI
>> that will unlock the dispatch of OvmfPkg's Tcg2ConfigPei. If TPM2
>> support is enabled in the build but no TPM2 device is found, install the
>> gPeiTpmInitializationDonePpiGuid PPI, which is normally installed by
>> Tcg2ConfigPei if no TPM2 is found, but in our case Tcg2ConfigPei will
>> never run so let's do it here instead.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
>> ---
>>  ArmVirtPkg/ArmVirt.dsc.inc                           |   6 ++
>>  ArmVirtPkg/ArmVirtPkg.dec                            |   6 ++
>>  ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c   | 101 ++++++++++++++++++--
>>  ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf |  19 +++-
>>  4 files changed, 118 insertions(+), 14 deletions(-)
>>
>> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
>> index 10037c938eb8..abb253fdf76a 100644
>> --- a/ArmVirtPkg/ArmVirt.dsc.inc
>> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
>> @@ -366,6 +366,12 @@ [PcdsFixedAtBuild.common]
>>    #
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xC000000000007FD1
>>  
>> +[PcdsPatchableInModule]
>> +  # we need a default resolution for this PCD that supports PcdSet64(),
>> +  # even though any actual calls will be compiled out on builds that have
>> +  # gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled == FALSE
>> +  gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
>> +
>>  [Components.common]
>>    #
>>    # Ramdisk support
> 
> I don't understand why this is patchable-in-module, and not dynamic. I
> feel like it's a "textbook case" of a dynamic PCD. What am I missing?

I've found the dynamic default in patch v2 5/5, in ArmVirtQemu.dsc, so I
guess this is for all *other* ArmVirt platforms. Is that correct?

Can we add the PatchPcd to the other DSC files then (ArmVirtQemuKernel
and ArmVirtXen)? I'm a bit uncomfortable with ArmVirtQemu.dsc describing
two access methods for the same PCD, even though (apparently) the
dynamic one will take effect (?)

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54820): https://edk2.groups.io/g/devel/message/54820
Mute This Topic: https://groups.io/mt/71530903/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list