From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web10.602.1582743926546577566 for ; Wed, 26 Feb 2020 11:05:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=JQ3s7pDx; spf=pass (domain: linaro.org, ip: 209.85.221.68, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f68.google.com with SMTP id w12so104148wrt.2 for ; Wed, 26 Feb 2020 11:05:26 -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; bh=BFT96h9eFNO4zdpd2lo/yw3ZZ7aAe8S5uWD/qBtLE6Y=; b=JQ3s7pDx2glSEPCUXgvduc4pjpgMNoJaJW37MBIkKTxhB6g3pRhjyxf/e5Qt90wqwL 638WZjm/WYLwkWLVEKVuBcjmbCdbpDCxDQgWmw/utmbwgj+S62mWJLOUZHN2+mg/daa3 e05NiNNZhh5MzRp4BuXOcQmMhL1yl1/hw2JjYZedaMPhd2JwYO6KPG+6XoqjvGnclQ1R QF0ZbiaG400z02kcp4grTj2giGTDNI1HJGRuknW3Ka3jVXkDd1QWc8iIymQcp25TvzSJ QDEokfXjoe/npK0w3fJN7SXDcJ9Adzyy4a3QLMAEUghd3//SRIv8rGzS0EyfhEZPqhGw +O7Q== 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; bh=BFT96h9eFNO4zdpd2lo/yw3ZZ7aAe8S5uWD/qBtLE6Y=; b=MILC+nQ8fGh/JcTxhTFzBXcarOw/BR5LrxTP4cWR8u7vCU9Q4IKUcePm2NrvcBndLA udcJp5GPI24Oz1+NKXOfQceS4goZExoavJczWDFP2tFN3r6njcL7ksMNfO7NmTbN97SU WJKigW0LLtu44Y/D57Nb/fCkEuZGFVcNXMZH/ji26ebgEn5Ei2/ED2vOx8HU4rbjWIVO b3tP4w8weOWxNZ/+6bPMhPQs4rqTKPbIgsPWWc3mA39Bfm+FR2RY3xemR9CJJmQjcYts OotWV6v167EXBNhvjMSOg29969uPbZtgXrQvw3u5iLPGi6lt0P4c+KlrKJyLUf0emr4l aZ/g== X-Gm-Message-State: APjAAAXQMRCQWvH1JZ3Ef5cQmh6oFolqTkt4QrSO3XRvOSgLZtt9FXVg eiidA0GQ4aceBLUWOl/RwJtVZJHRksmBdw== X-Google-Smtp-Source: APXvYqwAk45Ma7g+vox9ns1lv+sw11FZCqwydwOHt18vo6lJ2r0ErbXHRXVqKbwNQbPjvynA8eiuTQ== X-Received: by 2002:adf:facc:: with SMTP id a12mr121251wrs.100.1582743924759; Wed, 26 Feb 2020 11:05:24 -0800 (PST) Return-Path: Received: from e123331-lin.home ([2a01:cb1d:112:6f00:816e:ff0d:fb69:f613]) by smtp.gmail.com with ESMTPSA id z1sm3932823wmf.42.2020.02.26.11.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 11:05:23 -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 v3 5/9] ArmVirtPkg/ArmVirtQemu: add ResetSystem PEIM for upcoming TPM2 support Date: Wed, 26 Feb 2020 20:05:10 +0100 Message-Id: <20200226190514.31395-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200226190514.31395-1-ard.biesheuvel@linaro.org> References: <20200226190514.31395-1-ard.biesheuvel@linaro.org> 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 -- 2.17.1