From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web09.380.1582677078670393034 for ; Tue, 25 Feb 2020 16:31:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WdiXsPzq; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582677077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vodINw+O7hf+ocbU3gLKlp3sQdm6cO4imhwjoFJHhHQ=; b=WdiXsPzqTByrHOK8K9VT5skNV61388oAJgPyf8PSCaOJGl5hJOynW2QFwbhhiqwa9is6kO 93B+VXqV8PnLdctAlxCWL1Un7l8Z0v9iCancTUehtpQ/QvUQY2+50xyoKfFhFSb0csEr8p wIYUheeuy/wuT1XIU4zR3/Kv2W07VzQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-JPfpBJVAPomQ0udkX71d2w-1; Tue, 25 Feb 2020 19:31:16 -0500 X-MC-Unique: JPfpBJVAPomQ0udkX71d2w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 221F1A0CBF; Wed, 26 Feb 2020 00:31:15 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-104.ams2.redhat.com [10.36.117.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27F9E60C18; Wed, 26 Feb 2020 00:31:07 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 3/5] ArmVirtPkg/PlatformPeiLib: discover the TPM base address from the DT From: "Laszlo Ersek" 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 References: <20200225104449.22453-1-ard.biesheuvel@linaro.org> <20200225104449.22453-4-ard.biesheuvel@linaro.org> <74e50cfd-148b-7085-417b-b5613f1a7f2c@redhat.com> Message-ID: Date: Wed, 26 Feb 2020 01:31:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <74e50cfd-148b-7085-417b-b5613f1a7f2c@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 >> --- >> 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