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.web10.4699.1578398331230392005 for ; Tue, 07 Jan 2020 03:58:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NHK0EemI; 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=1578398330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QOXqn174GT/+MqO4jtOxh39lVuCG1/srPMvc/ZyAHxQ=; b=NHK0EemIqKGM1aWxZKzdayUcf0y9LRLYWkYQZbavH68nUUdY5+lEvdwFUlV/zr2+s6RENu z6XJxF6MvOs/MEBBmb3jsJ8ozn5OlBQOouKxviRBblJy7UQMTkvsV7w37S8f3FSVQZEJ3f gTjPHGu10uK9gOvuubIHEhJV5ghuJd0= 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-275-jsMTiERtMHKeSg-pK2_flg-1; Tue, 07 Jan 2020 06:58:48 -0500 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 9767B1902EA1; Tue, 7 Jan 2020 11:58:47 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-126.ams2.redhat.com [10.36.117.126]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0950260BEC; Tue, 7 Jan 2020 11:58:46 +0000 (UTC) Subject: Re: [PATCH 1/4] OvmfPkg/Tcg2ConfigPei: introduce a signalling PPI to depex on To: Ard Biesheuvel , devel@edk2.groups.io References: <20200107094800.4488-1-ard.biesheuvel@linaro.org> <20200107094800.4488-2-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: <2fad10cf-b885-dd88-a39a-853f9142ef1b@redhat.com> Date: Tue, 7 Jan 2020 12:58:46 +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: <20200107094800.4488-2-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: jsMTiERtMHKeSg-pK2_flg-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 01/07/20 10:47, Ard Biesheuvel wrote: > On ARM systems, the TPM does not live at a fixed address, and so we > need the platform to discover it first. So introduce a PPI that signals > that the TPM address has been discovered and recorded in the appropriate > PCD, and make Tcg2ConfigPei depex on it when built for ARM or AARCH64. I got briefly confused about this model, but after reviewing the commit message of 6cf1880fb5b6 ("OvmfPkg: add customized Tcg2ConfigPei clone", 2018-03-09), I agree the above is a good addition / good fit. > > Signed-off-by: Ard Biesheuvel > --- > OvmfPkg/OvmfPkg.dec | 4 ++++ > OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 6 +++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec > index d5fee805ef4a..10a2b714c1b4 100644 > --- a/OvmfPkg/OvmfPkg.dec > +++ b/OvmfPkg/OvmfPkg.dec > @@ -101,6 +101,10 @@ [Protocols] > gEfiLegacyInterruptProtocolGuid = {0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe}} > gEfiVgaMiniPortProtocolGuid = {0xc7735a2f, 0x88f5, 0x4882, {0xae, 0x63, 0xfa, 0xac, 0x8c, 0x8b, 0x86, 0xb3}} > > +[Ppis] > + # PPI whose presence in the PPI database signals that the TPM base address has been discovered and recorded > + gOvmfTpmDiscoveredPpiGuid = {0xb9a61ad0, 0x2802, 0x41f3, {0xb5, 0x13, 0x96, 0x51, 0xce, 0x6b, 0xd5, 0x75}} > + (1) Please rewrap the comment to 80 characters. (The DEC file is consistent in that, so I'd like to stick with it.) (2) If you agree, I'd suggest moving the [Ppis] section above the [Protocols] section, but still below the [Guids] section -- somehow, for me, that seems to match the "level of abstraction" in PPIs. But, again, this is optional. With the above addressed/considered: Reviewed-by: Laszlo Ersek Thanks, Laszlo > [PcdsFixedAtBuild] > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|0x0|UINT32|0 > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize|0x0|UINT32|1 > diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > index e34cd6210611..55684ba045b3 100644 > --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > @@ -25,6 +25,7 @@ [Sources] > [Packages] > MdePkg/MdePkg.dec > MdeModulePkg/MdeModulePkg.dec > + OvmfPkg/OvmfPkg.dec > SecurityPkg/SecurityPkg.dec > > [LibraryClasses] > @@ -43,5 +44,8 @@ [Ppis] > [Pcd] > gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid ## PRODUCES > > -[Depex] > +[Depex.IA32, Depex.X64] > TRUE > + > +[Depex.ARM, Depex.AARCH64] > + gOvmfTpmDiscoveredPpiGuid >