From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web10.5723.1582817234602346223 for ; Thu, 27 Feb 2020 07:27:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gc6809Y0; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582817233; 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=Qy+x43M4/voAlg0TlcSyJ6LtYT/9WS2KyGFHCRz3x9c=; b=Gc6809Y0avExk5vlDzytCWV8QnePJ+7XHWlw227ZEsnopH5PKEp2ctU97LfSPaVo+XLvz/ lT44VDE7mKQpT5SWJfaUzluKpqqBiybor9aK8Bq5ANb6XcDM7mfOBmiXO3WHDOgGl3gP/9 GEn5YtAvHg7LywHsW0K7G+7uCwdnzeg= 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-454-1UPfbsjPMx6DnwQGPIBR9w-1; Thu, 27 Feb 2020 10:27:12 -0500 X-MC-Unique: 1UPfbsjPMx6DnwQGPIBR9w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1811380256A; Thu, 27 Feb 2020 15:27:11 +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 491868D540; Thu, 27 Feb 2020 15:27:04 +0000 (UTC) Subject: Re: [PATCH v4 09/11] ArmVirtPkg/ArmVirtQemu: enable the DXE phase TPM2 support module To: Ard Biesheuvel , devel@edk2.groups.io Cc: eric.auger@redhat.com, philmd@redhat.com, marcandre.lureau@redhat.com, stefanb@linux.ibm.com, leif@nuviainc.com References: <20200227144056.56988-1-ard.biesheuvel@linaro.org> <20200227144056.56988-10-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: Date: Thu, 27 Feb 2020 16:27:03 +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: <20200227144056.56988-10-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 02/27/20 15:40, Ard Biesheuvel wrote: > Enable the TPM2 support module in the DXE phase, and the associated > libraries and PCDs that it requires. This will be wired into the > measured boot support code in a subsequent patch. > > Note that Tcg2Dxe.inf is added to ArmVirtQemuFvMain.fdf.inc, which > is shared with other platforms in ArmVirtPkg, but as those will not > set the TPM2_ENABLE define, this change does not affect them. > > This patch ports (parts of) the following OvmfPkg commits to > ArmVirtQemu: > > - 0c0a50d6b3ff ("OvmfPkg: include Tcg2Dxe module", 2018-03-09) > > - b9777bb42e4f ("OvmfPkg: add Tcg2PhysicalPresenceLibQemu", 2018-05-22) > -- only to match OVMF's current lib class resolutions > > - 1ec05b81e59f ("OvmfPkg: use DxeTpmMeasurementLib if and only if > TPM2_ENABLE", 2019-07-04) > > - 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) > > Signed-off-by: Ard Biesheuvel > --- > ArmVirtPkg/ArmVirtQemu.dsc | 26 +++++++++++++++++++- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 7 ++++++ > 2 files changed, 32 insertions(+), 1 deletion(-) > > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 2f0aac5f1cb8..598ac49b3c40 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -74,10 +74,13 @@ [LibraryClasses.common] > PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf > PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf > - TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf > > !if $(TPM2_ENABLE) == TRUE > Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf > + Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf > + TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf > +!else > + TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf > !endif > > [LibraryClasses.common.PEIM] > @@ -92,6 +95,10 @@ [LibraryClasses.common.PEIM] > [LibraryClasses.common.DXE_DRIVER] > ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > > +!if $(TPM2_ENABLE) == TRUE > + Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf > +!endif > + > [LibraryClasses.common.UEFI_DRIVER] > UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > > @@ -470,6 +477,23 @@ [Components.common] > MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > > + # > + # TPM2 support > + # > +!if $(TPM2_ENABLE) == TRUE > + SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf { > + > + HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.inf > + Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.inf > + NULL|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2InstanceLibDTpm.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 > + > # > # ACPI Support > # > diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > index 31f615a9d0f9..a93a9970c8d2 100644 > --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > @@ -173,6 +173,13 @@ [FV.FvMain] > INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > > + # > + # TPM2 support > + # > +!if $(TPM2_ENABLE) == TRUE > + INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf > +!endif > + > # > # TianoCore logo (splash screen) > # > Reviewed-by: Laszlo Ersek