From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, ard.biesheuvel@linaro.org
Cc: eric.auger@redhat.com, philmd@redhat.com,
marcandre.lureau@redhat.com, stefanb@linux.ibm.com,
leif@nuviainc.com
Subject: Re: [edk2-devel] [PATCH v2 3/5] ArmVirtPkg/PlatformPeiLib: discover the TPM base address from the DT
Date: Wed, 26 Feb 2020 01:31:07 +0100 [thread overview]
Message-ID: <ef1bfbf8-567c-b530-e0b5-5bc368a5448d@redhat.com> (raw)
In-Reply-To: <74e50cfd-148b-7085-417b-b5613f1a7f2c@redhat.com>
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@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
next prev parent reply other threads:[~2020-02-26 0:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-25 10:44 [PATCH v2 0/5] ArmVirtPkg: implement measured boot for ArmVirtQemu Ard Biesheuvel
2020-02-25 10:44 ` [PATCH v2 1/5] OvmfPkg/Tcg2ConfigPei: introduce a signalling PPI to depex on Ard Biesheuvel
2020-02-25 10:44 ` [PATCH v2 2/5] ArmVirtPkg/PlatformPeiLib: make PcdLib dependency explicit in .INF Ard Biesheuvel
2020-02-26 0:05 ` [edk2-devel] " Laszlo Ersek
2020-02-25 10:44 ` [PATCH v2 3/5] ArmVirtPkg/PlatformPeiLib: discover the TPM base address from the DT Ard Biesheuvel
2020-02-26 0:24 ` [edk2-devel] " Laszlo Ersek
2020-02-26 0:31 ` Laszlo Ersek [this message]
2020-02-26 10:38 ` Ard Biesheuvel
2020-02-25 10:44 ` [PATCH v2 4/5] ArmVirtPkg: implement ArmVirtPsciResetSystemPeiLib Ard Biesheuvel
2020-02-26 0:26 ` [edk2-devel] " Laszlo Ersek
2020-02-25 10:44 ` [PATCH v2 5/5] ArmVirtPkg/ArmVirtQemu: add optional support for TPM2 measured boot Ard Biesheuvel
2020-02-26 0:40 ` [edk2-devel] " Laszlo Ersek
2020-02-26 10:41 ` Ard Biesheuvel
2020-02-26 10:49 ` Laszlo Ersek
2020-02-26 10:50 ` Ard Biesheuvel
2020-02-25 10:49 ` [PATCH v2 0/5] ArmVirtPkg: implement measured boot for ArmVirtQemu Ard Biesheuvel
2020-02-26 0:17 ` [edk2-devel] " Laszlo Ersek
2020-02-26 10:44 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef1bfbf8-567c-b530-e0b5-5bc368a5448d@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox