From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.78]) by mx.groups.io with SMTP id smtpd.web12.8043.1605621218660422720 for ; Tue, 17 Nov 2020 05:53:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=a2xadt7n; spf=pass (domain: arm.com, ip: 40.107.20.78, mailfrom: samer.el-haj-mahmoud@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=1RfOrWTuBygyR+HoO8OUXTJoQgSEJUtCN4XhZL9+WdU=; b=a2xadt7nCqBmgI3GTnjMh0BcSCQuJoZuOveZO9XFS8yHdvn8favTD9RoQzTdVJ+dC+CxtwsNFHTL4kagZFV0wOWXDTjif95eaBEFQABln5aOKTdcBUp76NnOAh4/QnopdHGPJpblWH2V7JV7c0LOedwHuXMG0QW0rbQlHx2cSRg= Received: from AM6PR10CA0098.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::39) by DB8PR08MB5450.eurprd08.prod.outlook.com (2603:10a6:10:116::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28; Tue, 17 Nov 2020 13:53:35 +0000 Received: from AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8c:cafe::89) by AM6PR10CA0098.outlook.office365.com (2603:10a6:209:8c::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28 via Frontend Transport; Tue, 17 Nov 2020 13:53:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; 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 AM5EUR03FT008.mail.protection.outlook.com (10.152.16.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.22 via Frontend Transport; Tue, 17 Nov 2020 13:53:35 +0000 Received: ("Tessian outbound 13ed5f5344c0:v71"); Tue, 17 Nov 2020 13:53:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0c2fd116ad6f853b X-CR-MTA-TID: 64aa7808 Received: from 2ff596b07941.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 26E9AC88-DCD8-4FEE-9CB7-9E2CEDEF99B8.1; Tue, 17 Nov 2020 13:53:25 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2ff596b07941.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 17 Nov 2020 13:53:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZqnIagsQloEynxXT67AsYXQaUpP9tWLCl7Yt735svFOwVQI2PzIDIXO1wt+LvmXe7DtwsImyzpevfYOPI9CgXQ7O81n/rbCu245fc5uG5iwji6mI40zaFL9QAx2/y+4XuoAREBe04RLLAtr1Nnm+pLU3l8PVf9zQLWnTGy5O+O465osEUbli7KydE7bkQTlrcCS7+ax/eFuleo+FZCmNdOenmA7vgQTqB3BY+fvpybGwtbCUHcUzKu8fcusimezwo9eD0FUzdMvcTDIdXv9YCJosW3fPTxQFsm/Ayv6K6ihpTCHtE3lcqQFS5HXkQcMVLuLBb2owbMgsa4Y8bZaWdw== 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-SenderADCheck; bh=1RfOrWTuBygyR+HoO8OUXTJoQgSEJUtCN4XhZL9+WdU=; b=T4psJYqViAl0hKeTH2MloxVM0jwr0T3qN+oLbYSJpVP64fPk8QXK3Vt6zm2ZGKUBCEn7F82J2s43j/pRe48BKk9G6AwdV4Qh1xaXMk90tfxVX4zgCS9SnoCwWzQv1+3aDjdz8OlLVGbnDSjalRuIdiF+bbpGHcy2mpKHntXhwqsUa56ZVMNGvOkT/hl8fL5axTBPVCT6QCXGbp+o1z4OtNee7um3iEM5qrGGn4BTqCdx/KRlp9J38EtEpAHozQeI9kV98klKq3SAjlgGWZicqVjBJ0LFDxLXmi2SBaEQI/ZTod3tkkXJbxNnKGqx3F424uus0MPbwf56t3rBYHfYkg== 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=1RfOrWTuBygyR+HoO8OUXTJoQgSEJUtCN4XhZL9+WdU=; b=a2xadt7nCqBmgI3GTnjMh0BcSCQuJoZuOveZO9XFS8yHdvn8favTD9RoQzTdVJ+dC+CxtwsNFHTL4kagZFV0wOWXDTjif95eaBEFQABln5aOKTdcBUp76NnOAh4/QnopdHGPJpblWH2V7JV7c0LOedwHuXMG0QW0rbQlHx2cSRg= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DBBPR08MB6314.eurprd08.prod.outlook.com (2603:10a6:10:20f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28; Tue, 17 Nov 2020 13:53:24 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::41d6:2494:e616:78a6]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::41d6:2494:e616:78a6%7]) with mapi id 15.20.3499.034; Tue, 17 Nov 2020 13:53:24 +0000 From: "Samer El-Haj-Mahmoud" To: "devel@edk2.groups.io" , "arvinx.chen@intel.com" CC: G Edhaya Chandran , "Jin, Eric" , "gaoliming@byosoft.com.cn" , "Chu, Maggie" , Samer El-Haj-Mahmoud Subject: Re: [edk2-devel] [PATCH 2/2] uefi-sct/SctPkg: Correct BBTestEraseBlocks behavior (EFI_BLOCK_IO_PROTOCOL) Thread-Topic: [edk2-devel] [PATCH 2/2] uefi-sct/SctPkg: Correct BBTestEraseBlocks behavior (EFI_BLOCK_IO_PROTOCOL) Thread-Index: AQHWsP8oBqzi5x8JIEej5OOn0pNMOKnDd0uQgAhtQmyAAItPQA== Date: Tue, 17 Nov 2020 13:53:24 +0000 Message-ID: References: <20201102095950.763-1-arvinx.chen@intel.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9bd4ba61-ba17-42e1-bad4-08d88b002dc4 x-ms-traffictypediagnostic: DBBPR08MB6314:|DB8PR08MB5450: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: evsmpq3aynJUXeOvP5lkCi/r4kOusOAfpEyo7S3lEy2qFv/2eV9Cqsfz6VTczJ2V3sO4XKMf6QMrQgUJMUYYThnYbtEKt/KojRRf37oiEeoa46T9aOmXzy8v1eOYRpZhoUS+gDq9QE2zHp+HAQchGiLHAmdNpKP/Rj2cCHi2v8lHMSUReN2XB7Y6LSV39eyXatpT+Wz+GanRXjg8U2ue2fZ8+OichQEtKrCmwG+L6JaBZAi5MjVh+Zjt+Iwl9Vjihgnwdb4AGyCgJQW74sOYKnsjxJFkyqnpJRxkN0DiCjKEsp+gwvykWGIuXFqXrgvaGyTD7PikjCJHLvR/wERrZWCX7D4TZ3v94KU4BKRnK1DszSGcHtZEY5rRKCs/7XErFVhMpIL1HwHIhr/Rb+XPPQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(346002)(366004)(39860400002)(376002)(71200400001)(6506007)(478600001)(76236003)(52536014)(33656002)(166002)(66556008)(66446008)(76116006)(66476007)(83380400001)(66946007)(5660300002)(64756008)(316002)(110136005)(186003)(54906003)(26005)(55016002)(53546011)(7696005)(9686003)(8676002)(2906002)(4326008)(86362001)(966005)(8936002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: mO52Wx5OajhapdZEqU49A5r3jpOYm9bo4X4dTamvONzCpYtMi0l5gfBD302UV43J37J2FyUfY/JF+zqYEk+H+ADkugyyaVnB2OwL0VbOGoLGpBReDFgcN5k/DHtDQ771RTIQYB3yahyAjd+5auQkzCw9ZQi8nrg8CPL6PVwgAb8o3XFxzcv6bZk+IAKvFNFJTzAoI8L3a+GH0D4yZaTQONEAOr6jBuOPNc4wetmb6/mmO5SFQHd8xICNd1EFhPaqxS05kda/kY1iFxglN95O9CsWgd8EXJqgGx5knrjkzP78bSJ3HGgZ6UQzcvHLWWEYIo2nZrSLFW3VQxe6Ct0LohRJuM97rv76oEfSsgFkXebr7yjpJztF9rVT1oKvvM3eLSPB1zs52hdKNGJb+5MTsWAs5pUkwI/MBvwUh9HqVdcFSwJvwVZYFN3TEbSr9MAf4BTJrZ+BQoXwuzwgCviK5SzTl47Wu5RY9BRvpQaeY2jXYXQgxeiIF2chbbXiU8rzyM7EvDk0iOaWce9CrAtxWnX1PJn9PY3gHi03IDxIAjRfSr2k/o+hGFygsH3OkJ8ysdfcdztBH28NHGoijJtSqhlH/s3wqApkPaF7ZDbTd9+mbYunTaTHN+3xYlM9BInpEIf4L3FBcvESNtfeY8Q40g== MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6314 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 7994429a-6e33-49c4-3d52-08d88b00272b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I6sqHmxxtrdh37Xn8kk4MExYriiXTG25XjuhH3Xxl6dFPy7tU84D8WZXpzWJk9jfz1z08GwL5vGAKQpEyLbxH33QpK5sgph0gffL25MhJ8dWHLGNCzuGS2/u9j1UoZgbKRCJReeNxBqmbKXjMtU5Ko8MSsheo9JwcgiiWn4sxGSKUO3PYRPMu4DSYzK9h0bU4v3hVp3oGKPn1ywaO6Yqm1dua2+thh4YYRfxqXyTnxpmj+Pj60CAf5WkOOsiNTPz7otH3IuB6wHGgtUCfI+wiVSEnFn5BY6eKHv/ywoDdHielxeOuPCSLC87le0Up87xVofdGxXKtB3VkNgx5KrS1VQvZ4S6jK3I3uyw3A2PMA87EN6dOmVTnlR12QGdB9YcgVhU/g8BMAsp+kJXEIgcBi1Y6K9kQY6CSmK0TdkJZ0d6q73wqvVE0g5c1jWBR2zh4ewfsVstCcKf0vAlOppJZNWlZsDINwLExKJ4ddisIyU= 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:(4636009)(346002)(39850400004)(396003)(136003)(376002)(46966005)(8936002)(5660300002)(52536014)(4326008)(70586007)(70206006)(33656002)(53546011)(36906005)(30864003)(6506007)(2906002)(7696005)(76236003)(166002)(8676002)(26005)(336012)(86362001)(83380400001)(82310400003)(316002)(186003)(966005)(47076004)(356005)(81166007)(9686003)(55016002)(82740400003)(478600001)(110136005)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2020 13:53:35.6274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bd4ba61-ba17-42e1-bad4-08d88b002dc4 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: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5450 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DB7PR08MB3260833F7CE9E7EE963EBF1F90E20DB7PR08MB3260eurp_" --_000_DB7PR08MB3260833F7CE9E7EE963EBF1F90E20DB7PR08MB3260eurp_ Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Thanks for the explanation. Reviewed-By: Samer El-Haj-Mahmoud > From: devel@edk2.groups.io On Behalf Of Chen, Arvin= X via groups.io Sent: Tuesday, November 17, 2020 12:51 AM To: Samer El-Haj-Mahmoud ; devel@edk2.groups= .io Cc: G Edhaya Chandran ; Jin, Eric ; gaoliming@byosoft.com.cn; Chu, Maggie Subject: =1B$B2sJ$=1B(B: [edk2-devel] [PATCH 2/2] uefi-sct/SctPkg: Correct= BBTestEraseBlocks behavior (EFI_BLOCK_IO_PROTOCOL) HI Samer, Sorry for the slow reply, In EMMC's case, it allowed storage firmware = erase to "1" to be a valid behavior (please reference the spec of emmc JESD= 84-B51/6.6.9), so once verification team use kind of this device, the test = case will always failed. To avoid this problem, I think this change is requ= ired. Thanks!! Arvin ________________________________ =1B$B4s7o> =1B$B4s7oF|4|=1B(B: 2020=1B$BG/=1B(B11=1B$B7n=1B(B12=1B$BF|=1B(B =1B$B>e8a= = =1B(B 04:56 =1B$BZ@7o >; Chen, ArvinX > =1B$BI{K\=1B(B: G Edhaya Chandran >; Jin, Eric = >; Samer El-Haj-Mahmoud >; gaoliming@byosoft.com.cn= > =1B$B -----Original Message----- > From: devel@edk2.groups.io > On Behalf Of Chen, > ArvinX via groups.io > Sent: Monday, November 2, 2020 5:00 AM > To: devel@edk2.groups.io > Cc: G Edhaya Chandran >; Eric Jin > > > Subject: [edk2-devel] [PATCH 2/2] uefi-sct/SctPkg: Correct > BBTestEraseBlocks behavior (EFI_BLOCK_IO_PROTOCOL) > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3022 > > > > The storage device erase behavior may have two possibilities: > > 1.Write all data into "0" > > 2.Write all data into "1" > > but now tool behavior can only check case 1 (Write all data into "0"), > > so we need add the other case into SCT tool to correct the test behavior= . > > > > Cc: G Edhaya Chandran > > > Cc: Eric Jin > > > Signed-off-by: ArvinX Chen > > > --- > > .../BlackBoxTest/EraseBlockBBTestFunction.c | 55 +++++++++++++++---- > > 1 file changed, 43 insertions(+), 12 deletions(-) > > > > diff --git a/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlock > BBTestFunction.c b/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlock > BBTestFunction.c > > index cbf43e1d..dbbb70c6 100644 > > --- a/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlock > BBTestFunction.c > > +++ b/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlock > BBTestFunction.c > > @@ -71,6 +71,7 @@ BBTestEraseBlocksFunctionTest ( > > UINT64 Index; > > UINTN Index1; > > UINTN Remainder; > > + UINT64 EraseCounter; > > > > EFI_ERASE_BLOCK_TOKEN Token; > > EFI_BLOCK_IO2_TOKEN BlockIo2Token; > > @@ -223,26 +224,41 @@ BBTestEraseBlocksFunctionTest ( > > // Read the data with 0, the first/last block should not be era= sed > > ReadStatus =3D BlockIo->ReadBlocks (BlockIo, MediaId, Lba, Buff= erSize, > (VOID*)Buffer2); > > if (ReadStatus =3D=3D EFI_SUCCESS) { > > - for (Index1 =3D 0; Index1 < BlockSize; Index1++) { > > - if (Buffer2[Index1] !=3D 0) { > > + for (Index1 =3D 0, EraseCounter =3D 0; Index1 < BlockSize; In= dex1++) { > > + if (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF)= { > > IsZero1 =3D FALSE; > > break; > > + } else if (Buffer2[Index1] =3D=3D 0x00) { > > + EraseCounter++; > > } > > } > > + if (EraseCounter!=3D0 && EraseCounter!=3DBlockSize) { > > + IsZero1 =3D FALSE; > > + } > > > > - for (Index1 =3D BlockSize; Index1 < BufferSize - BlockSize; I= ndex1++) { > > - if (Buffer2[Index1] !=3D 0) { > > + for (Index1 =3D BlockSize, EraseCounter =3D 0; Index1 < Buffe= rSize - > BlockSize; Index1++) { > > + if (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF)= { > > IsZero2 =3D FALSE; > > break; > > + } else if (Buffer2[Index1] =3D=3D 0x00) { > > + EraseCounter++; > > } > > } > > + if (EraseCounter!=3D0 && EraseCounter!=3D(BufferSize - (Block= Size*2))) { > > + IsZero2 =3D FALSE; > > + } > > > > - for (Index1 =3D BufferSize - BlockSize; Index1 < BufferSize; = Index1++) { > > - if (Buffer2[Index1] !=3D 0) { > > + for (Index1 =3D BufferSize - BlockSize, EraseCounter =3D 0; I= ndex1 < > BufferSize; Index1++) { > > + if (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF)= { > > IsZero3 =3D FALSE; > > break; > > + } else if (Buffer2[Index1] =3D=3D 0x00) { > > + EraseCounter++; > > } > > } > > + if (EraseCounter!=3D0 && EraseCounter!=3DBlockSize) { > > + IsZero3 =3D FALSE; > > + } > > > > if ((EraseStatus =3D=3D EFI_SUCCESS) && (IsZero1 =3D=3D FALSE= ) && (IsZero2 =3D=3D > TRUE) && ((IsZero3 =3D=3D FALSE))) > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > @@ -492,26 +508,41 @@ BlockIo2: > > // Read the data with 0, the first/last block should not be era= sed > > ReadStatus =3D BlockIo2->ReadBlocksEx (BlockIo2, MediaId, Lba, > &BlockIo2Token, BufferSize, (VOID*)Buffer2); > > if (ReadStatus =3D=3D EFI_SUCCESS) { > > - for (Index1 =3D 0; Index1 < BlockSize; Index1++) { > > - if (Buffer2[Index1] !=3D 0) { > > + for (Index1 =3D 0, EraseCounter =3D 0; Index1 < BlockSize; In= dex1++) { > > + if (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF)= { > > IsZero1 =3D FALSE; > > break; > > + } else if (Buffer2[Index1] =3D=3D 0x00) { > > + EraseCounter++; > > } > > } > > + if (EraseCounter!=3D0 && EraseCounter!=3DBlockSize) { > > + IsZero1 =3D FALSE; > > + } > > > > - for (Index1 =3D BlockSize; Index1 < BufferSize - BlockSize; I= ndex1++) { > > - if (Buffer2[Index1] !=3D 0) { > > + for (Index1 =3D BlockSize, EraseCounter =3D 0; Index1 < Buffe= rSize - > BlockSize; Index1++) { > > + if (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF)= { > > IsZero2 =3D FALSE; > > break; > > + } else if (Buffer2[Index1] =3D=3D 0x00) { > > + EraseCounter++; > > } > > } > > + if (EraseCounter!=3D0 && EraseCounter!=3D(BufferSize - (Block= Size*2))) { > > + IsZero2 =3D FALSE; > > + } > > > > - for (Index1 =3D BufferSize - BlockSize; Index1 < BufferSize; = Index1++) { > > - if (Buffer2[Index1] !=3D 0) { > > + for (Index1 =3D BufferSize - BlockSize, EraseCounter =3D 0; I= ndex1 < > BufferSize; Index1++) { > > + if (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF)= { > > IsZero3 =3D FALSE; > > break; > > + } else if (Buffer2[Index1] =3D=3D 0x00) { > > + EraseCounter++; > > } > > } > > + if (EraseCounter!=3D0 && EraseCounter!=3DBlockSize) { > > + IsZero3 =3D FALSE; > > + } > > > > if ((EraseStatus =3D=3D EFI_SUCCESS) && (IsZero1 =3D=3D FALSE= ) && (IsZero2 =3D=3D > TRUE) && ((IsZero3 =3D=3D FALSE))) > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > -- > > 2.26.2.windows.1 > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#66857): https://edk2.groups.io/g/devel/message/66857 > Mute This Topic: https://groups.io/mt/77977762/1945644 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [samer.el-haj- > mahmoud@arm.com] > -=3D-=3D-=3D-=3D-=3D-=3D > IMPORTANT NOTICE: The contents of this email and any attachments are confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y 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 confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y other person, use it for any purpose, or store or copy the information in= any medium. Thank you. --_000_DB7PR08MB3260833F7CE9E7EE963EBF1F90E20DB7PR08MB3260eurp_ Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable

Thanks for the explanat= ion.

 

Reviewed-By: Samer El-H= aj-Mahmoud <Samer.El-Haj= -Mahmoud@arm.com>

 

 

From: devel@edk2.groups.io <deve= l@edk2.groups.io> On Behalf Of Chen, ArvinX via groups.io
Sent: Tuesday, November 17, 2020 12:51 AM
To: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; deve= l@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Jin, Eric &l= t;eric.jin@intel.com>; gaoliming@byosoft.com.cn; Chu, Maggie <maggie.= chu@intel.com>
Subject:
=1B= $B2sJ$=1B(B: [edk2-devel] [PATCH 2/2] uefi-sct/SctPkg: Correct BBTe= stEraseBlocks behavior (EFI_BLOCK_IO_PROTOCOL)

 

HI Samer,<= /p>

 

    Sorry for the = slow reply, In EMMC's case, it allowed storage firmware erase to "1&qu= ot; to be a valid behavior (please reference the spec of emmc JESD84-B51/6.= 6.9), so once verification team use kind of this device, the test case will alw= ays failed. To avoid this problem, I think this change is required.

 

Thanks!!

Arvin

 


=1B$B4s7o: Samer El-Haj-Mahmoud <= Samer.El-Haj-Mahmoud@arm.com>
=1B$= B4s7oF|4|=1B(B: 2020=1B$BG/=1B(B= 11=1B$B7n=1B(B12=1B$BF|=1B(B =1B$B>e= 8a=1B(B 04:56
=1B$= BZ@7o: devel@edk2.groups.io <devel@edk2.groups.io>; Chen, Arvi= nX <arvinx.chen@intel.com&g= t;
=1B$= BI{K\=1B(B: G Edhaya Cha= ndran <Edhaya.Chandran@arm.com>; Jin, Eric <eric.jin@intel.c= om>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; gaoliming@byosoft.com.cn &= lt;gaoliming@byosoft.com.cn= >
=1B$= B: RE: [edk2-de= vel] [PATCH 2/2] uefi-sct/SctPkg: Correct BBTestEraseBlocks behavior (EFI_BLOC= K_IO_PROTOCOL)

 

Hi Chen,

The UEFI Specification 2.8ErrataB (page 575) states that " It is the = intention of the EraseBlocks() operation to be at least as performant as wr= iting zeroes to each of the specified LBA locations while ensuring the equi= valent security."

So while not explicitly saying that Erase should "erase to 0", i= t implies that at least is the intention. Do we know that erasing to "= 1" is a valid behavior?



> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> = On Behalf Of Chen,
> ArvinX via groups.io
> Sent: Monday, November 2, 2020 5:00 AM
> To: devel@edk2.groups.io<= br> > Cc: G Edhaya Chandran <= Edhaya.Chandran@arm.com>; Eric Jin
> <eric.jin@intel.com><= br> > Subject: [edk2-devel] [PATCH 2/2] uefi-sct/SctPkg: Correct
> BBTestEraseBlocks behavior (EFI_BLOCK_IO_PROTOCOL)
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3022
>
>
>
> The storage device erase behavior may have two possibilities:
>
>  1.Write all data into "0"
>
>  2.Write all data into "1"
>
> but now tool behavior can only check case 1 (Write all data into &quo= t;0"),
>
> so we need add the other case into SCT tool to correct the test behav= ior.
>
>
>
> Cc: G Edhaya Chandran <= Edhaya.Chandran@arm.com>
>
> Cc: Eric Jin <eric.jin@intel= .com>
>
> Signed-off-by: ArvinX Chen <arvinx.chen@intel.com>
>
> ---
>
>  .../BlackBoxTest/EraseBlockBBTestFunction.c   | 55 ++= +++++++++++++----
>
>  1 file changed, 43 insertions(+), 12 deletions(-)
>
>
>
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBl= ock
> BBTestFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBl= ock
> BBTestFunction.c
>
> index cbf43e1d..dbbb70c6 100644
>
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBl= ock
> BBTestFunction.c
>
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBl= ock
> BBTestFunction.c
>
> @@ -71,6 +71,7 @@ BBTestEraseBlocksFunctionTest (
>
>    UINT64       &nb= sp;            =             Index; >
>    UINTN       &nbs= p;            &= nbsp;            Ind= ex1;
>
>    UINTN       &nbs= p;            &= nbsp;            Rem= ainder;
>
> +  UINT64         &= nbsp;           &nbs= p;          EraseCounter;
>
>
>
>    EFI_ERASE_BLOCK_TOKEN     =             Token; >
>    EFI_BLOCK_IO2_TOKEN     &n= bsp;            = ; BlockIo2Token;
>
> @@ -223,26 +224,41 @@ BBTestEraseBlocksFunctionTest (
>
>          // Read the dat= a with 0, the first/last block should not be erased
>
>          ReadStatus =3D = BlockIo->ReadBlocks (BlockIo, MediaId, Lba, BufferSize,
> (VOID*)Buffer2);
>
>          if (ReadStatus = = =3D=3D EFI_SUCCESS) {
>
> -          for (Index1 = =3D 0; Index1 < BlockSize; Index1++) {
>
> -            i= f (Buffer2[Index1] !=3D 0) {
>
> +          for (Index1 = =3D 0, EraseCounter =3D 0; Index1 < BlockSize; Index1++) {
>
> +            i= f (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF) {
>
>           &nbs= p;    IsZero1 =3D FALSE;
>
>           &nbs= p;    break;
>
> +            }= else if (Buffer2[Index1] =3D=3D 0x00) {
>
> +           &n= bsp;  EraseCounter++;
>
>           &nbs= p;  }
>
>            } >
> +          if (EraseCoun= ter!=3D0 && EraseCounter!=3DBlockSize) {
>
> +            I= sZero1 =3D FALSE;
>
> +          }
>
>
>
> -          for (Index1 = =3D BlockSize; Index1 < BufferSize - BlockSize; Index1++) {
>
> -            i= f (Buffer2[Index1] !=3D 0) {
>
> +          for (Index1 = =3D BlockSize, EraseCounter =3D 0; Index1 < BufferSize -
> BlockSize; Index1++) {
>
> +            i= f (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF) {
>
>           &nbs= p;    IsZero2 =3D FALSE;
>
>           &nbs= p;    break;
>
> +            }= else if (Buffer2[Index1] =3D=3D 0x00) {
>
> +           &n= bsp;  EraseCounter++;
>
>           &nbs= p;  }
>
>            } >
> +          if (EraseCoun= ter!=3D0 && EraseCounter!=3D(BufferSize - (BlockSize*2))) {
>
> +            I= sZero2 =3D FALSE;
>
> +          }
>
>
>
> -          for (Index1 = =3D BufferSize - BlockSize; Index1 < BufferSize; Index1++) {
>
> -            i= f (Buffer2[Index1] !=3D 0) {
>
> +          for (Index1 = =3D BufferSize - BlockSize, EraseCounter =3D 0; Index1 <
> BufferSize; Index1++) {
>
> +            i= f (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF) {
>
>           &nbs= p;    IsZero3 =3D FALSE;
>
>           &nbs= p;    break;
>
> +            }= else if (Buffer2[Index1] =3D=3D 0x00) {
>
> +           &n= bsp;  EraseCounter++;
>
>           &nbs= p;  }
>
>            } >
> +          if (EraseCoun= ter!=3D0 && EraseCounter!=3DBlockSize) {
>
> +            I= sZero3 =3D FALSE;
>
> +          }
>
>
>
>            if = ((EraseStatus =3D=3D EFI_SUCCESS) && (IsZero1 =3D=3D FALSE) &&a= mp; (IsZero2 =3D=3D
> TRUE) && ((IsZero3 =3D=3D FALSE)))
>
>           &nbs= p;  AssertionType =3D EFI_TEST_ASSERTION_PASSED;
>
> @@ -492,26 +508,41 @@ BlockIo2:
>
>          // Read the dat= a with 0, the first/last block should not be erased
>
>          ReadStatus =3D = BlockIo2->ReadBlocksEx (BlockIo2, MediaId, Lba,
> &BlockIo2Token, BufferSize, (VOID*)Buffer2);
>
>          if (ReadStatus = = =3D=3D EFI_SUCCESS) {
>
> -          for (Index1 = =3D 0; Index1 < BlockSize; Index1++) {
>
> -            i= f (Buffer2[Index1] !=3D 0) {
>
> +          for (Index1 = =3D 0, EraseCounter =3D 0; Index1 < BlockSize; Index1++) {
>
> +            i= f (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF) {
>
>           &nbs= p;    IsZero1 =3D FALSE;
>
>           &nbs= p;    break;
>
> +            }= else if (Buffer2[Index1] =3D=3D 0x00) {
>
> +           &n= bsp;  EraseCounter++;
>
>           &nbs= p;  }
>
>            } >
> +          if (EraseCoun= ter!=3D0 && EraseCounter!=3DBlockSize) {
>
> +            I= sZero1 =3D FALSE;
>
> +          }
>
>
>
> -          for (Index1 = =3D BlockSize; Index1 < BufferSize - BlockSize; Index1++) {
>
> -            i= f (Buffer2[Index1] !=3D 0) {
>
> +          for (Index1 = =3D BlockSize, EraseCounter =3D 0; Index1 < BufferSize -
> BlockSize; Index1++) {
>
> +            i= f (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF) {
>
>           &nbs= p;    IsZero2 =3D FALSE;
>
>           &nbs= p;    break;
>
> +            }= else if (Buffer2[Index1] =3D=3D 0x00) {
>
> +           &n= bsp;  EraseCounter++;
>
>           &nbs= p;  }
>
>            } >
> +          if (EraseCoun= ter!=3D0 && EraseCounter!=3D(BufferSize - (BlockSize*2))) {
>
> +            I= sZero2 =3D FALSE;
>
> +          }
>
>
>
> -          for (Index1 = =3D BufferSize - BlockSize; Index1 < BufferSize; Index1++) {
>
> -            i= f (Buffer2[Index1] !=3D 0) {
>
> +          for (Index1 = =3D BufferSize - BlockSize, EraseCounter =3D 0; Index1 <
> BufferSize; Index1++) {
>
> +            i= f (Buffer2[Index1] !=3D 0x00 && Buffer2[Index1] !=3D 0xFF) {
>
>           &nbs= p;    IsZero3 =3D FALSE;
>
>           &nbs= p;    break;
>
> +            }= else if (Buffer2[Index1] =3D=3D 0x00) {
>
> +           &n= bsp;  EraseCounter++;
>
>           &nbs= p;  }
>
>            } >
> +          if (EraseCoun= ter!=3D0 && EraseCounter!=3DBlockSize) {
>
> +            I= sZero3 =3D FALSE;
>
> +          }
>
>
>
>            if = ((EraseStatus =3D=3D EFI_SUCCESS) && (IsZero1 =3D=3D FALSE) &&a= mp; (IsZero2 =3D=3D
> TRUE) && ((IsZero3 =3D=3D FALSE)))
>
>           &nbs= p;  AssertionType =3D EFI_TEST_ASSERTION_PASSED;
>
> --
>
> 2.26.2.windows.1
>
>
>
>
>
> -=3D-=3D-=3D-=3D-=3D-=3D
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#66857): https://edk2.groups.io/g/devel/message/66857
> Mute This Topic: ht= tps://groups.io/mt/77977762/1945644
> Group Owner: devel+owne= r@edk2.groups.io
> Unsubscribe: https:/= /edk2.groups.io/g/devel/unsub [samer.el-haj-
> mahmoud@arm.com]
> -=3D-=3D-=3D-=3D-=3D-=3D
>

IMPORTANT NOTICE: The contents of this email and any attachments are confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y 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 confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y other person, use it for any purpose, or store or copy the information in any medium. Thank you. --_000_DB7PR08MB3260833F7CE9E7EE963EBF1F90E20DB7PR08MB3260eurp_--