From nobody Fri May 17 02:41:23 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+88579+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+88579+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1649399588; cv=none; d=zohomail.com; s=zohoarc; b=LfpUW5AQZ6koko1RoVP0eD8B4PjksRkHMm4f2JsygdCaxAUw8WUFu9iw77D77zFB9MyE/RUUR0h/L3/20IEGmwrTwYDnkTmIj0Ka87QfV6mNFFs+plCj53EG7R/sDJfzIuLLzVE2rozQumW6Cj76kR1EZZPtkGfdb3LPz95zQ8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649399588; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=zYLbZR8xQ9lfDvmvYkt2fFbB9etC0dpgNPWLr1iqAX8=; b=dma8pYsaCd/PVWfPqOad1wdkg7/MBtn8d5XcaDLjvQBfoR8RO8zjm6eHFeLcCrGrP4AlW6m4pxi4twCDNdfS0kq5vlP4UOIkpJLiLqo+Dx6oxZQEAVDvJTbgsPeNZYjFn/bVyfcAa2RB+5ofF+6mSmDEdr+Uysa8NuP7oeflNNQ= 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+88579+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1649399588389794.9361584674839; Thu, 7 Apr 2022 23:33:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TEdEYY1788612xhCkEjA91w2; Thu, 07 Apr 2022 23:33:07 -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.2881.1649399585999669084 for ; Thu, 07 Apr 2022 23:33:06 -0700 X-Received: from DESKTOP6Q83COE ([223.167.21.157]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 08 Apr 2022 14:32:55 +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: , References: <20220303085854.436-1-edhaya.chandran@arm.com> In-Reply-To: <20220303085854.436-1-edhaya.chandran@arm.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIDEvMV0gVUVGSS1TQ1Q6IFNjdFBrZzogVXBkYXRlZCB0aGUgY2hlY2sgZm9yIG1vbm90b25pYyBjb3VudCBhZnRlciByZXN0YXJ0?= Date: Fri, 8 Apr 2022 14:32:59 +0800 Message-ID: <001401d84b12$7d6f2480$784d6d80$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQJ0ihTk7XWB4yzJ2qtWepNv4uvVPKutEA3Q 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: K3vxYXm1GlmKjEjQp7EY0caQx1787277AA= 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=1649399587; bh=l7VOUKtFbJz1dD+uBQH6FDlBq+rUK3f4KbP+eVPVTTw=; h=Content-Type:Date:From:Reply-To:Subject:To; b=roU75a5/yyGuw4NOHPcjvaV7yrHFn2Abxfi5D6HeNhBwpTZlgcB1BwpIdbYYRvMlnrm ljwOAEoV/FIVKv6p6fGkPdIo7VNeotiKyK19fpwW48DVOB5TQhb5VcPJ+782/u6uL4LUv ZuHfY8uO+ZvYdzTHTxM9aYAqJ996+ORBNdc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649399590644100003 Content-Type: text/plain; charset="utf-8" Hi Eday, The patch looks good to me. Reviewed-by: Barton Gao Thanks Barton -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 G Edhaya Chandran =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B43=E6=9C=883=E6=97=A5 16:= 59 =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH 1/1] UEFI-SCT: SctPkg: Updated the = check for monotonic count after restart Updated the check for montonic count in the case of after restart From the UEFI Spec: "The platform=E2=80=99s monotonic counter is comprised of two parts: the hi= gh 32 bits and the low 32 bits. The low 32-bit value is volatile and is reset to zero on every system reset. It is increased by 1 on every call to GetNextMonotonicCount(). The high 32-bit value is nonvolatile and is increased by one on whenever the system resets or the low 32-bit counter overflows." It was found in one case where the higher 32-bit increased by 2 presumably due to the overflow of lower 32-bit counter. Update the logic to handle this case and to print a warning. Please find more details in the ticket: https://bugzilla.tianocore.org/show= _bug.cgi?id=3D2774 Cc: Barton Gao Cc: Carolyn Gjertsen Cc: Heinrich Schuchardt Cc: Samer El-Haj-Mahmoud Signed-off-by: G Edhaya Chandran --- .../MiscBootServicesBBTestFunction.c | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootService= s/BlackBoxTest/MiscBootServicesBBTestFunction.c b/uefi-sct/SctPkg/TestCase/= UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest/MiscBootServicesBBTestF= unction.c index 5d631c16d58b..12703d46f98c 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/Black= BoxTest/MiscBootServicesBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/Black= BoxTest/MiscBootServicesBBTestFunction.c @@ -1707,12 +1707,20 @@ GetNextMonotonicCountStep2: TplArray[Index] ); =20 - if (SctRShiftU64 (Count2, 32) =3D=3D SctRShiftU64 (Count, 32) + 1) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - StandardLib->RecordAssertion ( + //The new count of upper 32 bits must be atleast 1 more than the old c= ount. + //Pass case: new count is equal to old count + 1 + if (SctRShiftU64 (Count2, 32) <=3D SctRShiftU64 (Count, 32)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + //If new count is more that old count + 1, then print warning. + if (SctRShiftU64 (Count2, 32) > SctRShiftU64 (Count, 32) + 1) { + AssertionType =3D EFI_TEST_ASSERTION_WARNING; + } else { + //new count =3D=3D old count + 1 + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + } + StandardLib->RecordAssertion ( StandardLib, AssertionType, Index=3D=3D0? \ --=20 2.17.1 -=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 (#88579): https://edk2.groups.io/g/devel/message/88579 Mute This Topic: https://groups.io/mt/90330601/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-