From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web10.5081.1582814467982427719 for ; Thu, 27 Feb 2020 06:41:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=lYCbRycn; spf=pass (domain: linaro.org, ip: 209.85.128.66, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wm1-f66.google.com with SMTP id z12so3840860wmi.4 for ; Thu, 27 Feb 2020 06:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7Cx2q60VbKJPq/OnYOWkYr0kCHWrRn5VGz/SdOnApgY=; b=lYCbRycnRd36bofJyJ03iq82gNbrq/fkApr03V2hgfCo+eUPM4MdiqxIu7fVuMg6Fo YpCxxGCXnaCg3xpFur4auEE968+n4i9mQZxaGE/GcbUaPROkLQ5ggZkRX2GHqnXNn5wm 2ALaSJrwjNHm2PATF9U0KfYMfFPh8ty/utHKnDP9ns04TVS+kFSvt/g62hCWOX2pl21l cHtlWdg8mx9Aa+E2+RTE7+Bz12oACNtIbEPDw+j1vkcMhRquGi1qd0tgb7KFoHyhmCuN mmEWrpoq4ysyTIqG0/uYAC0G59lOsOKUci7i8qBADnp/SSMl35+sWLec/sdCX2P3f0jq TNCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7Cx2q60VbKJPq/OnYOWkYr0kCHWrRn5VGz/SdOnApgY=; b=j4JeQjeGhKZumoV4yF7RVDy/G0VmvovLPwEDzpH5XAqDko0JlUV8ckUvwUFMdt0JAc rKTVZ0tS7bcZ1iP/9rcwzSLRuvLKXC21WEHkr0ysbaPNAcDGreeqLzIBl1ZTZJX6PzLq hr7BnlmvwY3MpyoDYGWRtcUeTFChNKs2M+1ejaQ3U4Il4HOipiyG82uet6ycKQyJg2b1 Aqew1GX4mU+FNXIiNuG/uUUncd51KH1kSp/cDzB8sAsdzAY+9sHzySdBuG2Gju6+7Oup VJb9+4EGPlbkLbNv4Ir76sz4hztLQJ+fX8A4VHJyKeyzSPaAcZmf8xNYDr+eAiblG4fj TiAg== X-Gm-Message-State: APjAAAVSCWrkNiwT7BkZScMCYZGvLKcEvEV0f/NHkOZlxN9H3PWfQAVA 2xCbnQcCeQ/IIP3LaPRSVF+3Uz3Oa7g= X-Google-Smtp-Source: APXvYqyTsc85qs1t69Evoy1zuGh3yXdx4Mm4KN/CZv6e3qm+69TV/RKgH3MuEbkNU0CCPK7+oWHhBg== X-Received: by 2002:a1c:e007:: with SMTP id x7mr5482048wmg.3.1582814466299; Thu, 27 Feb 2020 06:41:06 -0800 (PST) Return-Path: Received: from localhost.localdomain (aaubervilliers-682-1-29-142.w90-88.abo.wanadoo.fr. [90.88.192.142]) by smtp.gmail.com with ESMTPSA id k7sm8273575wrq.12.2020.02.27.06.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 06:41:05 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , lersek@redhat.com, eric.auger@redhat.com, philmd@redhat.com, marcandre.lureau@redhat.com, stefanb@linux.ibm.com, leif@nuviainc.com Subject: [PATCH v4 05/11] ArmVirtPkg/ArmVirtQemu: add ResetSystem PEIM for upcoming TPM2 support Date: Thu, 27 Feb 2020 15:40:50 +0100 Message-Id: <20200227144056.56988-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200227144056.56988-1-ard.biesheuvel@linaro.org> References: <20200227144056.56988-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Laszlo Ersek --- 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 -- 2.20.1