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 5DFAE740034 for ; Thu, 21 Sep 2023 19:03:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=x5Vfum+lox9+YZju2AcRlAmZYvuJzBNVeM7fhnERTCk=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:From:Cc:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695323014; v=1; b=JRhlnxBE5ieeeWjpE9/08fOGP9R8rezTJMYDviDqoL+JkqNsSWPKvikNX5vIRiGhUUh9dKs+ ODvLTYsq1NnkMs3njFt/NkSIw7lofI8rak8rvwMclEsSmrbIuRxbecJU6x+jeXD2y0f3uqokC8Q RpflOFCjX1VhS+M8LSsd+VBo= X-Received: by 127.0.0.2 with SMTP id AV96YY7687511xIkWOoqpb3u; Thu, 21 Sep 2023 12:03:34 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.4425.1695323013388263190 for ; Thu, 21 Sep 2023 12:03:33 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 354CB1042; Thu, 21 Sep 2023 12:04:10 -0700 (PDT) X-Received: from [10.118.106.172] (C02F85CGML7H.austin.arm.com [10.118.106.172]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F1D313F67D; Thu, 21 Sep 2023 12:03:32 -0700 (PDT) Message-ID: Date: Thu, 21 Sep 2023 14:03:32 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [edk2-devel] [PATCH v2 4/6] uefi-sct/SctPkg: TCG MORLOCK Unlocked State Test To: devel@edk2.groups.io, Abhi.Singh@arm.com References: <20230921163748.275971-1-Abhi.Singh@arm.com> <20230921163748.275971-5-Abhi.Singh@arm.com> From: "Stuart Yoder" Cc: G Edhaya Chandran , Barton Gao , Carolyn Gjertsen In-Reply-To: <20230921163748.275971-5-Abhi.Singh@arm.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,stuart.yoder@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 9D42TPh9Mu5De05Up7M8XNZrx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=JRhlnxBE; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.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 See inline... On 9/21/23 11:37 AM, Abhimanyu Singh via groups.io wrote: > SCT spec: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4374 >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4419 >=20 > -Implement MemoryOverwriteRequestControlLock Unlocked State > test cases > -Add Assertions 19, 20, 21, and 22 from SCT spec > -Add Test Case to MemoryOverwriteRequestFunctionTest >=20 > Cc: G Edhaya Chandran > Cc: Barton Gao > Cc: Carolyn Gjertsen > Signed-off-by: Abhi Singh > Change-Id: If9cbea790d6c0f5aaceb6834fb91f5e1f3752244 > --- [cut] > +MORLOCK_UNLOCKED_STATE: > + // > + // TESTING MORLOCK scenarios when the Variable is in the Unlocked Stat= e > + // > + > + ResetData->Step =3D 0; > + ResetData->CheckpointStep =3D LOCK_NO_KEY_STATE_TEST; > + Status =3D RecoveryLib->WriteResetRecord ( > + RecoveryLib, > + sizeof (RESET_DATA), > + (UINT8*)ResetData > + ); > + if (EFI_ERROR(Status)) { > + StandardLib->RecordAssertion ( > + StandardLib, > + EFI_TEST_ASSERTION_FAILED, > + gTestGenericFailureGuid, > + L"TestRecoveryLib - WriteResetRecord", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + Status > + ); > + return Status; > + } > + > + // > + //Setting MORLOCK to Unlocked when already in Unlocked State should re= turn EFI_SUCCESS > + //and the MORLOCK value should still be =3D 0x00 or Unlocked > + // Nit- space after comment char. > + DataSize =3D sizeof(MemoryOverwriteRequestControlLockData); > + Attributes =3D TCG_MOR_VARIABLE_ATTRIBUTES; > + MemoryOverwriteRequestControlLockData =3D MOR_LOCK_DATA_UNLOCKED; > + > + Status =3D gtRT->SetVariable ( > + L"MemoryOverwriteRequestControlLock", // Variab= leName > + &gEfiMemoryOverwriteRequestControlLockGuid, // Vendor= Guid > + Attributes, // Attrib= utes > + DataSize, // DataSi= ze > + &MemoryOverwriteRequestControlLockData // Data > + ); > + if (Status =3D=3D EFI_SUCCESS) { > + Result =3D EFI_TEST_ASSERTION_PASSED; > + } else { > + Result =3D EFI_TEST_ASSERTION_FAILED; > + } > + > + StandardLib->RecordAssertion ( > + StandardLib, > + Result, > + gTCGMemoryOverwriteRequestTestFunctionAssertionGuid019= , > + L"MemoryOverwriteRequestControlLock - Setting to Unloc= ked when Already Unlocked Should return EFI_SUCCESS", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + Status > + ); > + > + Status =3D gtRT->GetVariable ( > + L"MemoryOverwriteRequestControlLock", // Variab= leName > + &gEfiMemoryOverwriteRequestControlLockGuid, // Vendor= Guid > + &Attributes, // Attrib= utes > + &DataSize, // DataSi= ze > + &MemoryOverwriteRequestControlLockData // Data > + ); > + if (EFI_ERROR (Status) || (MemoryOverwriteRequestControlLockData !=3D = MOR_LOCK_DATA_UNLOCKED)) { > + Result =3D EFI_TEST_ASSERTION_FAILED; > + } else { > + Result =3D EFI_TEST_ASSERTION_PASSED; > + } > + > + StandardLib->RecordAssertion ( > + StandardLib, > + Result, > + gTCGMemoryOverwriteRequestTestFunctionAssertionGuid020= , > + L"MemoryOverwriteRequestControlLock - Lock value remai= ns Unlocked", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + Status > + ); > + > + // > + //Setting MORLOCK with an invalid Data parameter !=3D 0x01 should retu= rn EFI_INVALID_PARAMETER > + //and the MORLOCK value should still be =3D 0x00 > + // Nit- space after comment char. Thanks, Stuart -=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 (#108965): https://edk2.groups.io/g/devel/message/108965 Mute This Topic: https://groups.io/mt/101504336/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-