From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.14140.1586879593969302429 for ; Tue, 14 Apr 2020 08:53:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=XjS3kgB7; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: liming.gao@intel.com) IronPort-SDR: E4KM39fEXvN2ccFGk70xS/VtiONdtcAEOVwHAMvcad03Sb5jB0/Sb4wZWKnKhS71wQ7/xU6770 xzT+p+7whSRw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 08:53:12 -0700 IronPort-SDR: YQhaA+crcgz1F3Gr2iLghJkVaSj0wapshMMFeRWjND+GEgRk1MeIh7gS6MffynfxRmrfaUatnq hjNb/pQ2DAfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,382,1580803200"; d="scan'208";a="243847622" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga007.fm.intel.com with ESMTP; 14 Apr 2020 08:53:12 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 Apr 2020 08:53:12 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.176) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 Apr 2020 08:53:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bh9fcQKwBiqa92EO+zcQt0HgnSH6sFVRZsXK1+/K217av9+EKoxTfdbZoQz4mR2K+19jBhKpjj5/IPVemDHTCUmZsr5DzeiJrwWQb7poy5vuRHAZ2heQhpZmBn0oemK92a0QDrLoa22n0L8NYdhkKrvKvtQDCyM3UFhIf37wikfDFDcxb6WPh68dRqBKHY2rIYfCAwwC1b9J1zxQMM20Hx0nbcOcCBsX8nA7+F71QyvudVMC3WZXgWbYJsdYowb/u0GLmDzB9qQ9g8dnw/eQENXrjS8fL7cRQ6rBSW4mdty4bu9uI4tlS8IhAgYf4TR71Fpw8HZnt4wJfH9Jl6gE0w== 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=sXGDWcxfqSK+IlwSsEto1h8tHych3EipImSbMULkp48=; b=AMjRt8DD8hFmPP+BP9fhwNsUiEtp68fPHhQ4lliB2MXb9rg5Ybt8LBMPjHjcwVWLe73RN/oQ35sNucfRfENgy2K8GqvbpnWGjo7FAXfK7A1cb7xU+5zQZ6bq0LqyW0qhIq8mPyl6Ajqmg2LSTLAsLInRO1/hie5vvGwej7MLFTCpyYR+gvPLwOLxByloCWrYReB6S7e54t1tvpCps85zXoZTSo+g7hi9GyQqm9HcVpNJSnl0dY0Fd7TZjf+12056dv3I2X3G0dzotcdsuxf5Y1XJsljGBWi6yQn5aizDLj/VkwLLExJHlk8wpw0cbJ2sCbdHc363Jn9nWSzPXPLkTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sXGDWcxfqSK+IlwSsEto1h8tHych3EipImSbMULkp48=; b=XjS3kgB7GSBy3HCSgbBYJIKIhNvp4f9f1yvc6/fILmVhbqymDrogGVdT+aS3TNRSbA5LJny3626daHzndLSVJmNBxMjW7ptV/VYyEUSownNYxLnn3x3uVuIHPGeiHYE5fkijT9oGbHZmBecDfOU//HiaeSqxm7l/HuTnbV8+VTM= Received: from BN6PR11MB3972.namprd11.prod.outlook.com (2603:10b6:405:7f::11) by BN6PR11MB1731.namprd11.prod.outlook.com (2603:10b6:404:ff::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.28; Tue, 14 Apr 2020 15:53:10 +0000 Received: from BN6PR11MB3972.namprd11.prod.outlook.com ([fe80::4dcc:bc5c:def:9ae9]) by BN6PR11MB3972.namprd11.prod.outlook.com ([fe80::4dcc:bc5c:def:9ae9%5]) with mapi id 15.20.2900.028; Tue, 14 Apr 2020 15:53:10 +0000 From: "Liming Gao" To: "Zurcher, Christopher J" , "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Wang, Jian J" Subject: Re: [PATCH v2 1/1] MdePkg/UefiScsiLib: Set FUA bit for synchronous SCSI Write operations Thread-Topic: [PATCH v2 1/1] MdePkg/UefiScsiLib: Set FUA bit for synchronous SCSI Write operations Thread-Index: AQHWA0D7bYEiAZ6q406VVQDwvW8TW6hf3xEAgAFO3oD//+qdgIAXyoLA Date: Tue, 14 Apr 2020 15:53:09 +0000 Message-ID: References: <20200326073424.69960-1-christopher.j.zurcher@intel.com> <20200326073424.69960-2-christopher.j.zurcher@intel.com> <07f70d5a0ea8442eb776b37aed9f359b@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=liming.gao@intel.com; x-originating-ip: [192.55.52.207] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aaa99af5-3e06-439e-7251-08d7e08bee68 x-ms-traffictypediagnostic: BN6PR11MB1731: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 0373D94D15 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB3972.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(346002)(39860400002)(396003)(136003)(366004)(376002)(64756008)(66446008)(81156014)(66556008)(26005)(19627235002)(8936002)(8676002)(186003)(66946007)(76116006)(66476007)(478600001)(86362001)(6506007)(5660300002)(9686003)(2906002)(107886003)(53546011)(71200400001)(55016002)(52536014)(110136005)(33656002)(7696005)(316002)(54906003)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MFUo2nHvQrq+6YKN5jsmfw8de6qb3q3xyby/s17N+T76TJUCSCdCdnJBdwwRDJaiBsPo9cg/HSjzSX48em98QkvMIOUCU9UlWU2hg5Oz5z/JyKquZo+DOlTVM5OO0Wu2jE39uF16ebvf0ChP2B11sRUtRlMbe5ecoEJnchaIqd4PobHbIJ+HSltQM+lQn2L2rw0DEzYi8iUVRyPxrsVpwMyozb434DDKLe1GOeV7fYn1Sobp6zcqJBQ64fazrsg93mmPtL5HQO5N4FsEq27o6N3Iz8lnGnVcYCYDUrYp8OTZcoQv39694XEhUIXb3SJ7FHqHAxTKxETzskyaTwa+GAJDdJbUjNIkcClgMV3yYMfnD6aibkLpI3Z6AA0Th0LurpsUh9Q/LVbmMTQayLJmgA96F99jtn0G0RxBtFZVwq8FpaGWqaUY8uGyXw7eVFrc x-ms-exchange-antispam-messagedata: yPqr+/+kkucmpO61QodiY6/pwXiwluTQRrpYuqhr+gl7g4qaQuGBsgm0Ri9bWC5qldvDXaV+ub10gLUWo+XWdhy+xF70+IK3LE6kFXOxhJlBrA9+bKBZ7xcAEC0BNx3HOmGKskB0pTsQ6C3SUAjkoA== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: aaa99af5-3e06-439e-7251-08d7e08bee68 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2020 15:53:09.9054 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ftVJ9QodyobEx01I9lk33vm+5/PvpHukfS1oaBBi8MBtdV4O19tLId6VLEYcpbGvo09FNVy+VSCEsEPssyqJUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1731 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Zurcher, Christopher J > Sent: Tuesday, March 31, 2020 4:34 AM > To: Gao, Liming ; Liu, Zhiguang ; devel@edk2.groups.io > Cc: Kinney, Michael D ; Wang, Jian J > Subject: RE: [PATCH v2 1/1] MdePkg/UefiScsiLib: Set FUA bit for synchrono= us SCSI Write operations >=20 > This change has been validated on an internal development platform; I wil= l share the details offline. >=20 > Thanks, > Christopher Zurcher >=20 > > -----Original Message----- > > From: Gao, Liming > > Sent: Monday, March 30, 2020 06:51 > > To: Liu, Zhiguang ; Zurcher, Christopher J > > ; devel@edk2.groups.io > > Cc: Kinney, Michael D ; Wang, Jian J > > > > Subject: RE: [PATCH v2 1/1] MdePkg/UefiScsiLib: Set FUA bit for synchro= nous > > SCSI Write operations > > > > Zurcher: > > What functionality test has been done for this test? > > > > Thanks > > Liming > > > -----Original Message----- > > > From: Liu, Zhiguang > > > Sent: Monday, March 30, 2020 9:52 AM > > > To: Zurcher, Christopher J ; > > devel@edk2.groups.io > > > Cc: Kinney, Michael D ; Wang, Jian J > > ; Gao, Liming > > > Subject: RE: [PATCH v2 1/1] MdePkg/UefiScsiLib: Set FUA bit for synch= ronous > > SCSI Write operations > > > > > > Reviewed-by: Zhiguang Liu > > > > > > > -----Original Message----- > > > > From: Zurcher, Christopher J > > > > Sent: Thursday, March 26, 2020 3:34 PM > > > > To: devel@edk2.groups.io > > > > Cc: Kinney, Michael D ; Wang, Jian J > > > > ; Gao, Liming ; Liu, > > Zhiguang > > > > > > > > Subject: [PATCH v2 1/1] MdePkg/UefiScsiLib: Set FUA bit for synchro= nous > > > > SCSI Write operations > > > > > > > > The FUA (Force Unit Access) bit forces data to be written directly = to > > > > disk instead of the write cache. This prevents data from being lost= if a > > > > shutdown or reset is requested immediately after a SCSI write opera= tion. > > > > > > > > Cc: Michael D Kinney > > > > Cc: Jian J Wang > > > > Cc: Liming Gao > > > > Cc: Zhiguang Liu > > > > Signed-off-by: Christopher J Zurcher > > > > --- > > > > MdePkg/Include/IndustryStandard/Scsi.h | 8 +++++++- > > > > MdePkg/Library/UefiScsiLib/UefiScsiLib.c | 14 ++++++++------ > > > > 2 files changed, 15 insertions(+), 7 deletions(-) > > > > > > > > diff --git a/MdePkg/Include/IndustryStandard/Scsi.h > > > > b/MdePkg/Include/IndustryStandard/Scsi.h > > > > index 3e966520a1..64b9918b82 100644 > > > > --- a/MdePkg/Include/IndustryStandard/Scsi.h > > > > +++ b/MdePkg/Include/IndustryStandard/Scsi.h > > > > @@ -1,7 +1,7 @@ > > > > /** @file > > > > Support for SCSI-2 standard > > > > > > > > - Copyright (c) 2006 - 2019, Intel Corporation. All rights reserve= d.
> > > > + Copyright (c) 2006 - 2020, Intel Corporation. All rights reserve= d.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -175,6 +175,12 @@ > > > > #define EFI_SCSI_DATA_IN 0 > > > > #define EFI_SCSI_DATA_OUT 1 > > > > > > > > +// > > > > +// SCSI Block Command Cache Control Parameters > > > > +// > > > > +#define EFI_SCSI_BLOCK_FUA BIT3 ///< Force Unit Access > > > > +#define EFI_SCSI_BLOCK_DPO BIT4 ///< Disable Page Out > > > > + > > > > // > > > > // Peripheral Device Type Definitions > > > > // > > > > diff --git a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c > > > > b/MdePkg/Library/UefiScsiLib/UefiScsiLib.c > > > > index 13a2a1912c..512bec500c 100644 > > > > --- a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c > > > > +++ b/MdePkg/Library/UefiScsiLib/UefiScsiLib.c > > > > @@ -1,7 +1,7 @@ > > > > /** @file > > > > UEFI SCSI Library implementation > > > > > > > > - Copyright (c) 2006 - 2019, Intel Corporation. All rights reserve= d.
> > > > + Copyright (c) 2006 - 2020, Intel Corporation. All rights reserve= d.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -1055,15 +1055,16 @@ ScsiWrite10Command ( > > > > ZeroMem (&CommandPacket, sizeof > > > > (EFI_SCSI_IO_SCSI_REQUEST_PACKET)); > > > > ZeroMem (Cdb, EFI_SCSI_OP_LENGTH_TEN); > > > > > > > > - CommandPacket.Timeout =3D Timeout; > > > > - CommandPacket.OutDataBuffer =3D DataBuffer; > > > > - CommandPacket.SenseData =3D SenseData; > > > > - CommandPacket.OutTransferLength=3D *DataLength; > > > > - CommandPacket.Cdb =3D Cdb; > > > > + CommandPacket.Timeout =3D Timeout; > > > > + CommandPacket.OutDataBuffer =3D DataBuffer; > > > > + CommandPacket.SenseData =3D SenseData; > > > > + CommandPacket.OutTransferLength =3D *DataLength; > > > > + CommandPacket.Cdb =3D Cdb; > > > > // > > > > // Fill Cdb for Write (10) Command > > > > // > > > > Cdb[0] =3D EFI_SCSI_OP_WRITE10; > > > > + Cdb[1] =3D EFI_SCSI_BLOCK_FUA; > > > > WriteUnaligned32 ((UINT32 *)&Cdb[2], SwapBytes32 (StartLba)); > > > > WriteUnaligned16 ((UINT16 *)&Cdb[7], SwapBytes16 ((UINT16) > > > > SectorSize)); > > > > > > > > @@ -1263,6 +1264,7 @@ ScsiWrite16Command ( > > > > // Fill Cdb for Write (16) Command > > > > // > > > > Cdb[0] =3D EFI_SCSI_OP_WRITE16; > > > > + Cdb[1] =3D EFI_SCSI_BLOCK_FUA; > > > > WriteUnaligned64 ((UINT64 *)&Cdb[2], SwapBytes64 (StartLba)); > > > > WriteUnaligned32 ((UINT32 *)&Cdb[10], SwapBytes32 (SectorSize)); > > > > > > > > -- > > > > 2.16.2.windows.1 > > >=20