From nobody Fri May 17 04:59:52 2024 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+88566+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+88566+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1649381107; cv=none; d=zohomail.com; s=zohoarc; b=T1PLDsc5R6IhIXnbgxS5am3NC23ckbCaDQjhXvYbcOPm0uEFHgkqhFueKaWP+Z0G2DqGrg+y01aZQzzb3bsxQyWh+xibb92t5CIlc2rF2IyJdj7Hh/WGUMRgyWZsW1922QqoD9Oziz5kprgdhZhrBcw6yAJnSukJ7ncpQE434mM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649381107; h=Content-Type: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=CD5xGdpYuj5S3vi+382Mr/wdz4lJnillXKAEZtQ7PSY=; b=JHphhCvRyHYWVP5obkFmOkbj1WVlqRq6poATVaVrMCjIsPLmXcb6rZMWRg00Wi5Oo83ca63aswXUDi5YJsTkIUPxVpp+yroRb/pwc3daFA6WErkPYsjVax1wYKvXxb9VE+R/QjcomoS1khyLgBzUyFRfBWjDSlm6vFeV674/yvU= 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+88566+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1649381107156950.4790358965126; Thu, 7 Apr 2022 18:25:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1CkbYY1788612xXM4Qkx5jgO; Thu, 07 Apr 2022 18:25:06 -0700 X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web12.875.1649381104492219187 for ; Thu, 07 Apr 2022 18:25:05 -0700 X-Received: from DESKTOP6Q83COE ([223.167.21.157]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 08 Apr 2022 09:24:51 +0800 X-WM-Sender: gaojie@byosoft.com.cn X-Originating-IP: 223.167.21.157 X-WM-AuthFlag: YES X-WM-AuthUser: gaojie@byosoft.com.cn From: "Gao Jie" To: "'Sunny Wang'" , Cc: "'G Edhaya Chandran'" , , "'Samer El-Haj-Mahmoud'" , , , , "'Ruiyu Ni'" References: <40f426fe26ce900c75da32412d51d858fa051b04.1637723578.git.gaojie@byosoft.com.cn> <16D8EF12A218664D.30809@groups.io> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSB1ZWZpLXNjdC9TY3RQa2c6RW5oYW5jZSBCQlRlc3RSZWFkS2V5U3Ryb2tlRXhGdW5jdGlvbkF1dG9UZXN0Q2hlY2twb2ludDEoKQ==?= Date: Fri, 8 Apr 2022 09:24:55 +0800 Message-ID: <000001d84ae7$7435bfd0$5ca13f70$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQJ7GC6ByWEgDkNI3Rkm+FieBdNENgJMBN2nAdi3+72rfne88A== 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,gaojie@byosoft.com.cn X-Gm-Message-State: WBlFNU05157m0WrwnYPU8iZ6x1787277AA= Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649381106; bh=0UES6El1VoVH1eZnrAFo/ji+SXflAa21eUP6OYBk+Vc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=BRiu/9ZuY8ArvhsANznjPn4D1XTjijC+xI+4hChQqQ5nuf/dypR6l1OdTANFcJaFdHt G6nOXaXVYh5QmqWfGio1X/hus4ZmqcaYAF96IsPxl86v2NEZc9Svdd37hDA6bl5zsfeyH xMPOG71/EVsfdOLX18m7vj5RVq2MD/TQSO8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649381109044100003 Content-Type: text/plain; charset="utf-8" Hi Sunny, Thanks for clarification. I will update the patch to make test fail when KeyState is not touched. Thanks Barton -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- =E5=8F=91=E4=BB=B6=E4=BA=BA: Sunny Wang =20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B44=E6=9C=887=E6=97=A5 22:= 51 =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; Sunny Wang ; gaojie@byosoft.com.cn =E6=8A=84=E9=80=81: G Edhaya Chandran ; Carolyn.Gj= ertsen@amd.com; Samer El-Haj-Mahmoud ; eric.jin@intel.com; arvinx.chen@intel.com; Supreeth.Venkatesh@amd.com; Ruiyu Ni ; Sunny Wang =E4=B8=BB=E9=A2=98: RE: [edk2-devel] [PATCH] uefi-sct/SctPkg:Enhance BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1() Hi Barton, As our discussion in today's edk2-test bug triage meeting, my second point " UEFI spec implies that the ReadKeyStrokeEx should clear KeyState (set the value to zero) if there is no key data" is not clear enough. Sorry about that. To be clear, UEFI spec says the following: - UEFI drivers which implement the EFI_SIMPLE_TEXT_INPUT_EX protocol are required to return KeyData.Key and KeyData.KeyState values. These drivers must always return the most current state of KeyData.KeyState.KeyShiftState and KeyData.KeyState.KeyToggleState. However, when user doesn't press any key, there will be no most current state to return. For solving thie problems, @Ruiyu Ni (In Cc) has patch series https://edk2.groups.io/g/devel/message/20311 and commit message below: - Today's implementation only return key state when there is a key.But when user doesn't press any key, the key state cannot be returned.The patch changes the ReadKeyStrokeEx() to always return the key state even there is no key pressed. Therefore, this is just preferred implementation rather than a requirement in spec. Best Regards, Sunny -----Original Message----- From: devel@edk2.groups.io On Behalf Of Sunny Wang via groups.io Sent: 03 March 2022 17:28 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() Sorry for the late review. The change looks fine. However, I'm confused about the comment " Log the error here and return key states are not supported when high order bit of KeyToggleState is 0 or KeyState not touched". It looks like returning EFI_UNSUPPORTED won't log any error/failure in the result log. Did I overlook anything here? Furthermore, it looks like UEFI spec implies that the ReadKeyStrokeEx should 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/message/20311 Therefore, if I didn't overlook anything here, we should separately deal with the "(Key.KeyState.KeyShiftState =3D=3D 0xFFFFFFFF) || (Key.KeyState.KeyToggleState =3D=3D 0xFF)" as a failure rather than directly returning EFI_UNSUPPORTED. 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; arvinx.chen@intel.com; Supreeth.Venkatesh@amd.com Subject: [edk2-devel] [PATCH] uefi-sct/SctPkg:Enhance BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1() 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/BlackBoxTest/ SimpleTextInputExBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/ SimpleTextInputExBBTestFunction.c index 0398bc26..c1669959 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/ SimpleTextInputExBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/ SimpleTextInputExBBTestFunction.c @@ -1160,6 +1160,12 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( ValidState[5] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; ValidState[6] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_SCROLL_LOCK_ACTIVE |EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; + // + // Set all bits to one (invalid values) for both KeyShiftState and KeyToggleState + // + 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.KeyToggleSt= ate =3D=3D 0xFF)) { + // + // Log the error here and return key states are not supported when high order bit of KeyToggleState is 0 or KeyState not touched + // return EFI_UNSUPPORTED; } diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBoxTest/ SimpleTextInputExBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBoxTest/ SimpleTextInputExBBTestFunction.c index adbf3dcf..e20ed345 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBoxTest/ SimpleTextInputExBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBoxTest/ SimpleTextInputExBBTestFunction.c @@ -1160,6 +1160,12 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( ValidState[5] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; ValidState[6] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_SCROLL_LOCK_ACTIVE |EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; + // + // Set all bits to one (invalid values) for both KeyShiftState and KeyToggleState + // + 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.KeyToggleSt= ate =3D=3D 0xFF)) { + // + // Log the error here and return key states are not supported when high 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 confidential and may also be privileged. If you are not the intended recipient, please 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. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please 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. -=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 (#88566): https://edk2.groups.io/g/devel/message/88566 Mute This Topic: https://groups.io/mt/90327331/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-