From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 99A2FD80230 for ; Thu, 10 Aug 2023 00:24:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kIE7w7AjZID4uItY3As9PKvVrsV2BA6k7GYh/6Jq7cw=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20140610; t=1691627043; v=1; b=R5YeFyS4G/3EZhfA+N99U3rM+w43RokhBXP1YCj7Ngt2Ljw0oqGgfUOlNmJNU6edvPb5cB2B KPw3q9Ec+I7vfQen4+GbfBR9fsm4jYOp5bryv9ijB0nOlDEWgjOw2c7kp0e6HmnNSVKWNUsFXKp +JBlcSnzf5SFXp7VpZkmuRBI= X-Received: by 127.0.0.2 with SMTP id 7gKLYY7687511xdakGZMk7bh; Wed, 09 Aug 2023 17:24:03 -0700 X-Received: from mx0b-00154904.pphosted.com (mx0b-00154904.pphosted.com [148.163.137.20]) by mx.groups.io with SMTP id smtpd.web10.81332.1691555409356462791 for ; Tue, 08 Aug 2023 21:30:09 -0700 X-Received: from pps.filterd (m0170395.ppops.net [127.0.0.1]) by mx0b-00154904.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 378MuJoX007269; Wed, 9 Aug 2023 00:29:52 -0400 X-Received: from mx0b-00154901.pphosted.com (mx0b-00154901.pphosted.com [67.231.157.37]) by mx0b-00154904.pphosted.com (PPS) with ESMTPS id 3s9k3npsmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 00:29:51 -0400 X-Received: from pps.filterd (m0144104.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 378LowDJ024079; Wed, 9 Aug 2023 00:29:22 -0400 X-Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by mx0b-00154901.pphosted.com (PPS) with ESMTPS id 3sbwyr37hv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 00:29:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V/aPGSm4o5kv9DfFYuxZUXGP7VHzRK86A5E3PT85y9OZifo5xZOSqTej2wG0nU4SCiU4eYefRST+jRgN0jnLhGgj7bxMxRZuZXVnoNcQqNhCaow0is88hKPMFJ+Te8SkJkUX+6aUlV1/K75WuxanRvU3LooRi5ACcFTZLALPIBDH3cK1/g7Qik9bwKPICAec2/W7+Lpk/XJTfw/oQUZQWEuucfTWSrWLVx23BBNDzYh6wtTGvuFXMdeln7dyeLsBycN3XBElGlXmCG4KGqaE/cQkN0XbNSDWgymBFgMt0f9zC+MKusH07qbfCHMDG4wWFvKZwsFOilK/jTpi+dPqwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fanSkgg/hYkgyI3yaFlipH7vBh4j9feMVW2OYzjjPQI=; b=U/zy/HvCtbI8AQ3oCGRjF5XRp7dgN5xkCaDfoTgFjgFBV3brfDHWotWEPpZnu+iDYeX3MbcgHRSo5bQ/MgDOdmAWPaW5JOaWMkDS52seftsfBrwVXucnAJxpmu6mvXl6+3U8mnUlnzmzjTenN1bGD7nUHqGbS2sjiDOQ4pBTLXA09fkco24I+4ZHyDBEUrRbYCmkyYe8VKvpkYD7e34jgzDUaPbQpAkmMaqh4ZK5tUTy85NleQVzlpC9W2hYXVsyV0NBDh8N5tno9KGpXZsP9xInCvTtWLXvr5tItjmJ/yG0yxaRICLP1V5CvESfR4zvL3ij68oBinFXKLpL/cHoXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=dell.com; dmarc=pass action=none header.from=dell.com; dkim=pass header.d=dell.com; arc=none X-Received: from SA1PR19MB5572.namprd19.prod.outlook.com (2603:10b6:806:229::8) by PH7PR19MB7461.namprd19.prod.outlook.com (2603:10b6:510:27f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Wed, 9 Aug 2023 04:29:18 +0000 X-Received: from SA1PR19MB5572.namprd19.prod.outlook.com ([fe80::450a:af8c:1e79:6116]) by SA1PR19MB5572.namprd19.prod.outlook.com ([fe80::450a:af8c:1e79:6116%4]) with mapi id 15.20.6652.026; Wed, 9 Aug 2023 04:29:18 +0000 From: "Poosapalli, Karunakar via groups.io" To: "Yao, Jiewen" , "Gao, Liming" , "devel@edk2.groups.io" Subject: Re: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for Clear Graphics Screen To unblock and Display TPM messages Thread-Topic: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for Clear Graphics Screen To unblock and Display TPM messages Thread-Index: Adm8DJurGgUFmZ0XSiuVHtzYqmi7VgCNo1NgACuqkgACzGH2gAAKjkkAAArdUdA= Date: Wed, 9 Aug 2023 04:29:18 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-Mentions: jiewen.yao@intel.com X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_Enabled=true; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_SetDate=2023-08-09T04:29:13Z; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_Method=Standard; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_Name=No Protection (Label Only) - Internal Use; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_ActionId=82e4fcf5-334b-48aa-9e04-c1e39a9a29fa; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_ContentBits=2 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR19MB5572:EE_|PH7PR19MB7461:EE_ x-ms-office365-filtering-correlation-id: c915b8b3-fc08-402e-d8e6-08db98913218 x-exotenant: 2khUwGVqB6N9v58KS13ncyUmMJd8q4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: akrCOrLQcaY6cYdTyMxJmMhfZoaLd5FsJy49tiLHCAPLGd0QZQZGJXnqyN24mG4C9iCd+MgiqfCHI0bG3W6FqBe4MLmogn57/NPVoYhwZxxH9SMSopH4lmdoIfZ33R5lQrthC8iQty56VlCWTh2+jfUDF+/5ayi+k+mur0kSwQWKRIrC05dz/2IKYWvamgQdOVTcF03959K53LvW+WC5LeeMLmvAZFWJdD8nxXxm5StBMy5fbLJ/VGzEVOq1PtkvWEwSUk4woz2IUMsRT08/TTCv7YrfTnlDHkBnGVNGlJFagZtFXy6Q+ChM8nGmF2yAR5tVifjrDpnlmoQtJSZrmhnm3+JIWFmXScPAJMbnmqBWcZ4FaRqSyLkKDM/dQMEk2kGGf9IebMTIeINYefu2ycIchZAnYE0E1uSRw/MRDiX4caGnoahSEZjwD8x5CT01ZJFzqrlIk4i0uk2eoLY4qnqHex6WQvf7xtzd9eXiH7CSryqH14xJmMBwTNgSFX0KK8lp8zsM0DKl+sX6TSGjS+19egqzOg1ZXnJjd1vAG2EaIpgy2NZPCZtZmnam4vfgCIM4ISA+Vkh1q33YqyJhJhVqTzI7/K0G0GZOLPPDAQQ= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ETrmK9nz81uX4ynFmKieaOelnv6YXaBIEE77i1iPR/w4j6XRs36rs/mVWbRs?= =?us-ascii?Q?N0Tx2KadLtCsgWLIPLdN5QO6b++esI/A63ki7+8o0toVyZRidl1ZRHq1LSqG?= =?us-ascii?Q?r6QheN0oKb3CduGhtsxvWF0MxZ6yGbeO1LZnmLwKQ719nQ8xcxvdu5O4LJwO?= =?us-ascii?Q?DMx3JOcw8ZCreiarWSt5gHAwJHTF9/5DID8eCS2nj7FFBvf+0WkV08vj90Y5?= =?us-ascii?Q?K15zpXH+yRUQQ4vg26A0Q2nVeNGamuWvHZ84TNXCITJJ7eyCBk+nsrrbxi3b?= =?us-ascii?Q?RTvD/VApqXENJEId0/dLPXmWNdW6+s13CrjGmXWynXaxwuLiBjfvRNdLqF1a?= =?us-ascii?Q?e7E8FW2FpKqENo9YyHn1Mt8oQcNI08TGZ3a85dKzet9uATIP+PcmRcQ6M7Ql?= =?us-ascii?Q?Q//D/y2IblCOd7EOyofmijd9nAL3ehpWnIlYYyT+vAikOfjN0VehIjv9npeZ?= =?us-ascii?Q?Fsp/4xEo4oLi5kqB89E8p/BBaI/4azgyOqQAktMDRchRzCSJ+SbIjQYhPqIz?= =?us-ascii?Q?mpBLAanlRtpiC55hGfXZ45mtoc89fAL3mqkB8Wx6OGKtAbgcHb5duaAWQ4dN?= =?us-ascii?Q?2P3akzJc2FEOajGI6kEqjj/h4rQ9H9Bb86SJvLBK5OsM/DLVBiMDFzDXUsWa?= =?us-ascii?Q?alyKQ+IzKFqfmYEnbrpRmByAkkvC7TdWeXKKj7xDQOYd0CdO9LicOBUkaXic?= =?us-ascii?Q?+m1Utss0XzQVExEpvyZkhVjmHyjUngkXlGIq1fyEYVGucwnP46JEdjw/MYld?= =?us-ascii?Q?zz3ZBFUx/GJtbnOeupDghZsQVQ2kceJkbnON7Gf1xWyrgUbF5HKVfE/uEzLz?= =?us-ascii?Q?FCcp9jWQEFb10M/zItpYTvgFdJmQccXOMMkwlvus1s974sZAkRS7OO6WU9Kc?= =?us-ascii?Q?vYIit3EQ+xAd+LUw24AJdaXntYJCDLw/foOFYSewpESRNQsh9C2AQWoIjizc?= =?us-ascii?Q?kmYfBeorK5+JyC8sceHwqeFPy0PbvftppUd641NGLqZk6tR4whO6MtJyErAF?= =?us-ascii?Q?DprWsF9QS/ulqvGi8EUSYHkpZYLUUAe8gqfNTbk3CC3wHUPk9vGeQv6UYHUf?= =?us-ascii?Q?/QXg7M4vk91Jhdc9mrSIH0p94OJT/TDa2IJEM3OUmp2FNlbJr99Xsg85xXTM?= =?us-ascii?Q?NLtF3Q+SvVMybv+02iuUAw/bznVLlefJKOOUofKbSpyE3SFAcn2osydFp6ov?= =?us-ascii?Q?GZ5AzX/J+t4Xq64yWp7ZnKD/9F/jvnBMkre1YLKdCpcjvo29XNHc4H/ZKjw3?= =?us-ascii?Q?mLMddcORTnGeq71O6wBREzBzVDJJpnnd7HfOoRC10ab5tS9FWi3vCF3pGFw1?= =?us-ascii?Q?I4EjoemXkydi5t/e3WC7sTtP7v+ue6JR73pj+/sXIoJ9nQlEaAHQtdKYXOqm?= =?us-ascii?Q?PpZl8maQe+di4gcbaL1oylDCLikxvXDAKI8918ZZvm7q7UMF3j3dw1PiuwUw?= =?us-ascii?Q?ah4VTEzjb/pexgy9QXlF9iTyeCdErZeoHl8sqreFr78jB0l4TVWww315qFIM?= =?us-ascii?Q?ViK50ZPNP+smgTTflLYDYt6+EYu7k9V6Lof7B5Uklf0iafSNYx6a+jP7aIop?= =?us-ascii?Q?Rh5Rw5srUZq7TxM0G0i0re1A0tZU70B1yVMX2WpEFE21k4TuTY/A1bRiBu6r?= =?us-ascii?Q?XA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: Dell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR19MB5572.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c915b8b3-fc08-402e-d8e6-08db98913218 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2023 04:29:18.1110 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 945c199a-83a2-4e80-9f8c-5a91be5752dd X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rUD1NsF9JCt1jKzTIAtNgjbp2z0Xe3wAWtZTzKKCBzUwy4pZJ8e0S+3V+yFbP1+WZL3/3bs/r/whBGBC2Xq+HxC+ZpMkjZ2bA4y+xZEgkkY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR19MB7461 X-Proofpoint-GUID: lJlRFMJiWxL8JxI3UqgSPmLNhf7iBll7 X-Proofpoint-ORIG-GUID: lJlRFMJiWxL8JxI3UqgSPmLNhf7iBll7 Precedence: Bulk 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,KarunakarPoosapalli@Dell.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: yIdmdEvn7PG2FmYgipiGaExRx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_SA1PR19MB55724DB3A066CAC410559FC28B12ASA1PR19MB5572namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=R5YeFyS4; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") --_000_SA1PR19MB55724DB3A066CAC410559FC28B12ASA1PR19MB5572namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi @Yao, Jiewen, The proposed solution to clear screen will be called only when user has to = provide the input key. This call will not execute in other conditions. When there is a pending request in Tcg2, system will wait until user press = input key. If there is no proper UI to customer, they feel it's system hang= and go for customer support. Even BIOS vendors also won't come to what is happening at customer box with= out any user information. This is generic issue and not specific to any platform. Thanks for sharing your thoughts. Thanks & Regards Karunakar Poosapalli Firmware Principal Engineer, Client BIOS Customer BIOS | Dell Core BIOS CPG Software Engineering | Dell Technologies Mobile +91 9951902957 Karunakar_poosapalli@Dell.Com Internal Use - Confidential From: Yao, Jiewen Sent: Wednesday, August 9, 2023 4:44 AM To: Poosapalli, Karunakar; Gao, Liming; devel@edk2.groups.io Cc: Yao, Jiewen Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib f= or Clear Graphics Screen To unblock and Display TPM messages [EXTERNAL EMAIL] My concern is that you unconditionally clear the screen. What if someone di= d want to show something on the screen? This seems an incompatible change. That is why I think it should be a platf= orm policy. Another way is that you may consider to duplicate the library for your plat= form and clear it for your platform. Thank you Yao, Jiewen From: Poosapalli, Karunakar > Sent: Wednesday, August 9, 2023 2:13 AM To: Yao, Jiewen >; Gao, L= iming >; devel@ed= k2.groups.io; Poosapalli, Karunakar > Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib f= or Clear Graphics Screen To unblock and Display TPM messages Hi @Yao, Jiewen, Thanks for your review and feedback. When there is a pending Tcg request, the control will be in Tcg2 library an= d it will not reach to BDS until user press the input key. As there is no information the screen because of screen is blocked by some = other messages/Logo. So user won't able to press the key without any user information and contro= l will not reach to BDS phase. As TCG user confirmation is the highest priority and it blocks the POST unt= il the user presses the input key. Before TCG messages Print on the console= , there should be logic added to clear the graphics screen Please let me know your thoughts. Thanks & Regards Karunakar Poosapalli Firmware Principal Engineer, Client BIOS Customer BIOS | Dell Core BIOS CPG Software Engineering | Dell Technologies Mobile +91 9951902957 Karunakar_poosapalli@Dell.Com Internal Use - Confidential From: Yao, Jiewen > Sent: Tuesday, July 25, 2023 5:48 PM To: Poosapalli, Karunakar; Gao, Liming; devel@edk2.groups.io Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib f= or Clear Graphics Screen To unblock and Display TPM messages [EXTERNAL EMAIL] Hello I agree with you on the problem statement. But I don't think this is a desired solution. We expect Platform BDS to call the PhysicalPresenceLib. As such, why not cl= ear the screen in the platform BDS? Thank you Yao, Jiewen From: Poosapalli, Karunakar > Sent: Monday, July 24, 2023 11:26 PM To: Yao, Jiewen >; Gao, L= iming >; devel@ed= k2.groups.io Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib f= or Clear Graphics Screen To unblock and Display TPM messages Can you please review and share your feedback? Thanks & Regards Karunakar Poosapalli Firmware Principal Engineer, Client BIOS Customer BIOS | Dell Core BIOS CPG Software Engineering | Dell Technologies Mobile +91 9951902957 Karunakar_poosapalli@Dell.Com Internal Use - Confidential From: Poosapalli, Karunakar Sent: Saturday, July 22, 2023 1:21 AM To: jiewen.yao@intel.com; gaoliming; devel@edk= 2.groups.io Subject: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for C= lear Graphics Screen To unblock and Display TPM messages Patch review for Bugzilla - https://bugzilla.tianocore.org/show_bug.cgi?id= =3D4462 [bugzilla.tianocore.org] >From c537f9c5c9e02c54e27466b96fe33555afccd358 Mon Sep 17 00:00:00 2001 From: Karunakar Poosapalli karunakar_poosapalli@dell.com Date: Sat, 22 Jul 2023 01:13:44 +0530 Subject: [PATCH] Patch - Enhance Tcg2 to clear graphics before printing the messages on screen [Background] Tcg2UserConfirm() Function is used to display any user conformation message= s on the console Function Definition Full path - SecurityPkg\Library\DxeTcg2PhysicalPresence= Lib\DxeTcg2PhysicalPresenceLib.c [Issue] In the current Tcg2UserConfirm() implementation, This function forms a dest= ination string to be displayed on the console and directly Print the messag= e on Console. But there is no logic added to clear the graphics before printing the messa= ges on the screen. There are some scenarios where Tcg messages might have been blocked by some= other GUI or messages on Console. 1. When there are some messages or logos already displayed in the content= on the console, TCG message will NOT be displayed or corrupted to the End user. 2. There could be a Custom logo displaying on the screen which actually b= locks the screen. [Solution] 1. As TCG user confirmation is the highest priority and it blocks the POS= T until the user presses the input key. Before TCG messages Print on the console, there= should be logic added to clear the graphics screen Cc: gaoliming gaoliming@byosoft.com.cn Cc: Jiewen Jiewen.yao@intel.com REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4462 [bugzilla.tianoc= ore.org] Signed-off-by: Karunakar Poosapalli karunakar_poosapalli@dell.com --- .../DxeTcg2PhysicalPresenceLib.c | 74 +++++++++++++++++++ .../DxeTcg2PhysicalPresenceLib.inf | 1 + 2 files changed, 75 insertions(+) diff --git a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2Physical= PresenceLib.c b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2Physi= calPresenceLib.c index de4f5e583d..bd486f3b5b 100644 --- a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenc= eLib.c +++ b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenc= eLib.c @@ -251,6 +251,74 @@ Tcg2ExecutePhysicalPresence ( } } +/** + Clear Graphics Screen To unblock and Display TPM messages + + @param[in] VOID + @retval EFI_STATUS +**/ +EFI_STATUS +ClearGraphicsScreenToDisplayTpmMessages() +{ + EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop; + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; + + DEBUG((DEBUG_INFO, "ClearGraphicsScreenToDisplayTpmMessages Entry...\n")= ); + + Status =3D gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiGraphicsOutputProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + DEBUG((DEBUG_INFO, "LocateHandleBuffer Status =3D %r, NumberOfHandles = =3D %x\n", Status, NumberOfHandles)); + + if (EFI_ERROR (Status)) + { + return Status; + } + + for (Index =3D 0; Index < NumberOfHandles; Index++) + { + Status =3D gBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiDevicePathProtocolGuid, + (VOID *)&GopDevicePath + ); + DEBUG((DEBUG_INFO, "HandleProtocol GopDevicePath Status =3D %r, Inde= x =3D %x\n", Status, Index)); + if (EFI_ERROR (Status)) + { + continue; + } + + Status =3D gBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiGraphicsOutputProtocolGuid, + (VOID **) &Gop + ); + DEBUG((DEBUG_INFO, "HandleProtocol Gop Status =3D %r, Index =3D %x\n= ", Status, Index)); + if (EFI_ERROR(Status)) + { + continue; + } + + // Clear the graphics screen to black + Status =3D Gop->Blt(Gop, NULL, EfiBltVideoFill, 0, 0, 0, 0, Gop->Mod= e->Info->HorizontalResolution, Gop->Mode->Info->VerticalResolution, 0); + DEBUG((DEBUG_INFO, "Gop->Blt Status =3D %r, Index =3D %x\n", Status,= Index)); + if (EFI_ERROR(Status)) { + continue; + } + } + + gBS->FreePool (HandleBuffer); + DEBUG((DEBUG_INFO, "ClearGraphicsScreenToDisplayTpmMessages Exit...\n"))= ; + return Status; +} /** Read the specified key for user confirmation. @@ -576,6 +644,12 @@ Tcg2UserConfirm ( BufSize -=3D StrSize (ConfirmText); UnicodeSPrint (ConfirmText + StrLen (ConfirmText), BufSize, TmpStr1, Tmp= Str2); + // + //Clear Graphics Screen To unblock and Display TPM messages + // + Status =3D ClearGraphicsScreenToDisplayTpmMessages(); + DEBUG((DEBUG_INFO, "ClearGraphicsScreenToDisplayTpmMessages Status =3D %= r\n", Status)); + DstStr[80] =3D L'\0'; for (Index =3D 0; Index < StrLen (ConfirmText); Index +=3D 80) { StrnCpyS (DstStr, sizeof (DstStr) / sizeof (CHAR16), ConfirmText + Ind= ex, sizeof (DstStr) / sizeof (CHAR16) - 1); diff --git a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2Physical= PresenceLib.inf b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2Phy= sicalPresenceLib.inf index e1c7c20d52..de423cfd13 100644 --- a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenc= eLib.inf +++ b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenc= eLib.inf @@ -54,6 +54,7 @@ [Protocols] gEfiTcg2ProtocolGuid ## SOMETIMES_CONSUMES gEdkiiVariableLockProtocolGuid ## SOMETIMES_CONSUMES + gEfiGraphicsOutputProtocolGuid ## CONSUMES [Pcd] gEfiSecurityPkgTokenSpaceGuid.PcdTcg2PhysicalPresenceFlags ## SOME= TIMES_CONSUMES -- 2.17.0.windows.1 Internal Use - Confidential -=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 (#107664): https://edk2.groups.io/g/devel/message/107664 Mute This Topic: https://groups.io/mt/100333271/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_SA1PR19MB55724DB3A066CAC410559FC28B12ASA1PR19MB5572namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi @Yao, Jiewen,

 

The proposed solution to clear screen will be called= only when user has to provide the input key. This call will not execute in= other conditions.

When there is a pending request in Tcg2, system will= wait until user press input key. If there is no proper UI to customer, the= y feel it’s system hang and go for customer support.

Even BIOS vendors also won’t come to what is h= appening at customer box without any user information.

This is generic issue and not specific to any platfo= rm.

 

Thanks for sharing your thoughts.

 

Tha= nks & Regards

Kar= unakar Poosapalli

Firmware Principal Engineer, Client BIOS=

Customer BIOS | Dell Core BIOS<= /span>

CPG Software Engineering | Dell Technologies

Mobile +91 9951902957<= /p>

Karunakar_poosapalli@Dell.Com<= /p>

 

 

Internal Use - Confidential

From: Yao, Jiewen <jiewen.yao@intel.com>= ;
Sent: Wednesday, August 9, 2023 4:44 AM
To: Poosapalli, Karunakar; Gao, Liming; devel@edk2.groups.io
Cc: Yao, Jiewen
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresen= ceLib for Clear Graphics Screen To unblock and Display TPM messages

 

[EXTERNAL EMAIL]

My concern is that you unconditionally clear the scr= een. What if someone did want to show something on the screen?

 

This seems an incompatible change. That is why I thi= nk it should be a platform policy.

 

Another way is that you may consider to duplicate th= e library for your platform and clear it for your platform.

 

Thank you

Yao, Jiewen

 

 

From: Poosapalli, Karunakar <KarunakarPoosapalli@Dell.com>
Sent: Wednesday, August 9, 2023 2:13 AM
To: Yao, Jiewen <jiewen.y= ao@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io; Poosapall= i, Karunakar <KarunakarP= oosapalli@Dell.com>
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresen= ceLib for Clear Graphics Screen To unblock and Display TPM messages

 

Hi @Yao, Jiewen,

 

Thanks for your review and feedback.

When there is a pending Tcg request, the control wil= l be in Tcg2 library and it will not reach to BDS until user press the inpu= t key.

As there is no information the screen because of scr= een is blocked by some other messages/Logo.

So user won’t able to press the key without an= y user information and control will not reach to BDS phase.

 

As TCG user confirmation is the highest priority and= it blocks the POST until the user presses the input key. Before TCG messag= es Print on the console, there should be logic added to clear the graphics = screen

 

Please let me know your thoughts.

 

Tha= nks & Regards

Kar= unakar Poosapalli

Firmware Principal Engineer, Client BIOS=

Customer BIOS | Dell Core BIOS<= /span>

CPG Software Engineering | Dell Technologies

Mobile +91 9951902957<= /p>

Karunakar_poosapalli@Dell.Com<= /p>

 

 

Internal Use - Confidential

From: Yao, Jiewen <jiewen.yao@intel.com>
Sent: Tuesday, July 25, 2023 5:48 PM
To: Poosapalli, Karunakar; Gao, Liming; devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresen= ceLib for Clear Graphics Screen To unblock and Display TPM messages

 

[EXTERNAL EMAIL]

Hello

I agree with you on the problem statement.

 

But I don’t think this is a desired solution.<= o:p>

We expect Platform BDS to call the PhysicalPresenceL= ib. As such, why not clear the  screen in the platform BDS?=

 

Thank you

Yao, Jiewen

 

From: Poosapalli, Karunakar <KarunakarPoosapalli@Dell.com>
Sent: Monday, July 24, 2023 11:26 PM
To: Yao, Jiewen <jiewen.y= ao@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresen= ceLib for Clear Graphics Screen To unblock and Display TPM messages

 

Can you please review and share your feedback?<= /o:p>

 

 

Tha= nks & Regards

Kar= unakar Poosapalli

Firmware Principal Engineer, Client BIOS=

Customer BIOS | Dell Core BIOS<= /span>

CPG Software Engineering | Dell Technologies

Mobile +91 9951902957<= /p>

Karunakar_poosapalli@Dell.Com<= /p>

 

 

Internal Use - Confidential

From: Poosapalli, Karunakar
Sent: Saturday, July 22, 2023 1:21 AM
To: jiewen.yao@intel.com= ; gaoliming; devel@edk2.groups.io
Subject: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLi= b for Clear Graphics Screen To unblock and Display TPM messages

 

Patch review for Bugzilla -  https://bugzilla.tianocore.org/show_bug.cgi?id=3D= 4462 [bugzilla.tianocore.org]

 

From c537f9c5c9e02c54e27466b96fe33555afccd358 Mon Se= p 17 00:00:00 2001

From: Karunakar Poosapalli karunakar_poosapalli@dell.com

Date: Sat, 22 Jul 2023 01:13:44 +0530

Subject: [PATCH] Patch - Enhance Tcg2 to clear graph= ics before printing the

messages on screen

 

[Background]

Tcg2UserConfirm() Function is used to display any us= er conformation messages on the console

Function Definition Full path - SecurityPkg\Library\= DxeTcg2PhysicalPresenceLib\DxeTcg2PhysicalPresenceLib.c

 

[Issue]

In the current Tcg2UserConfirm() implementation, Thi= s function forms a destination string to be displayed on the console and di= rectly Print the message on Console.

 

But there is no logic added to clear the graphics be= fore printing the messages on the screen.

 

There are some scenarios where Tcg messages might ha= ve been blocked by some other GUI or messages on Console.

  1. When there are some messages or logos alre= ady displayed in the content on the console,

     TCG message will NOT be dis= played or corrupted to the End user.

  2. There could be a Custom logo displaying on= the screen which actually blocks the screen.

 

[Solution]

  1. As TCG user confirmation is the highest pr= iority and it blocks the POST until the user

     presses the input key. Befo= re TCG messages Print on the console, there should be logic

     added to clear the graphics= screen

 

Cc: gaoliming gaoliming@byosoft.com.cn

Cc: Jiewen  Jiewen.yao@intel.com

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4462 [bugzilla.tianocore.o= rg]

Signed-off-by: Karunakar Poosapalli karunakar_poosapalli@dell.com

---

.../DxeTcg2PhysicalPresenceLib.c   &n= bsp;          | 74 +++++++++++= ++++++++

.../DxeTcg2PhysicalPresenceLib.inf   =          |  1 +

2 files changed, 75 insertions(+)

 

diff --git a/SecurityPkg/Library/DxeTcg2PhysicalPres= enceLib/DxeTcg2PhysicalPresenceLib.c b/SecurityPkg/Library/DxeTcg2PhysicalP= resenceLib/DxeTcg2PhysicalPresenceLib.c

index de4f5e583d..bd486f3b5b 100644

--- a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib= /DxeTcg2PhysicalPresenceLib.c

+++ b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib= /DxeTcg2PhysicalPresenceLib.c

@@ -251,6 +251,74 @@ Tcg2ExecutePhysicalPresence (

   }

}

 

+/**

+  Clear Graphics Screen To unblock and Display= TPM messages 

+

+  @param[in]  VOID

+  @retval     EFI_STATUS

+**/

+EFI_STATUS

+ClearGraphicsScreenToDisplayTpmMessages()

+{

+  EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;

+  EFI_STATUS Status;

+  EFI_HANDLE     &nbs= p;            &= nbsp;           *HandleBu= ffer;

+  UINTN      &nb= sp;            =             &nb= sp;   NumberOfHandles;

+  UINTN      &nb= sp;            =             &nb= sp;   Index;

+  EFI_DEVICE_PATH_PROTOCOL   &n= bsp;            *Gop= DevicePath;

+

+  DEBUG((DEBUG_INFO, "ClearGraphicsScreen= ToDisplayTpmMessages Entry...\n"));

+

+  Status =3D gBS->LocateHandleBuffer (=

+        &nb= sp;   ByProtocol,

+        &nb= sp;   &gEfiGraphicsOutputProtocolGuid,

+        &nb= sp;   NULL,

+        &nb= sp;   &NumberOfHandles,

+        &nb= sp;   &HandleBuffer

+        &nb= sp;   );

+  DEBUG((DEBUG_INFO, "LocateHandleBuffer = Status =3D %r, NumberOfHandles =3D %x\n", Status, NumberOfHandles));

+

+  if (EFI_ERROR (Status))

+  {

+    return Status;

+  }

+  for (Index =3D 0; Index < NumberOfHandles= ; Index++)

+    {

+      Status =3D gBS->H= andleProtocol (

+        &nb= sp;       HandleBuffer[Index],

+        &nb= sp;       &gEfiDevicePathProtocolGuid,

+        &nb= sp;       (VOID *)&GopDevicePath

+        &nb= sp;       );

+      DEBUG((DEBUG_INFO, &= quot;HandleProtocol GopDevicePath Status =3D %r, Index =3D %x\n", Stat= us, Index));

+      if (EFI_ERROR (Statu= s))

+        {

+        &nb= sp; continue;

+        }

+

+      Status =3D gBS->H= andleProtocol (

+        &nb= sp;       HandleBuffer[Index],

+        &nb= sp;       &gEfiGraphicsOutputProtocolGuid= ,

+        &nb= sp;       (VOID **) &Gop

+        &nb= sp;       );

+      DEBUG((DEBUG_INFO, &= quot;HandleProtocol Gop Status =3D %r, Index =3D %x\n", Status, Index)= );

+      if (EFI_ERROR(Status= ))

+        {

+        &nb= sp;   continue;

+        }

+

+      // Clear the graphic= s screen to black

+      Status =3D Gop->B= lt(Gop, NULL, EfiBltVideoFill, 0, 0, 0, 0, Gop->Mode->Info->Horizo= ntalResolution, Gop->Mode->Info->VerticalResolution, 0);

+      DEBUG((DEBUG_INFO, &= quot;Gop->Blt Status =3D %r, Index =3D %x\n", Status, Index));=

+      if (EFI_ERROR(Status= )) {

+        continue= ;

+      }

+    }

+

+  gBS->FreePool (HandleBuffer);<= /p>

+  DEBUG((DEBUG_INFO, "ClearGraphicsScreen= ToDisplayTpmMessages Exit...\n"));

+  return Status;

+}

/**

   Read the specified key for user confirm= ation.

 

@@ -576,6 +644,12 @@ Tcg2UserConfirm (

   BufSize -=3D StrSize (ConfirmText);

   UnicodeSPrint (ConfirmText + StrLen (Co= nfirmText), BufSize, TmpStr1, TmpStr2);

 

+  //

+  //Clear Graphics Screen To unblock and Displ= ay TPM messages

+  //

+  Status =3D ClearGraphicsScreenToDisplayTpmMe= ssages();

+  DEBUG((DEBUG_INFO, "ClearGraphicsScreen= ToDisplayTpmMessages Status =3D %r\n", Status));

+

   DstStr[80] =3D L'\0';

   for (Index =3D 0; Index < StrLen (Co= nfirmText); Index +=3D 80) {

     StrnCpyS (DstStr, sizeof (D= stStr) / sizeof (CHAR16), ConfirmText + Index, sizeof (DstStr) / sizeof (CH= AR16) - 1);

diff --git a/SecurityPkg/Library/DxeTcg2PhysicalPres= enceLib/DxeTcg2PhysicalPresenceLib.inf b/SecurityPkg/Library/DxeTcg2Physica= lPresenceLib/DxeTcg2PhysicalPresenceLib.inf

index e1c7c20d52..de423cfd13 100644

--- a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib= /DxeTcg2PhysicalPresenceLib.inf

+++ b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib= /DxeTcg2PhysicalPresenceLib.inf

@@ -54,6 +54,7 @@

[Protocols]

   gEfiTcg2ProtocolGuid   &= nbsp;           &nbs= p; ## SOMETIMES_CONSUMES

   gEdkiiVariableLockProtocolGuid &nb= sp;     ## SOMETIMES_CONSUMES

+  gEfiGraphicsOutputProtocolGuid  &n= bsp;    ## CONSUMES

 

 [Pcd]

   gEfiSecurityPkgTokenSpaceGuid.PcdTcg2Ph= ysicalPresenceFlags       ## SOMETIMES_CONSUM= ES

--

2.17.0.windows.1

 

 

Internal Use - Confidential

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#107664) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_SA1PR19MB55724DB3A066CAC410559FC28B12ASA1PR19MB5572namp_--