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.web12.1080.1582791851818750757 for ; Thu, 27 Feb 2020 00:24:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eHdCr1gn; 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=1582791850; 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=sRWyszwQ6fkyaUV10ViKOx6fGJVaVyUh85N8dKe6zn4=; b=eHdCr1gnVZl1lyaKVOhc6yLY6htySeLJkbEmbEL9CuZUmbXYnM3HRdnkW2yPy5FOdz6L3s LTYE/cWvvPtPPuTLAu+6E0E5u8DLBFkM3AU1IXreey0UOWtVbyYEmJKd8FOLt4ESwVzmpn 7URwUmQrVK757mE/p+pjz9DP8+h4oE8= 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-327-ph3ypsoQP7SrcH8g6aQ-Dg-1; Thu, 27 Feb 2020 03:24:09 -0500 X-MC-Unique: ph3ypsoQP7SrcH8g6aQ-Dg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2667B801E6C; Thu, 27 Feb 2020 08:24:08 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34F6F10027A4; Thu, 27 Feb 2020 08:24:01 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v3 6/9] ArmVirtPkg/ArmVirtQemu: enable TPM2 support in the PEI phase 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: <20200226190514.31395-1-ard.biesheuvel@linaro.org> <20200226190514.31395-7-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: <223151e0-2b4d-5944-ee21-e4ba1737af89@redhat.com> Date: Thu, 27 Feb 2020 09:24:00 +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: <20200226190514.31395-7-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 20:05, Ard Biesheuvel wrote: > Incorporate the PEI components and the associated library class > resolutions and PCD declarations to enable TPM2 support in the > PEI phase. > > Signed-off-by: Ard Biesheuvel > --- > ArmVirtPkg/ArmVirtQemu.dsc | 20 ++++++++++++++++++++ > ArmVirtPkg/ArmVirtQemu.fdf | 2 ++ > 2 files changed, 22 insertions(+) > > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index d1757cdba671..8950116dacab 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -75,11 +75,17 @@ [LibraryClasses.common] > PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf > PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf > > +!if $(TPM2_ENABLE) == TRUE > + Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf > +!endif > + > [LibraryClasses.common.PEIM] > ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf > > !if $(TPM2_ENABLE) == TRUE > + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > ResetSystemLib|MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf > + Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf > !endif > > [LibraryClasses.common.DXE_DRIVER] > @@ -248,6 +254,10 @@ [PcdsDynamicDefault.common] > # TPM2 support > # > gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0 > +!if $(TPM2_ENABLE) == TRUE > + gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} > + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2HashMask|0 > +!endif > > [PcdsDynamicHii] > gArmVirtTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gArmVirtVariableGuid|0x0|FALSE|NV,BS > @@ -278,6 +288,16 @@ [Components.common] > > ResetSystemLib|ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf > } > + OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > + SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { > + > + HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf > + NULL|SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.inf > + NULL|SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.inf > + NULL|SecurityPkg/Library/HashInstanceLibSha384/HashInstanceLibSha384.inf > + NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512.inf > + NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf > + } > !endif > > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { > diff --git a/ArmVirtPkg/ArmVirtQemu.fdf b/ArmVirtPkg/ArmVirtQemu.fdf > index f55918d26b06..b5e2253295fe 100644 > --- a/ArmVirtPkg/ArmVirtQemu.fdf > +++ b/ArmVirtPkg/ArmVirtQemu.fdf > @@ -115,6 +115,8 @@ [FV.FVMAIN_COMPACT] > > !if $(TPM2_ENABLE) == TRUE > INF MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf > + INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > + INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf > !endif > > FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { > I'm OK with this patch; I have two requests: (1) Please add the following to the commit message: ----- This patch ports (parts of) the following OvmfPkg commits to ArmVirtQemu: - 6cf1880fb5b6 ("OvmfPkg: add customized Tcg2ConfigPei clone", 2018-03-09) - 4672a4892867 ("OvmfPkg: include Tcg2Pei module", 2018-03-09) - b9130c866dc0 ("OvmfPkg: link Sha384 and Sha512 support into Tcg2Pei and Tcg2Dxe", 2018-08-16) - 5d3ef15da7c3 ("OvmfPkg: link SM3 support into Tcg2Pei and Tcg2Dxe", 2019-07-19) ----- (2) I don't understand why PcdTpm2HashMask is necessary, especially that it diverges from the "SecurityPkg.dec" default. Please either drop the PCD, or (more likely) add a sentence to the commit message explaining why we're setting it to zero (unlike in OVMF). With those addressed: Reviewed-by: Laszlo Ersek Thanks! Laszlo