From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.50]) by mx.groups.io with SMTP id smtpd.web11.48555.1606197056948432421 for ; Mon, 23 Nov 2020 21:50:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=e2ydnscQ; spf=pass (domain: arm.com, ip: 40.107.13.50, mailfrom: edhaya.chandran@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=WO7mNGpWl82G3/Wi15HyTCZNfJGcMrHIJhH06GJVE58=; b=e2ydnscQMlWCItranlFkSXp9wMU512tsmIAFquYC28Oo32YHb6MDkX2MKJCJmOGtJ0LyyWIc5oC9/a+guMSojLftwttuUfQmy2e6JBJMgdQjDBE9/naYK/VVNF+Va8Bk0t+U/BomVNzeigJkZt822v2XC0NZWwDSITgE5VLpaIA= Received: from DB6P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:4:b8::14) by HE1PR0802MB2572.eurprd08.prod.outlook.com (2603:10a6:3:db::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20; Tue, 24 Nov 2020 05:50:05 +0000 Received: from DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b8:cafe::bd) by DB6P192CA0004.outlook.office365.com (2603:10a6:4:b8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Tue, 24 Nov 2020 05:50:04 +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 DB5EUR03FT061.mail.protection.outlook.com (10.152.21.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Tue, 24 Nov 2020 05:50:04 +0000 Received: ("Tessian outbound 13ed5f5344c0:v71"); Tue, 24 Nov 2020 05:50:04 +0000 X-CR-MTA-TID: 64aa7808 Received: from 33bed86ac023.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DEFE5A0E-C63F-4039-B9BC-9EFD09D39CD8.1; Tue, 24 Nov 2020 05:49:59 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 33bed86ac023.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 24 Nov 2020 05:49:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OdhbXbqYQHavmLEO84G3C3NN/V9oLf7AgFEb76XhhbWpVnOQ7/5GkhC0UlN/mOato/E4o+5l5nePWGrn1lfN3MeHiLYWwSEF+cI/czidsO5I5PJ+zoSQh3JY7UWruVtiQ+OYuZ3+UodHD6NOILVAo0sRh7rYOyUnbtfKrvQT4skgJnd+VrNGYooA3b9viGMTKcCJv5vjvKKh9qQNB8Y0Sgmy4St4txCG3shAWoGTUWPcLvzH9XYF8msAGsJpD5hUUHmf9lheQr1W1kjspQGr3ZV1kBHMZshMlk6ZmXwXansph8Fkmhfk3NYch3JxK6Zw/zN6zZ7B2DzAdn1iDndv4Q== 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=WO7mNGpWl82G3/Wi15HyTCZNfJGcMrHIJhH06GJVE58=; b=gFIgCGLOPjLo8boQ+nPdCzgziKs+nUiY4T2Rxot3SxJ9K9Yv9528GABmDQmpT3YTpOraDNVJ2nqxPOVxoLVAdE+86oTfehmru2Ui7pcafsvSro8ceRUd+6SrlzWi8XmtWH9qw7DfHITopur6QZB97+BAFNpbFZSl2QtnYJkhy3EayyLYMiaetzpEl5khSk8L4UDcDvmGr4BXWVhkkn0snSQloqUDn+5Dv3P4VfspTfKSRUfhBO/LQmnT5NI/dDeT3Nb+gKp4G2KX8cP9IHtQK6QLc4Pig7kPxkqGf9bTzxMceY6lrqaHRKMn5lJpJztppR+opaR29yCtOrLxE4VW+g== 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=WO7mNGpWl82G3/Wi15HyTCZNfJGcMrHIJhH06GJVE58=; b=e2ydnscQMlWCItranlFkSXp9wMU512tsmIAFquYC28Oo32YHb6MDkX2MKJCJmOGtJ0LyyWIc5oC9/a+guMSojLftwttuUfQmy2e6JBJMgdQjDBE9/naYK/VVNF+Va8Bk0t+U/BomVNzeigJkZt822v2XC0NZWwDSITgE5VLpaIA= Received: from HE1PR0801MB1691.eurprd08.prod.outlook.com (2603:10a6:3:7b::13) by HE1PR08MB2633.eurprd08.prod.outlook.com (2603:10a6:7:37::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.34; Tue, 24 Nov 2020 05:49:57 +0000 Received: from HE1PR0801MB1691.eurprd08.prod.outlook.com ([fe80::dfe:c28c:4e1e:c163]) by HE1PR0801MB1691.eurprd08.prod.outlook.com ([fe80::dfe:c28c:4e1e:c163%12]) with mapi id 15.20.3589.030; Tue, 24 Nov 2020 05:49:57 +0000 From: "G Edhaya Chandran" To: "Chen, ArvinX" , "devel@edk2.groups.io" , Samer El-Haj-Mahmoud CC: "Jin, Eric" , "gaoliming@byosoft.com.cn" , "Chu, Maggie" 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: AQHWsP75m4TDsBtzekSasrwwA/ANs6nDeD6AgAhxBwCAAIbFAIAKeHEAgAAAnJA= Date: Tue, 24 Nov 2020 05:49:57 +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: x-ts-tracking-id: F233BE04CE0AB946BD45FC4589AFA69F.0 x-checkrecipientchecked: true Authentication-Results-Original: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [103.130.108.179] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5180a761-dcf0-4334-2c31-08d8903ccaa1 x-ms-traffictypediagnostic: HE1PR08MB2633:|HE1PR0802MB2572: 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: Wd3dfgCHIe1Porz1gql7JuV1yRYidsKq1lfRBK19/f+bPH7McaFpJOocVC57SUP+Yw/Z6kOKM+StD2klegvpTF2PiJ4WD1xNELBxOG5CNEnc4Me/cXEakK2TweH2CwUfkOtHcW9z531zdyn2mHlawXYPPOor46ZTjBOejC8PVzucZVsd6tXo6R2S6Hb4AAriSMf2WYDaw8nMp7g4/xCRWqmQYMR/2L9wNxFYdTekhdrVUSC6WP6W/J+SKiFMH730w7KZxJ7fKLPZ6BEUmWO1I56CXb6QI8/X0yoc210p9VbFL6I7W20bBdPgimvLa4UMgqE8dAm0QwOAa18He3OXXrhEOFICygvIpMtUHFrSjtOqk8LqJy3c6B6HHiBYZDn/k4JZjF5XH4sVPrJF6OqZtQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0801MB1691.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(346002)(136003)(366004)(396003)(39860400002)(7696005)(9326002)(53546011)(966005)(5660300002)(83380400001)(6506007)(76236003)(54906003)(8936002)(8676002)(110136005)(52536014)(316002)(6636002)(86362001)(55016002)(2906002)(66556008)(76116006)(26005)(66446008)(64756008)(66946007)(186003)(66476007)(166002)(33656002)(478600001)(9686003)(4326008)(71200400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: QAPLnoL8PYSEZs+jEfmsDmmhwlEcB8KIje1g8CjrytvPuSlyFTkyDiZX6b3IpaQj4jxZq+xs25BtBgaW4o9kzehGp2PPoSNYyoeiAxXrFy9FHxxebaslO2oRue9AYVhAYMp9OyYzIIGR+GqsrdYf6fBFGDRo5fFNhPsHlSMzsN8D8LIRssUGdGv+G6MLS5OFuHBf3I5JnPZBfzVkEgy0SqBcDaMhR+HJFte0nguYi30S2O+xRLZYG1Eh6BQ1cK5XQinFnVNxhsOLJmLc34cJY8RoDOxn8RXdDvQJBCqs88CfsQxJFLAt0H3qzGufsaXvCjYkDPJLIQGesoDnzZ4WwN+I6cxVWbitVsYHl1cN5XAWfygpZcL3DgZNXxdL0thv/HmJhSMULK25ft2565agAWNZPa00rrj+PYkRT7aok7uN6wQeQoausa4yOs3OXXQ9n675X5qt/LmzlIcuVK7LkUSWas96uvMDP3mnk3CT75E0VgzeyDJ3fS74BOufwjm4GQan6Y/kZlrAGbM1Fv6x4My3CTiKuUQtXQOXS+VqH5n2xl6gI5prF9jyMTLwGKdXpdrYm5lE2CHftY7bM9Ih4+EyhrgzBbcBcDlrpB5ptWKorrqB0x45h609KOYX+ETrVfetxeGpJ62aBh0w3ze0297okspabZE7YkFp1d8rFnUAw4lEAaSssOYUzPQC77S9Nt9TYHIhOnnl96zKEIjkQieRForiS7+GRRwM2c8wBWHccNfzMjtqYJGI+MPk5RVKO2MQ12KBUX+m8qNpJPHYm95g4cHdPTLc0Iz/vcEBlwPqn4wfvsqnFLuA/srKHLNckvQHDVdzjZ+o2ZgxgVnHJiRtEgLmxRwaywlYhIVLVTHbYQ7NXRTynSo/LI4nVJTZH5vk+DvfqyvuIZl2lz+hVw== MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2633 Original-Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; Return-Path: Edhaya.Chandran@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d6ccf634-7462-454c-eaa9-08d8903cc675 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Egpl+MKisQ/GIh/K/Vl23aWDDkNuaceRmy07s+SGyaPDffUAKmrof7jpEj2rHYzuZRKHCymnfxTULZpb1BBf4JVBOAsDTIDVjCuu/JdLkJvEYFBo5Qlv481Y+P4wMWnEDid3byITDzZnbDnPuSoYmdhF+N7e/oAAeSSLtF7p3BrwSOI97Mc0e630LURC3mTAgd+65gXlcS58GM19j1Sc/I3urFEJgn+nZiVJfcBPKCCkEwfHuensVJJfbvRLuEWwCd71FAECCTtSkGo+RcOl1YopFSerkRxTHWBBztLIYs4qWoeakc8YQcBqqq3yRRbaAaVQBmUCFIbyzEHhxW7ewShr6zJs5iGp8ff+pPsHY7FQdgFo8BUXm+3QFVi8apOhz/8jH7nWY2tdidHVneI0REpKK9BwrIkDQT0bQwiuLD3S0gj0swADnnVj+I15mwsxueCCheR2E5jwJqVcRR9gu/jg0lLX3BFb9c8+I8YfxI= 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)(39860400002)(346002)(376002)(136003)(396003)(46966005)(6506007)(6636002)(33656002)(8936002)(2906002)(53546011)(478600001)(966005)(26005)(30864003)(166002)(81166007)(47076004)(356005)(82310400003)(82740400003)(76236003)(86362001)(83380400001)(54906003)(186003)(316002)(55016002)(52536014)(110136005)(336012)(9326002)(70206006)(4326008)(70586007)(5660300002)(9686003)(8676002)(107886003)(7696005)(579004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2020 05:50:04.4852 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5180a761-dcf0-4334-2c31-08d8903ccaa1 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: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2572 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_HE1PR0801MB169111F3E8CA4E788D7EF7AFE8FB0HE1PR0801MB1691_" --_000_HE1PR0801MB169111F3E8CA4E788D7EF7AFE8FB0HE1PR0801MB1691_ Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Hi Arvin, This patch is scheduled to be submitted in master today. With Warm Regards, Edhay From: Chen, ArvinX Sent: 24 November 2020 11:17 To: devel@edk2.groups.io; Samer El-Haj-Mahmoud 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 all, If this patch is OK to you guys~ maybe we can submit it into master ^^ Thanks! Arvin ________________________________ =1B$B4s7o > =1B$BBeI=3D=1B(B Samer El-Haj= -Mahmoud = > =1B$B4s7oF|4|=1B(B: 2020=1B$BG/=1B(B11=1B$B7n=1B(B17=1B$BF|=1B(B =1B$B2<8a= = =1B(B 09:53 =1B$BZ@7o >; Chen, ArvinX > =1B$BI{K\=1B(B: G Edhaya Chandran >; Jin, Eric = >; gaoliming@byosoft.com.cn >; Chu, Maggie >; Samer El-Haj-Mahmoud > =1B$B> From: devel@edk2.groups.io > On Behalf Of Chen, ArvinX 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. 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_HE1PR0801MB169111F3E8CA4E788D7EF7AFE8FB0HE1PR0801MB1691_ Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable

Hi Arvin,

 

    This patch is scheduled to be s= ubmitted in master today.

 

With Warm Regards,
Edhay

 

 

From: Chen, ArvinX <arvinx.chen@= intel.com>
Sent: 24 November 2020 11:17
To: devel@edk2.groups.io; Samer El-Haj-Mahmoud <Samer.El-Haj-Mah= moud@arm.com>
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 all,

 

   If this patch i= s OK to you guys~ maybe we can submit it into master ^^

 

Thanks!

Arvin


=1B$B4s7o: devel@edk2.groups.io <devel@edk2.groups.io> =1B$BBe= I=3D=1B(B Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
=1B$= B4s7oF|4|=1B(B: 2020=1B$BG/=1B(B= 11=1B$B7n=1B(B17=1B$BF|=1B(B =1B$B2<= 8a=1B(B 09:53
=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>; gaoliming@byosoft.com.cn &= lt;gaoliming@byosoft.com.cn= >; Chu, Maggie <maggie.chu@in= tel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
=1B$= B: Re: [edk2-de= vel] [PATCH 2/2] uefi-sct/SctPkg: Correct BBTestEraseBlocks behavior (EFI_BLOC= K_IO_PROTOCOL)

 

Thanks for the explanation.

 

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

 

 

From: devel@edk2.groups.io <devel@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>; devel@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Jin, Eric <eric.jin@intel.com>; gaoliming@byosoft.com.cn; = Chu, Maggie <maggie.chu@intel.co= m>
Subject:
=1B$B2sJ$=1B(B: [edk2-devel] [PATCH 2/2] ue= fi-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&q= uot; 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.<= o:p>

 

Thanks!!<= /p>

Arvin

 


=1B$B4s7o: Samer El-Haj-Mahmoud <= Samer.El-Haj-Mahmoud@arm.com>
=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:<= /b> devel@edk2.groups.io <devel@edk2.groups.io>; Chen, Arvi= nX <arvinx.chen@intel.com&g= t;
=1B$BI{K\=1B(B: G Edhaya Chandran <Edhaya.C= handran@arm.com>; Jin, Eric <eric.jin@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; gaoliming@byosoft.com.cn &= lt;gaoliming@byosoft.com.cn= >
=1B$B: RE: [edk2-devel] [PATCH 2/2] uefi-sct/SctPkg: Correct BBTestEraseBlocks b= ehavior (EFI_BLOCK_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 an= y attachments are confidential and may also be privileged. If you are not t= he intended recipient, please notify the sender immediately and do not disc= lose the contents to any other person, use it for any purpose, or store or copy the information in any medium. T= hank 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_HE1PR0801MB169111F3E8CA4E788D7EF7AFE8FB0HE1PR0801MB1691_--