From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.883.1582790827562949878 for ; Thu, 27 Feb 2020 00:07:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MtOUtJGH; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582790826; 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=AfVGPwBT7O1jZOwP3hHzo0y6oDjdiUWOfPmz9rsADvg=; b=MtOUtJGHsU7FgC6C3URiia1JV3yBVrUJQX+77TvoOcWlMjhCMVVwreA0Xmn4WgX0100DsK N0pJLsyGy9XZlDJIZOOmsWr5BuXY020QDTMrB2HwZ5imuk0M+IspylgpTTLwRDi9v63UO0 QVNlSLgI8v4KfpaikkFfuMVStQ+SD1k= 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-489-3yV3wtbNP826Au2pRTRqaw-1; Thu, 27 Feb 2020 03:07:05 -0500 X-MC-Unique: 3yV3wtbNP826Au2pRTRqaw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E13D113F6; Thu, 27 Feb 2020 08:07:03 +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 0BE365C545; Thu, 27 Feb 2020 08:06:56 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v3 5/9] ArmVirtPkg/ArmVirtQemu: add ResetSystem PEIM for upcoming TPM2 support 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-6-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: <1c1125b7-95ab-56c0-9933-e22e9b9d513c@redhat.com> Date: Thu, 27 Feb 2020 09:06:56 +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-6-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: > As a first step in gradually adding TPM2 support to ArmVirtQemu, add > the TPM2_ENABLE configurable to the [Defines] section, and if it is > set, add the ResetSystem PEIM to the build, along with the library > class references that we will need to support it: > - wire ArmVirtPsciResetSystemPeiLib into the ResetSystem PEIM itself, > which will be in charge of performing the actual reset > - add PeiResetSystemLib as the common ResetSystemLib resolution for > PEIM class modules, so that other PEIMs will invoke the PPI > published by the ResetSystem PEIM. > > Signed-off-by: Ard Biesheuvel > --- > ArmVirtPkg/ArmVirtQemu.dsc | 14 ++++++++++++++ > ArmVirtPkg/ArmVirtQemu.fdf | 4 ++++ > 2 files changed, 18 insertions(+) > > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 7d05415d0f93..d1757cdba671 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -29,6 +29,7 @@ [Defines] > # > DEFINE TTY_TERMINAL = FALSE > DEFINE SECURE_BOOT_ENABLE = FALSE > + DEFINE TPM2_ENABLE = FALSE > > # > # Network definition > @@ -77,6 +78,10 @@ [LibraryClasses.common] > [LibraryClasses.common.PEIM] > ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf > > +!if $(TPM2_ENABLE) == TRUE > + ResetSystemLib|MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf > +!endif > + > [LibraryClasses.common.DXE_DRIVER] > ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > > @@ -100,6 +105,8 @@ [PcdsFeatureFlag.common] > > gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE > > + gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE) > + > [PcdsFixedAtBuild.common] > !if $(ARCH) == AARCH64 > gArmTokenSpaceGuid.PcdVFPEnabled|1 > @@ -266,6 +273,13 @@ [Components.common] > > MdeModulePkg/Universal/Variable/Pei/VariablePei.inf > > +!if $(TPM2_ENABLE) == TRUE > + MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf { > + > + ResetSystemLib|ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf > + } > +!endif > + > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { > > NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf > diff --git a/ArmVirtPkg/ArmVirtQemu.fdf b/ArmVirtPkg/ArmVirtQemu.fdf > index 2c8936a1ae15..f55918d26b06 100644 > --- a/ArmVirtPkg/ArmVirtQemu.fdf > +++ b/ArmVirtPkg/ArmVirtQemu.fdf > @@ -113,6 +113,10 @@ [FV.FVMAIN_COMPACT] > INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf > INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > > +!if $(TPM2_ENABLE) == TRUE > + INF MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf > +!endif > + > FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { > SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { > SECTION FV_IMAGE = FVMAIN > Reviewed-by: Laszlo Ersek