From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kUPqnTJr; spf=pass (domain: linux.ibm.com, ip: 148.163.156.1, mailfrom: stefanb@linux.ibm.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=W61tYj/dfUxHQK0XtfN8MjVGGMD5eY2HyLcFJwuCkgA=; b=kUPqnTJrLGk8Gdr8q3ipBS2qST/Jlf/FJVqDiq05120uoPh20Y/i5ACOAE7T7A8NeQY7 E1NliInn6Rkh7wF2Pfs+8Y/MxxLNyhiYLGYQJVbOVqrqdJwbR88wh/bwLk7HUW/L+iGQ SgO+17d257nJzNFzYAML3mZ+QUfQZ/QLVtmO62LUZ8NVINmci7IcJzTKD7e452ZS8w7c mVmJ3U1X2wtxGqYoJoCblOgGcyGSsPM5FJPU3iGGoTVv7hUklnX3M/eeZRM2uI7sWEGv Ddv/RMxr9fWmGXosio26bmkf6ylgIj96b9mKe1SE/xlS6VM0GQ1YaOyYtzOoSJO77tj7 zA== 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 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 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 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 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 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 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) 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) 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: [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> X-Mailer: git-send-email 2.31.1 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 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-30_10,2021-12-01_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=837 clxscore=1015 spamscore=0 impostorscore=0 mlxscore=0 bulkscore=0 suspectscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112010102 Content-Transfer-Encoding: quoted-printable 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 ( //=0D EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid);=0D =0D + // We need to connect all trusted consoles for TCG PP. Here we treat all= =0D + // consoles in OVMF to be trusted consoles.=0D + PlatformInitializeConsole (=0D + XenDetected() ? gXenPlatformConsole : gPlatformConsole);=0D +=0D + //=0D + // Process TPM PPI request; this may require keyboard input=0D + //=0D + Tcg2PhysicalPresenceLibProcessRequest (NULL);=0D +=0D //=0D // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers=0D // the preparation of S3 system information. That logic has a hard depen= dency=0D @@ -388,16 +398,6 @@ PlatformBootManagerBeforeConsole ( SaveS3BootScript ();=0D }=0D =0D - // We need to connect all trusted consoles for TCG PP. Here we treat all= =0D - // consoles in OVMF to be trusted consoles.=0D - PlatformInitializeConsole (=0D - XenDetected() ? gXenPlatformConsole : gPlatformConsole);=0D -=0D - //=0D - // Process TPM PPI request; this may require keyboard input=0D - //=0D - Tcg2PhysicalPresenceLibProcessRequest (NULL);=0D -=0D //=0D // Prevent further changes to LockBoxes or SMRAM.=0D // Any TPM 2 Physical Presence Interface opcode must be handled before.= =0D 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 ( //=0D EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid);=0D =0D - //=0D - // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers=0D - // the preparation of S3 system information. That logic has a hard depen= dency=0D - // on the presence of the FACS ACPI table. Since our ACPI tables are onl= y=0D - // installed after PCI enumeration completes, we must not trigger the S3= save=0D - // earlier, hence we can't signal End-of-Dxe earlier.=0D - //=0D - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);=0D -=0D // We need to connect all trusted consoles for TCG PP. Here we treat all= =0D // consoles in OVMF to be trusted consoles.=0D PlatformInitializeConsole (gPlatformConsole);=0D @@ -384,6 +375,15 @@ PlatformBootManagerBeforeConsole ( //=0D Tcg2PhysicalPresenceLibProcessRequest (NULL);=0D =0D + //=0D + // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers=0D + // the preparation of S3 system information. That logic has a hard depen= dency=0D + // on the presence of the FACS ACPI table. Since our ACPI tables are onl= y=0D + // installed after PCI enumeration completes, we must not trigger the S3= save=0D + // earlier, hence we can't signal End-of-Dxe earlier.=0D + //=0D + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);=0D +=0D //=0D // Prevent further changes to LockBoxes or SMRAM.=0D // Any TPM 2 Physical Presence Interface opcode must be handled before.= =0D 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 ( //=0D EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid);=0D =0D - //=0D - // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers=0D - // the preparation of S3 system information. That logic has a hard depen= dency=0D - // on the presence of the FACS ACPI table. Since our ACPI tables are onl= y=0D - // installed after PCI enumeration completes, we must not trigger the S3= save=0D - // earlier, hence we can't signal End-of-Dxe earlier.=0D - //=0D - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);=0D -=0D // We need to connect all trusted consoles for TCG PP. Here we treat all= =0D // consoles in OVMF to be trusted consoles.=0D PlatformInitializeConsole (gPlatformConsole);=0D @@ -347,6 +338,15 @@ PlatformBootManagerBeforeConsole ( //=0D Tcg2PhysicalPresenceLibProcessRequest (NULL);=0D =0D + //=0D + // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe trig= gers=0D + // the preparation of S3 system information. That logic has a hard depen= dency=0D + // on the presence of the FACS ACPI table. Since our ACPI tables are onl= y=0D + // installed after PCI enumeration completes, we must not trigger the S3= save=0D + // earlier, hence we can't signal End-of-Dxe earlier.=0D + //=0D + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);=0D +=0D //=0D // Prevent further changes to LockBoxes or SMRAM.=0D // Any TPM 2 Physical Presence Interface opcode must be handled before.= =0D --=20 2.31.1