From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (EUR03-DB5-obe.outbound.protection.outlook.com [40.107.4.60]) by mx.groups.io with SMTP id smtpd.web11.13599.1646328525977619484 for ; Thu, 03 Mar 2022 09:28:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=kGHgihKh; spf=pass (domain: arm.com, ip: 40.107.4.60, mailfrom: sunny.wang@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z9bpR5ME+OyUNH8eUz3BbUUw8s6uUldywOmW3wMu/m4=; b=kGHgihKh+gF9iar1Rgk7sUgdWP73D7x82ECg5QrWzAaKSTEMgSESgzo6niIXf+J6qOs3CPpjOmv+DH7s7/z0AxB8DhFRHlkAX+YBJ42uGyq7nF7WJPyHl+z8mzX9UqcEYV4o62xjAnJZcEEMtXVgvr6UDGIv+ouh3DXxjodyEUc= Received: from AM6PR10CA0086.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::27) by AM9PR08MB6644.eurprd08.prod.outlook.com (2603:10a6:20b:30e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.13; Thu, 3 Mar 2022 17:28:29 +0000 Received: from AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8c:cafe::d5) by AM6PR10CA0086.outlook.office365.com (2603:10a6:209:8c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14 via Frontend Transport; Thu, 3 Mar 2022 17:28:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT027.mail.protection.outlook.com (10.152.16.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22 via Frontend Transport; Thu, 3 Mar 2022 17:28:28 +0000 Received: ("Tessian outbound 31aeb3346a45:v113"); Thu, 03 Mar 2022 17:28:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 718ffec49b34489f X-CR-MTA-TID: 64aa7808 Received: from 23dd5f14626b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7DE812D2-8C02-42A1-8F2E-F67E59CF4CF2.1; Thu, 03 Mar 2022 17:28:27 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 23dd5f14626b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 03 Mar 2022 17:28:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RKOxkuygVHNMDMufm0uo4PMF+rqSLH9YPxOVIQNGf1VGNZ2GjA6dSk5PHzMgTBEicEyLAXnasxPkQQhz9PAN03IH75I+YbCflC7k1zR7ocgkhY0wq0sjDXRJoIrkCrXvc9zuFFpbM8qvzTmKidQzycAzXF9gfb7ouC2fG0jysQeZJ8+lIh7xjAPdk8OKpfd76Ewz66lGYRIPPVgymwlUsNF/Hvz03Yf6y2XJstVzk7Bqni2yQxMRpj69A0YQV4IR9hB4q1wZHhp7rBAbEWUWDE02Lqrp9KcfYmgoxriDkkG/caAwjuA5CN5ya1zanxgDwI3UtuvEb/BmOl0BYy2cIw== 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=z9bpR5ME+OyUNH8eUz3BbUUw8s6uUldywOmW3wMu/m4=; b=jeqEKW1dEa5hU36+Lcj5oloFhKl3RoENoHyPNGtpRPxQH/NfA6PWskVI/u9Bin+88KNMOeufjiNe/ymPz7TXfqu9sgMrUHZu0NwOV87poEW1pNMPkuE8JUO2NMPLEt5snG+oRw5+eXP+xX0mo5RLJkoT6cIZ/kCW10AWxlnQ+br8OW5uJOYPl5cpR90WmCzwsGhjZP08VsH5Mo08n/xtihPFm6D1dGEUYRapKymFdqHClpVwnpi+oxYWnyVvcLxEJiUqKE+nQ3Aamh/BHIBd5wU757LebsxVm96GtonTiSg96R30MgkDP4o6rBIl5EhzUE1REs12rzx/eTJfvD9ZNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z9bpR5ME+OyUNH8eUz3BbUUw8s6uUldywOmW3wMu/m4=; b=kGHgihKh+gF9iar1Rgk7sUgdWP73D7x82ECg5QrWzAaKSTEMgSESgzo6niIXf+J6qOs3CPpjOmv+DH7s7/z0AxB8DhFRHlkAX+YBJ42uGyq7nF7WJPyHl+z8mzX9UqcEYV4o62xjAnJZcEEMtXVgvr6UDGIv+ouh3DXxjodyEUc= Received: from DB8PR08MB3993.eurprd08.prod.outlook.com (2603:10a6:10:ad::26) by AS8PR08MB7322.eurprd08.prod.outlook.com (2603:10a6:20b:441::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.24; Thu, 3 Mar 2022 17:28:16 +0000 Received: from DB8PR08MB3993.eurprd08.prod.outlook.com ([fe80::4446:43c2:bef0:86d3]) by DB8PR08MB3993.eurprd08.prod.outlook.com ([fe80::4446:43c2:bef0:86d3%7]) with mapi id 15.20.5017.027; Thu, 3 Mar 2022 17:28:16 +0000 From: "Sunny Wang" To: "devel@edk2.groups.io" , "gaojie@byosoft.com.cn" CC: G Edhaya Chandran , "Carolyn.Gjertsen@amd.com" , Samer El-Haj-Mahmoud , "eric.jin@intel.com" , "arvinx.chen@intel.com" , "Supreeth.Venkatesh@amd.com" , Sunny Wang Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg:Enhance BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1() Thread-Topic: [edk2-devel] [PATCH] uefi-sct/SctPkg:Enhance BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1() Thread-Index: AQHX4OHcp0OloRQbvUeEd7mMv5PLYKyugFMQ Date: Thu, 3 Mar 2022 17:28:16 +0000 Message-ID: References: <40f426fe26ce900c75da32412d51d858fa051b04.1637723578.git.gaojie@byosoft.com.cn> In-Reply-To: <40f426fe26ce900c75da32412d51d858fa051b04.1637723578.git.gaojie@byosoft.com.cn> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: c8739010-327b-4a77-0f06-08d9fd3b3b5b x-ms-traffictypediagnostic: AS8PR08MB7322:EE_|AM5EUR03FT027:EE_|AM9PR08MB6644:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: JOU6swuTClSJmtZ5O57E8RRyzVKAFo0Kblpu23JE7H6GnSg5dEyp2l5w/wjiemAPQRn4tjCJ+m9Co26xTY1JHQIxlAYllsu05EKy3r3c1+O6TobVOgMa7jxf8IrhnRIcUVHpZJGk/hbRwlj1EanQK2rY3UE9jXwdlHo4EVdA5SFHuRgturoGtEfg8Jln9dhA3TNqyfWa4vEOJGuZUSJjbX+QeBvk0v1if6bAiuGCo/TedTjLgH7I0xbLZcblytREnj7DyuTFvQAptNS+NmMfUCYqGc+VQmvI6QKZq05IEsM8o2OCbccFavDL2QyvtEaaf/iufU57bLELSPC5VvawRXkgbjVLEbRq6QzDLj5CzLZShNGMJnd0P8HA6S4keVjI3pDY+zTT7y5WtresHMORM8AGLMP+HxyjXu4kcfU+8MZBK5+xYIKJwKbZppv6rXUxF8CA5nD2tlRsZmEXOGqHUYq2rmwOMpBCi472x1BJvbpRQFCkVlnTtxYuPe+U/5/E6F0rTfjtYNex1k7yEwB3JsjFhvojSGeC2dleSvU+vZX0oVdxHXZqyYQAUOvfgU0chBzPraZGu/6bcFHF0j/FqWZ7EOl9TEgfdOCW7IXbErE29YKkgw/DvtZ9Cjh/VrbAH3QtKBSpbHYUPcQoPS1Z1IqJCqBc08Xq6Y0t8A7Cv92hGmlCH6gVZvYrxOwShhBjiGrSFpotf0xuOFUBZVPExWWYRVmQIAGjHi4VOu+RzEMfcDWVrGNhHb7qCDxjt2An0RDmFhTyy9GkQGyyZv1swl1Z9xR8UL5nOvcfg3DBj2Hro4YlHlCh3SMMb96T9t0tWVNelYKH/i+GL8ZPxUov8Q== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR08MB3993.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(6029001)(4636009)(366004)(110136005)(966005)(6506007)(9686003)(64756008)(26005)(186003)(71200400001)(8676002)(4326008)(54906003)(33656002)(2906002)(508600001)(76116006)(66946007)(66556008)(66476007)(66446008)(5660300002)(19627235002)(316002)(53546011)(7696005)(8936002)(86362001)(52536014)(55016003)(83380400001)(38070700005)(122000001)(38100700002);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7322 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sunny.Wang@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 54377eec-705a-43a6-a976-08d9fd3b33f7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZeiD3YarGLReIAnfIyRDQY8VudBH2bIn9pPBiK43YJ2g/6fDwhHqJXuU2i/ggnmvKIcNYu0psnFNVnWhyqfeUGMAAer5pd36R3cWI8+LbIPyoQkUA/lBbJQcjy/D+3g1B/4B3vD0l3VQEYtZXHAN7UISF6gedan3dxQLC2x3UPD1qytlxzIGCAhdTf0WlXeWkYLgWQDFXh+4+fMmNGMmUJr/jjaSnvhNxojtuOrOBIDLPE8yEoBPebOvCCJDBegW9hrvYM42tgw6NM7syNn8byk9hrKxViJ75Xpwpp6yLKm3UchTxbe8nldryYFoU/79uvQaA5PrHhURCtAm8XTjNXkMAmMeYofyf9LPsdAmr8ODsJRw7oilKItx4xnyG5rQ8WORVyVH17b6Ipeb/gDIHP10oSn7/AnCtlyUB8DeFDDDQCkaw9U5TGpJt2Dty0N86t4P/idfn7ptRlvknGBDl+eU/BmmwBWE5oDK9tVKnXF4nCnYShKrBQ4MQo3giyKjF5YCC90pocMmhIiDfXaERKqDWkF16Z2rGpgLuoePfx6qlEQqTL0lGK1+6OcDzbF/KoJez8cAaGfIW95Z9oS860eLyHT4/WhOlXKVynjTkRqAV8m9ZsYd053raiAvRChkwGLHf3h0eyKLjkv64/Jnx7jWyJjeSmzbqDV2H4LoCS/IzXT6ZdUmkeeBB5AshkAK9nBI5mNAtvRXY3TYUucEvY2iCMhURsZ96S72uhvpMnfXS7TdkcDgzHbcjKFvKpvXCU2S9LMSZYuSsWINSELSYGyqEC+ThsuhW3Y+yeBooFmFGUH681uatXcWtv+1hpW2 X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(6029001)(4636009)(46966006)(36840700001)(40470700004)(110136005)(316002)(8936002)(966005)(52536014)(8676002)(4326008)(2906002)(26005)(54906003)(40460700003)(86362001)(508600001)(70206006)(70586007)(19627235002)(7696005)(9686003)(6506007)(53546011)(36860700001)(81166007)(356005)(55016003)(33656002)(82310400004)(336012)(47076005)(83380400001)(186003)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2022 17:28:28.9575 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8739010-327b-4a77-0f06-08d9fd3b3b5b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6644 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sorry for the late review. The change looks fine. However, I'm confused about the comment " Log the er= ror here and return key states are not supported when high order bit of Key= ToggleState is 0 or KeyState not touched". It looks like returning EFI_UNSU= PPORTED won't log any error/failure in the result log. Did I overlook anyth= ing here? Furthermore, it looks like UEFI spec implies that the ReadKeyStrokeEx shoul= d clear KeyState (set the value to zero) if there is no key data. There is = also a code change for doing this in edk2. https://edk2.groups.io/g/devel/m= essage/20311 Therefore, if I didn't overlook anything here, we should separately deal wi= th the "(Key.KeyState.KeyShiftState =3D=3D 0xFFFFFFFF) || (Key.KeyState.Key= ToggleState =3D=3D 0xFF)" as a failure rather than directly returning EFI_U= NSUPPORTED. Barton and Edhaya, what do you guys think? Best Regards, Sunny -----Original Message----- From: devel@edk2.groups.io On Behalf Of Gao Jie via = groups.io Sent: 24 November 2021 03:16 To: devel@edk2.groups.io Cc: G Edhaya Chandran ; Carolyn.Gjertsen@amd.com; = Samer El-Haj-Mahmoud ; eric.jin@intel.com; ar= vinx.chen@intel.com; Supreeth.Venkatesh@amd.com Subject: [edk2-devel] [PATCH] uefi-sct/SctPkg:Enhance BBTestReadKeyStrokeEx= FunctionAutoTestCheckpoint1() REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2386 Enhance BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1() to handle ReadKeyStrokeEx implementation which returns EFI_NOT_READY but without touching KeyToggleState. Signed-off-by: Barton Gao --- .../BlackBoxTest/SimpleTextInputExBBTestFunction.c | 11 ++++++++++- .../BlackBoxTest/SimpleTextInputExBBTestFunction.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/B= lackBoxTest/SimpleTextInputExBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UE= FI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunct= ion.c index 0398bc26..c1669959 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c @@ -1160,6 +1160,12 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( ValidState[5] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_N= UM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; ValidState[6] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_S= CROLL_LOCK_ACTIVE |EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; + // + // Set all bits to one (invalid values) for both KeyShiftState and KeyTo= ggleState + // + Key.KeyState.KeyShiftState =3D 0xFFFFFFFF; + Key.KeyState.KeyToggleState =3D 0xFF; + // //Read next keystroke from the input device // @@ -1171,7 +1177,10 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( return Status; } - if ((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) { + if (((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) ||= (Key.KeyState.KeyShiftState =3D=3D 0xFFFFFFFF) || (Key.KeyState.KeyToggleS= tate =3D=3D 0xFF)) { + // + // Log the error here and return key states are not supported when hig= h order bit of KeyToggleState is 0 or KeyState not touched + // return EFI_UNSUPPORTED; } diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/B= lackBoxTest/SimpleTextInputExBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UE= FI/IHV/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunct= ion.c index adbf3dcf..e20ed345 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c @@ -1160,6 +1160,12 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( ValidState[5] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_N= UM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; ValidState[6] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_S= CROLL_LOCK_ACTIVE |EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; + // + // Set all bits to one (invalid values) for both KeyShiftState and KeyTo= ggleState + // + Key.KeyState.KeyShiftState =3D 0xFFFFFFFF; + Key.KeyState.KeyToggleState =3D 0xFF; + // //Read next keystroke from the input device // @@ -1171,7 +1177,10 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( return Status; } - if ((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) { + if (((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) ||= (Key.KeyState.KeyShiftState =3D=3D 0xFFFFFFFF) || (Key.KeyState.KeyToggleS= tate =3D=3D 0xFF)) { + // + // Log the error here and return key states are not supported when hig= h order bit of KeyToggleState is 0 or KeyState not touched + // return EFI_UNSUPPORTED; } -- 2.31.0.windows.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.