From nobody Mon Feb 9 00:43:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84224+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84224+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1638387050; cv=none; d=zohomail.com; s=zohoarc; b=ldjiMXQysly7/rb5OObI5CXw9XyWD2mluQFqF3uVufvT3kTwup4dp0UYof5C4Z/y4USGOizwmDx5pOwfTb7+CUCt0UrnLXIBkqNwWh2m6QsL0suA1KtQ3/ogRXBJeoqlQMJsjWEK51ACJOdzuKz4346tTxLzLR8/CYJ0E3XPFGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638387050; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=yIxcox0wFOjYR3ZWhm/guE5Wy6p2enmKi7rBLnpiv1g=; b=fzm22ekEOGr6fpZ94z1BtkoGFO4QgwNEOJRv4luRZbVGQeiyubxEFPHZN0EqETyCcXU6lRWwLU2Nl9AUaS/fsKVYCv/CpvLI93R7rlsaRLO53ZGjyTB8+RC0h6r+1cwtwXXfA76fUIwnVh6mJ7RU0XRKHPFwt6ORk6ZrFnZLRhY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84224+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638387050973859.5563690222416; Wed, 1 Dec 2021 11:30:50 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Q0vRYY1788612xlPbPpcZ4LG; Wed, 01 Dec 2021 11:30:50 -0800 X-Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mx.groups.io with SMTP id smtpd.web10.1659.1638387047574648078 for ; Wed, 01 Dec 2021 11:30:47 -0800 X-Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B1JMYqr031995 for ; Wed, 1 Dec 2021 19:30:46 GMT X-Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cpf5e03p0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Dec 2021 19:30:46 +0000 X-Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1B1JOkVF013555 for ; Wed, 1 Dec 2021 19:30:46 GMT X-Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cpf5e03nq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Dec 2021 19:30:46 +0000 X-Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1B1JCp9Y005510; Wed, 1 Dec 2021 19:30:45 GMT X-Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma02dal.us.ibm.com with ESMTP id 3cn5f05vrk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Dec 2021 19:30:45 +0000 X-Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1B1JUicp19464448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Dec 2021 19:30:44 GMT X-Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A8926E06E; Wed, 1 Dec 2021 19:30:44 +0000 (GMT) X-Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 85ADB6E053; Wed, 1 Dec 2021 19:30:43 +0000 (GMT) X-Received: from sbct-2.pok.ibm.com (unknown [9.47.158.152]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 1 Dec 2021 19:30:43 +0000 (GMT) From: "Stefan Berger" To: devel@edk2.groups.io, kraxel@redhat.com, marcandre.lureau@redhat.com Cc: Stefan Berger Subject: [edk2-devel] [PATCH v3 1/8] OvmfPkg: Move processing of physical presence opcode before End-of-Dxe Date: Wed, 1 Dec 2021 14:30:23 -0500 Message-Id: <20211201193030.3932074-2-stefanb@linux.ibm.com> In-Reply-To: <20211201193030.3932074-1-stefanb@linux.ibm.com> References: <20211201193030.3932074-1-stefanb@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: -D2eN5i8XfWo7UBuZ9KRMr-O5l9rAgim X-Proofpoint-ORIG-GUID: lBqaB4tWg1-wlWPaXs8ENMDM5DGqfINF Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,stefanb@linux.ibm.com X-Gm-Message-State: 9pCM5HvpZkeorJh6QYZGSJwUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638387050; bh=0WqgWSeB/sSfRfOCxPzVeNO6omQfIfaKPHJq4l6f2RU=; h=Cc:Date:From:Reply-To:Subject:To; b=sZklQgYYu/eSER5ljgsnS7ulnBBVchtTUj334Yw/9NAEJ7li18rEwQP4I1Wx4i/PrzS 7mdJndIY6uM2TXFEetBj/TaqMoOP0OrEc+UUF4AC6il7XPFNJCPVZ3ZhbbDovzZ7Q2ace KERPRjkYdgqDEAIuYobAwwWXXkRWhGnIydc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638387052700100003 Content-Type: text/plain; charset="utf-8" For variable creation and locking to work later on we need to move the processing of the TPM physical presence opcode to before End-of-Dxe. Signed-off-by: Stefan Berger --- .../PlatformBootManagerLib/BdsPlatform.c | 20 +++++++++---------- .../PlatformBootManagerLibBhyve/BdsPlatform.c | 18 ++++++++--------- .../PlatformBootManagerLibGrub/BdsPlatform.c | 18 ++++++++--------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index 186401296a..2905356fc4 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -371,6 +371,16 @@ PlatformBootManagerBeforeConsole ( // EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); =20 + // We need to connect all trusted consoles for TCG PP. Here we treat all + // consoles in OVMF to be trusted consoles. + PlatformInitializeConsole ( + XenDetected() ? gXenPlatformConsole : gPlatformConsole); + + // + // Process TPM PPI request; this may require keyboard input + // + Tcg2PhysicalPresenceLibProcessRequest (NULL); + // // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers // the preparation of S3 system information. That logic has a hard depen= dency @@ -388,16 +398,6 @@ PlatformBootManagerBeforeConsole ( SaveS3BootScript (); } =20 - // We need to connect all trusted consoles for TCG PP. Here we treat all - // consoles in OVMF to be trusted consoles. - PlatformInitializeConsole ( - XenDetected() ? gXenPlatformConsole : gPlatformConsole); - - // - // Process TPM PPI request; this may require keyboard input - // - Tcg2PhysicalPresenceLibProcessRequest (NULL); - // // Prevent further changes to LockBoxes or SMRAM. // Any TPM 2 Physical Presence Interface opcode must be handled before. diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c b/Ov= mfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c index e767c3b172..950ab12c94 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c @@ -366,15 +366,6 @@ PlatformBootManagerBeforeConsole ( // EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); =20 - // - // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers - // the preparation of S3 system information. That logic has a hard depen= dency - // on the presence of the FACS ACPI table. Since our ACPI tables are only - // installed after PCI enumeration completes, we must not trigger the S3= save - // earlier, hence we can't signal End-of-Dxe earlier. - // - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); - // We need to connect all trusted consoles for TCG PP. Here we treat all // consoles in OVMF to be trusted consoles. PlatformInitializeConsole (gPlatformConsole); @@ -384,6 +375,15 @@ PlatformBootManagerBeforeConsole ( // Tcg2PhysicalPresenceLibProcessRequest (NULL); =20 + // + // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers + // the preparation of S3 system information. That logic has a hard depen= dency + // on the presence of the FACS ACPI table. Since our ACPI tables are only + // installed after PCI enumeration completes, we must not trigger the S3= save + // earlier, hence we can't signal End-of-Dxe earlier. + // + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); + // // Prevent further changes to LockBoxes or SMRAM. // Any TPM 2 Physical Presence Interface opcode must be handled before. diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c b/Ovm= fPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c index fd80577355..fbc40dcb68 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c @@ -329,15 +329,6 @@ PlatformBootManagerBeforeConsole ( // EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); =20 - // - // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers - // the preparation of S3 system information. That logic has a hard depen= dency - // on the presence of the FACS ACPI table. Since our ACPI tables are only - // installed after PCI enumeration completes, we must not trigger the S3= save - // earlier, hence we can't signal End-of-Dxe earlier. - // - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); - // We need to connect all trusted consoles for TCG PP. Here we treat all // consoles in OVMF to be trusted consoles. PlatformInitializeConsole (gPlatformConsole); @@ -347,6 +338,15 @@ PlatformBootManagerBeforeConsole ( // Tcg2PhysicalPresenceLibProcessRequest (NULL); =20 + // + // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers + // the preparation of S3 system information. That logic has a hard depen= dency + // on the presence of the FACS ACPI table. Since our ACPI tables are only + // installed after PCI enumeration completes, we must not trigger the S3= save + // earlier, hence we can't signal End-of-Dxe earlier. + // + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); + // // Prevent further changes to LockBoxes or SMRAM. // Any TPM 2 Physical Presence Interface opcode must be handled before. --=20 2.31.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84224): https://edk2.groups.io/g/devel/message/84224 Mute This Topic: https://groups.io/mt/87436446/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-