From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.1657.1585600462012902265 for ; Mon, 30 Mar 2020 13:34:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=gmgktaUN; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: christopher.j.zurcher@intel.com) IronPort-SDR: /nOPzuaaBhz+X4Ph4KxxWUj6V7Tyh9+mEmovtABu5WY6Vu5Mp0+XsHapV/1+PYZwosADVf92ll +YH4dDQZOgwA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 13:34:21 -0700 IronPort-SDR: OqnzWjisRqtn4pfHrQVqIqyE2fWz9qZv55NwVrucKLS4FfgkPeBUbKkClOFaOwEZUymptVtUYW 0LgbsyYwTBKg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,325,1580803200"; d="scan'208";a="422049459" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga005.jf.intel.com with ESMTP; 30 Mar 2020 13:34:21 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 13:34:21 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.107) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 13:34:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aCorUFfs4Ng5xXcz9nU4XPtu0r3c7kiLc83cs8Hdlo6Du5ihI5YsiChTUCyscX6kToXq2SL6Oa8JTBdjQaFjx1xDjqqQwV0c2BlH9U/CwRSbNUa10u+xsFG2QNZIhTyus/5sBxjgoOdk1titw8d5NZKw1iXD5UV5u3+xCREQlv3NfsxdJBXsyDHp5rzvvkCq85V3S+ftI85M5hV3Gx+rpoWu+AkE0yTtKSHDaVoFIHJDiNFZ0gRcMDh8xh+AIpcEntU+0P0JaAIOlFoPKahNno3Ai/xtrCj1EgUTDAtOby/a4uvPUGRbGMsLORMqvDMOBUM4/hbtEYb4b6LZk4arnw== 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=I45rWFYOf1Al3gD90BKlaTksW/cCQK0e6SgiR0/jL6c=; b=eqmdCAWr6xV1AIomL3XanaRB3FicfUsk9rDPxxdlESRdeSgFPlw+v2MmoAH85Kwiyvxh1v51rYvCAl3zEHdhElDNrbR6xRGlh4wzrOAihQZlb+Bzy8Y6KjUovaWtX2Y2+j9A/feRxRA0AyL4J4zS0tMi2DT90aIkasUwR7M8cn9L4ba8H+opd7Zt0JsEPlIesfIRcN+0wZ8aVtP+b6OnxYWG89lbZipx1CKq9/YhLalCSflWmmp0FhBLYvSAibl087mKInwGpcehliBF6I/glfguClrsgdDkormYjwobci/Q+LaiPFA6VpGRmfiNcvtrXctrp3fVaHFAcQXCzVyeew== 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=I45rWFYOf1Al3gD90BKlaTksW/cCQK0e6SgiR0/jL6c=; b=gmgktaUNQCATGKhEQ+tBAVQARRwfday37MAQQ+oZo0+oUyCzy0mZbSVlcrcnGqLHDfbgirN6tN1rbTHWklEZv+JQbo/xdfCqKrrSUqn5okdmxaKgzfl9VBM+2hQ6icPGIvV3i9Rii/fQwxBB0S5tCflr92JXghkJ5d8vlvvC+6Y= Received: from MWHPR1101MB2125.namprd11.prod.outlook.com (2603:10b6:301:4d::10) by MWHPR1101MB2205.namprd11.prod.outlook.com (2603:10b6:301:59::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Mon, 30 Mar 2020 20:34:18 +0000 Received: from MWHPR1101MB2125.namprd11.prod.outlook.com ([fe80::64c8:581:bf6f:77d0]) by MWHPR1101MB2125.namprd11.prod.outlook.com ([fe80::64c8:581:bf6f:77d0%10]) with mapi id 15.20.2856.019; Mon, 30 Mar 2020 20:34:17 +0000 From: "Zurcher, Christopher J" 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 synchronous SCSI Write operations Thread-Topic: [PATCH v2 1/1] MdePkg/UefiScsiLib: Set FUA bit for synchronous SCSI Write operations Thread-Index: AQHWA0D7sjdf8x9C4kmiMx9MX7JmRKhgZPcwgADJFQCAAFYUAA== Date: Mon, 30 Mar 2020 20:34:17 +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: <07f70d5a0ea8442eb776b37aed9f359b@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-reaction: no-action dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDJmMGQxY2QtNmQ5YS00NWZhLWE2M2EtMDQ0MDY2ZDNhNTUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiR1NhZlJBbUhCNldCdHQzK24ybGpjZmNKazIzRFl0VHk0WFNCTlwvOUlQV0c3K3g0MndaU2kxZ0lBVzFCcFZ6dVkifQ== authentication-results: spf=none (sender IP is ) smtp.mailfrom=christopher.j.zurcher@intel.com; x-originating-ip: [134.134.136.213] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 964fc602-8354-4d80-c64e-08d7d4e9b83f x-ms-traffictypediagnostic: MWHPR1101MB2205: 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: 0358535363 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2125.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(376002)(366004)(136003)(346002)(396003)(39860400002)(26005)(7696005)(71200400001)(19627235002)(186003)(86362001)(5660300002)(53546011)(6506007)(4326008)(66946007)(316002)(64756008)(8936002)(66556008)(2906002)(66476007)(81156014)(66446008)(8676002)(478600001)(52536014)(81166006)(107886003)(55016002)(9686003)(110136005)(54906003)(76116006)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i8GL0cnBRexQ+1WPSwewsO7hSFmgJtRLupUX6KXsDsm8G2QxY9grZtpL0HM0TQLfYq6sSQ4Pbj+dH+7j6tfXgwXyiqA7Xugy4vkpc9OL1ymjnaXWLBwqiZRBu4nzQPzp3fNd5NMN/kVAQKlA+I9Hv1luSi/mYTXZr+XB3NrPrWoOuB4lY5oEdINxx69T9muujiEG+1/5d3sJ66R2RbyXUYWNg253Mm/v7M7GLaSXehZ1AuWemeeVIXwEkyAVFYJUlRWmia+FGhI+GgKt77sJlBqWaiuGuyV9LNewFi4LJImsKfW798LSwkCvFsvjnKl0mfnyBlrQlaPIyLLg8z+MacnI/4KoaI0OmED4Qp9YuKsdlf+qrZPgNdzFcwD+qIKLJlIEfye1I7B77UtWRI+jtWCLtNXdNeDJsgLeBmY04NTKbfbb89jGJ/6oNOynHvUW x-ms-exchange-antispam-messagedata: Mr/lm0Ht7liBSQC1pD/HLxdKCW8w3IkaKbuEyo+x3Y+WtD/KY+DRJ4TuBVrYcIf7i+CA/se5B7BD/xoMgSow5H8aG5egEa90jZUYjDLN/V0K03XdFHaAItJ9x1moUCFVeVFrd7xeKorYF5U0jHUFpg== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 964fc602-8354-4d80-c64e-08d7d4e9b83f X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2020 20:34:17.8850 (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: qMSNBGUAztmS3AeYXOSEc5fZeXOYko1PvfWLiiziFzfvFsKLcHI1UjmEx+LjUBfG7wXxh0G/W1NZy4eo9Dm6INaZVqXutr2RmMckFdcELaE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2205 Return-Path: christopher.j.zurcher@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This change has been validated on an internal development platform; I will = share the details offline. Thanks, Christopher Zurcher > -----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 synchrono= us > SCSI Write operations >=20 > Zurcher: > What functionality test has been done for this test? >=20 > 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 synchro= nous > 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 synchrono= us > > > 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 i= f a > > > shutdown or reset is requested immediately after a SCSI write operati= on. > > > > > > 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 reserved.=
> > > + Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.=
> > > 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 reserved.=
> > > + Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.=
> > > 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