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 ECF86AC1A8F for ; Tue, 8 Aug 2023 23:13:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+jk/gfQ0VXDNFeqtiXN/aMhy+HcNLVtnur7S6Q4TqV8=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC: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=1691536425; v=1; b=s2CaCWShxpv6jj70JxnwQLZeQXHOzfRg5ED0GyC/3WiBfsiHCoFGefycMseUxitJ0K7ovhQS QG6haMCZwFQlOsyPpcxYkVlvbU5sSBZKxSqKXf7fNQBoK28Wmf+6Tg21sL2q4+r6eoDVOSukfUB MBuCtEuqitwOMAJ1rrS3mO/g= X-Received: by 127.0.0.2 with SMTP id lEAiYY7687511xWcEufsydAx; Tue, 08 Aug 2023 16:13:45 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.76534.1691536419103230002 for ; Tue, 08 Aug 2023 16:13:39 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="368436366" X-IronPort-AV: E=Sophos;i="6.01,157,1684825200"; d="scan'208,217";a="368436366" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 16:13:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="681439208" X-IronPort-AV: E=Sophos;i="6.01,157,1684825200"; d="scan'208,217";a="681439208" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga003.jf.intel.com with ESMTP; 08 Aug 2023 16:13:35 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 16:13:34 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Tue, 8 Aug 2023 16:13:34 -0700 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.47) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 8 Aug 2023 16:13:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ml2QhXC/LLjiBfzCFJjjXCjy7sbN6VHdmauzaFO5vV2aXNvLRVtNlq89XTj2uH6W4IspKNaQneUpxDvMlCisJ8OCfG5mKf1sLEwsD3GeEIChJsl9AGBQ36gXhbvJZAPX8a1/Q65ydIwLyGgw7wK/YvEujQ46ygtvSBSc/qxyhe3DpCfLQFkbFC3cvXBuLyMZp7+MzXtyeErFBIxrFVKYG+m/o7R2HDYzAcnw4iPOKyHhnXdZy0scGTTbDONGFPUNXpN709aK/dLdu2uFaJ3Rv1M6BWjNcToBsIz3wEQt5pwFSw5L0qvTZWTeV3iWn69ieHkIaGD/Skw0MzJAkCcycA== 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=3cXcauT8zP928eqpHOgqrxtvlDt2S80BqUcLXRmKcmw=; b=meOUqzuC2It7sgdYwJK8S64FpQQNfLZh09NY6hVmck8APTFMgvIYjpqX6wNYmLqd6uM0yzcOeF8B4yB3MTDZGjJhajZ/UqOP/dTqBcO+uR54wlhyeXnSlgOCIhbQ6XoXB40Jmvu2LHzz8/PPCUU2QiAHaJQUzgbrk4JPve6hoYROxIbGzYAbTYrAtFwMQrrml6nIm4nWiyiUaTvLVFqnKGMownUa6Ne5yoLaY2qhJkcwFC/PtKY3i/18zCjUecILLfiiQGtnPA6TFELNKAuN+PFVttZXt5fGqKVfhEWBTZN1wlA6iCPj7eGv/p6V50+Qrw57YRgg2YdFayXbjN1VdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by BL1PR11MB5240.namprd11.prod.outlook.com (2603:10b6:208:30a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Tue, 8 Aug 2023 23:13:31 +0000 X-Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::fdf8:dc0e:db69:f35b]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::fdf8:dc0e:db69:f35b%4]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 23:13:31 +0000 From: "Yao, Jiewen" To: "Poosapalli, Karunakar" , "Gao, Liming" , "devel@edk2.groups.io" CC: "Yao, Jiewen" 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: Adm8DJurGgUFmZ0XSiuVHtzYqmi7VgCNo1NgACuqkgACzGH2gAAKjkkA Date: Tue, 8 Aug 2023 23:13:31 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US 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-08T18:12:56Z; 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=5ece61ac-cee0-435e-829f-0edc442ffc46; MSIP_Label_73dd1fcc-24d7-4f55-9dc2-c1518f171327_ContentBits=2 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|BL1PR11MB5240:EE_ x-ms-office365-filtering-correlation-id: e42d4d4c-776e-40af-3e47-08db9865150e x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: FQcHUNcjEVBcNa7XKR8VI4J02039rRUKkh+vJARSqz6j8NHu7gfOAQ53MmCfauSWF0s1HAxuguR7bg3Jz+IufmZlk0BNPUE1JqVNc6Di67C7OEUZzUYBYrlYCtt4gGjuasKbiUsal/CZChNnI+abRsR7VG8vooCjTOxjDrfTEHHKwb1Jg9mG8djC5Jvo+GjY8ilGstGOSGhMcQWx2+M0EjZ3hldsXZxRY81b1HgsVocbp/brBKZGcvBF6jFWEBpuY0JZ9HlWetmEFvme8I8UjDJVof+mbCq0pO8lbFwlm+ZD40dLztDNRvUD0bLTLQ9LIN5ncs7b+7Jt9XTzg93OOFQVM1jsY1m6Pb7ahlp0Qr5DpdZtL/uepBU5vQzcFS4XOvvcCc9nLDUPV63xyhqeL8ls9AcaLfMLT+TCu0AiCBoOeD0WoMuqtks2Q/ns56pOpWhdF9HjDKLetfJi+u5oysovrU2LhbX6RoYHpn9gkoxThMoORh6oRm05vRJqRSyiMGehq60GXY0IBiCjRRDxEhcqluw8QNM7ZbI4nfNnxgjLSYRw5FP4JaSo8x3Vv/BLHTXZnho2cu5RykZrXJm8053EpWd3D3XpAJjgzB9Puws= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V91uF6coI3h8UF7DJU2l71XO/ZgpR6SbabUI7q2kvKq/Dx+hPwyts24tBRYS?= =?us-ascii?Q?EpyM2kck8I2K25zW7pgq4QrxWNoTTW4arIUvz3Kgwf2nX5OCllkAdBigKLpd?= =?us-ascii?Q?4nwGfoWqFuC/AWGm3w31vJ6jwCLFdEs5wJAcfKD6yoamqg9xd6rlax1sxMfi?= =?us-ascii?Q?2jBerCak/kcaswWiUvFGqTtgVFJFyJnS8sNXjHMhlx4JzHkYNj/xXpGjUsgy?= =?us-ascii?Q?t1/q269IRiTLzS3+3NvIH0BHH26QMZrHS2IOQy9gGVoo9G6uR0KjEg4kqyv1?= =?us-ascii?Q?j14zxjz/IWYY7V81zuOtfM2b8hPWpm2NxiGKv1kr9XPr0CmXUY5bBSiM4Z+5?= =?us-ascii?Q?6trRGe1pt+wGoKkGgZbWDKpxMackaWenZHyrdJkBK2eC8tYHmW3uuNcK4Uog?= =?us-ascii?Q?JVMwa5JiQquNslZCzPGjZlyKUHr+3vGqfY3ELYPj1PFUp1RhWtRuqRCI5jUr?= =?us-ascii?Q?bPVrL6GlUQXcfgim8Nl5mi5Kuyo/jxaoJQq5Li7DJ4Oj45MW6cRzrepyUu0p?= =?us-ascii?Q?aO+YNuOu6cf25STDsFe9dV16lC2eHX1jM4f0VF+9e4pSlRpItDaRsKYwcd+0?= =?us-ascii?Q?wYm/CrMZYGBT1xft0U2r/0DEyvLSwOzbO1FiA0xvy/ff/iLHbJy0eX2O225H?= =?us-ascii?Q?6CYfNRFt3vPp+KrOgEPiBBIWvLpcgBPlEzin/ynCcx8xvPcwZbOtnSpSH9ZG?= =?us-ascii?Q?sLZi0UeVEik6paibr8GwSM5BoSAyqjiL7d3KhsHE25qqN3AgrHKspLbSBA1Y?= =?us-ascii?Q?CX3ZwhgROWQ+09z4iC8OOYVE3FsFPFUJFjILQHwP809S2gnay2aCM0MqIsIt?= =?us-ascii?Q?WyFjedVVErre17GrJOIG8kIFI8/8NlBSgi7zwhIESFE1SrW8E2FI7fcWX/kN?= =?us-ascii?Q?UEyu8vLSYv44cDopqkbmrEEPG0NG2PZZzd5GkWvQUA8CvqUUxwUblEnzvvWJ?= =?us-ascii?Q?joDAR4ty1FL/T0QEtB33/+ocrKscqKw592QzTcHrNuyAo3M0j2R4IXxRCysG?= =?us-ascii?Q?j2OQDWtQWAaFlmpFD8tvbV8TGZr/HAvva6xZKzagfXMFQcOFIYvDnyYtKAdx?= =?us-ascii?Q?uA2zHm/zB9RpCmjBi6G7QKm6xmObgdF3XRRnb/XdKff79zp73mRS4VskNiY1?= =?us-ascii?Q?f4IFd0xTvcj95HLnjcX5583DnKuK5bYIhd8aUm8irDrNJq+O4uggwl3oEKOu?= =?us-ascii?Q?hOXI5NSQbdelrtgAifKv1evLk2Nn2KtpeakstMC/67cjXayo7cwDQ6WZnEXE?= =?us-ascii?Q?aA9bBUkTqpbHqw+Dyu58KQXIqq0oJAKQ6aw2Awqhbp5oQtuYkgNt3dCN5plh?= =?us-ascii?Q?cBcLQwXJEsHLILKTV3T22YVReJ5w/7eSbA6t/qViqZUJm/eU891uvY5FGn7g?= =?us-ascii?Q?mAm/Onb3Kji4J3nzxY90BfO5K+MrudrWWfHu7DRaOnVDkCxxxeMB5tQSDAfj?= =?us-ascii?Q?4R7N6053vnIazOrPH747ykiXgnW33fGxFg7F8Ke2B1qlTvAfGiCDqH8Ie0bM?= =?us-ascii?Q?F1Eqs3rzGoN1Ru0qL3yLyiyI0ZOtdPvOPBrXpls9ORFGkaDIneBA0qePAo63?= =?us-ascii?Q?fX0853pv/jEuQ58KbYQ=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e42d4d4c-776e-40af-3e47-08db9865150e X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2023 23:13:31.5252 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: snjkqK05FpPy+Cb70WmNBfQJlvOAYMXvHxmKjGGEK/41VmG/sXnnR2ARD7u4B5cw37X0Kzd14ITBbYE/yXUh+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5240 X-OriginatorOrg: intel.com 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,jiewen.yao@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ILvJh4m7G2lEIxuuNkSgvrmyx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MW4PR11MB5872A550D98A4DF5E7CB42318C0DAMW4PR11MB5872namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=s2CaCWSh; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_MW4PR11MB5872A550D98A4DF5E7CB42318C0DAMW4PR11MB5872namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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, Liming ; devel@edk2.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 (#107648): https://edk2.groups.io/g/devel/message/107648 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_MW4PR11MB5872A550D98A4DF5E7CB42318C0DAMW4PR11MB5872namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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 <KarunakarPoos= apalli@Dell.com>
Sent: Wednesday, August 9, 2023 2:13 AM
To: Yao, Jiewen <jiewen.yao@intel.com>; Gao, Liming <gaolim= ing@byosoft.com.cn>; devel@edk2.groups.io; Poosapalli, Karunakar <Kar= unakarPoosapalli@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 (#107648) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MW4PR11MB5872A550D98A4DF5E7CB42318C0DAMW4PR11MB5872namp_--