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.web10.46932.1675660668854819888 for ; Sun, 05 Feb 2023 21:17:49 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=OlkZgy5y; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675660668; x=1707196668; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=O1Y/OA7sPHOrMbGNUkV6b/QIcCl+h/F1HTQAJRR0Zp8=; b=OlkZgy5ywx/daaiGJp1ZUH1Ou5FUEbMGFKfmoCk5md/Dyx4u1vWqHqTg DteKkNDd0yeAO/9SCpzHo5zhzKDaYYz9Z1agUoaWD7fu5W1A/3Mp1DouZ zowU0TPgq+qZ0e/Vm/d/ubDyxIi+0nPMs35xj01YnlHeTosvvDgQdMItj XD/MVK23I8T+DzHOG5k6CODCcZXYS3y78qHqPUAKKItGgCxAqN8/d2maq seF4xbkWO2xFlNhcvVUw2mYPzMSptu7uQ0sU0sz32bJqjy2Xltkuoi9RO mQy6NBcgjQf5Zrxfub+mAWfaHIZBn4UDzEaCEbrKU/RyI88qwPYpMwAFd Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="308774359" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="308774359" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2023 21:17:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="666376986" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="666376986" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP; 05 Feb 2023 21:17:47 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 5 Feb 2023 21:17:47 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sun, 5 Feb 2023 21:17:47 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sun, 5 Feb 2023 21:17:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJsfHDP1NC1A8C8P+altQB2Z+GiN6g2yJSIWIWxiic+xGnIh7UDxInPkn1VxLW+AadUkruFOFomMKiKzsnInvEcxfy7liuFUmvRL+wk0wSSlKTJXIa3sMvqBqHd1XM5ya1fPnB76MJlbGZhQiBX9b2gNE5RziN95WKd7GtFDi6fWxgnB5Y+dUsKaFqHWR2DNR0/A8SrapT0yAaV5fMFOwwHNNReKucYwUIjHhUbPHOhtpVw5L3wypoVRCHmwnW9a55uZAg7jC0V2GsShdJbpaTKz2IrVJuMUl4k1onduTRyTUqdGF82qOcAmbrleP5krXh5gEQforcO6O7PPhrZn/A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+Yq7Xj/VjmqWSqzf51nQ8BUsWnTYGhsnWsuXLoWr37I=; b=cyZ0kAawMvU5MkcKnnU82Q80/ucBX6XnwbNQlh9kCbBSGQdIFCLEdQq/2oBIgl5GeTkk4D0qTL8YQCPOvziXqaA/MUqcDEeVGnXKUWi+VlsdURhSJXjQNQeFkSxXObRMHm9SF/wRd+wEe0mmBj+MBpkb/nCFy/6rt0uvdgHLor1k5M/Uhdw4BtYYtI+sXDRqsP6CT+/12KzyuMvJsXYYe4NOf7QLZ/RmvYQTR0sy67b5FcXMX1zoqZ3z7U8bsuRExzsqgBgVAE7zD4gu8KsjSBpeO30wYU1TRS1sYU3q7Q+BZkJeEc/ePufnXIAAZ5oHsepPCyVKHTGzRME6yUznAQ== 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 Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by IA1PR11MB6291.namprd11.prod.outlook.com (2603:10b6:208:3e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 05:17:43 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::40d5:cf74:7d27:e4e6]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::40d5:cf74:7d27:e4e6%5]) with mapi id 15.20.6064.034; Mon, 6 Feb 2023 05:17:43 +0000 From: "Wu, Hao A" To: "Zhu, Weipu" , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Gao, Liming" , "Liu, Zhiguang" Subject: Re: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe Thread-Topic: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB definition for NVMe Thread-Index: AQHZNtFvpIjVE5pPlUOPoY5q9gNCnK7BZuwA Date: Mon, 6 Feb 2023 05:17:43 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|IA1PR11MB6291:EE_ x-ms-office365-filtering-correlation-id: 7c4fa0b2-e6cb-49ec-a460-08db080179a6 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MDlqbT4GNhArV45MoflInW35rsdMsVjWPQsOsmVJ/u06C3lSXr8a2fke6A1ORwAYfhvpGJ5wWt/cLvzPl1Fphh0yqTkMxKKgHEFYo6SfZFJ63SzojNUDVdbEVPUb3r/U7hxA7o6Hx/bZSCvP7przlCXb+krZK3xRgeR4PDd9MoZKS0MxtivtPUBVCPXekM0ZeIfnCzgNbuewnz2VexqoyyilfL2Jkh3A0BM4hTSe79cKbnbs7h4F2Tb3fphdGeoC6jkJI81QiR/Z9BtfaXbykASkBJwmkRpoBtUKdMyPLWnCy2e9Ru0uxYY1YLNL+0jaFIoi4PDqtw94YbY8q3rmpkg4DWo9uDKo0lQZ2jLM39s3CsFeuaqaTH5LGn4JU9t3X/XGE6mw0lNo7yAklk5G0Fc3vAwFVqKv73miVd9CO2E+sfMm6OHuNEBCzSxJJxOF7d3WyH6eA8gbmhBTqoylaBGNrqlslT3uRffUbYGeJYn2kbG81tD6aK64g88RkNIaech1tn5HJYAe8fRReg5uIW5XWlkZcQkuQG5Yfh/axpOSJU/DMWWB2HEkfoT9zMWjYEMGksgyyCKY6c7zbVRZ12n2fCDAXpsojJgbdd+Z6wPpoazp0atuizJlROonkGEjtKgRePUOCCStdaALIh/ddL308kmCPB73jbHmugAt5k0A8bo81miqWEP/7viswm2uRI01i90mNn0N+WmlJhy8sBCDd8HGPaC3RF2DXSAg+G4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(366004)(396003)(39860400002)(376002)(346002)(451199018)(64756008)(55016003)(107886003)(53546011)(6506007)(478600001)(966005)(9686003)(26005)(186003)(8676002)(4326008)(110136005)(316002)(66446008)(66556008)(66476007)(7696005)(76116006)(71200400001)(66946007)(38070700005)(54906003)(86362001)(82960400001)(33656002)(38100700002)(122000001)(83380400001)(5660300002)(52536014)(41300700001)(8936002)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AlsrBLfWeMLov6qOJ3+XnqW87emUH4Qiv/aUFwq3m8CgxBSUyogfICaE2bO8?= =?us-ascii?Q?N4Colbv8LZTERhfIktiJbpCzNBZKUfWkbii4S6IWpnNsXk8dFUibZ0kYYIhI?= =?us-ascii?Q?NgpJ/xX5KzRsC8R7zPkLle0V8TwkHQLskjhX0pA7LwpNbsP3vkQaFSk8YD/I?= =?us-ascii?Q?4qSBq8wCCovG5zmcP8RHh9Oj9snOBbF6PYuTDX3drEp/Y+mtcL4OxNE8x8w4?= =?us-ascii?Q?WJCx5ogMau42LdxIucDkoD8eoXI+ykxQ1vkG1h+EQ6Zu8OdpNhqYj2pNQSbl?= =?us-ascii?Q?kxO0TadBXVNNicfHl+FdxitYV7usoRR3hmJackBJ3s79+CY3/hEXHxxlJEh0?= =?us-ascii?Q?7XbY7OrMIiGwOKHpcVBGH1rU99Nnk/4KtEnBQsRQSMNWSj1cNjf0Mm4VUoef?= =?us-ascii?Q?wB+9NhSE1CLSWqGGuhquoJElqXRX5109xW/4CSsPVuuwnGjYBawyQdlNd/PI?= =?us-ascii?Q?33BwLUKkhDV3sCpHpLY3hUzz/1fCD7lxdaIpwNxNEso53Z5LIbeO9pOM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X1A7jKmDubPwUnQtZZ4Y4//REp9cspnzWSPV2lLsScX0tnAc?= =?us-ascii?Q?zg+udUabqQkeYHUp8mZ3gL14Ll0OaiTD/Gv8MeJM0ID/vOEi5NppNeLuvanl?= =?us-ascii?Q?/z76zSyE4llpj9A6LrN8ATMX6ZFCBPxGGpukdmvB62yc6E4q8q5OKTZ94Wbm?= =?us-ascii?Q?K6+3aZdqYLhQIrIbjxg0k9zmwEnx6gyFoTjxZ1KQ?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c4fa0b2-e6cb-49ec-a460-08db080179a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2023 05:17:43.1385 (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: nyngsyUzCLDlhu2xesnHI1elU03mXYtd5Ai3gnRInIB17SPaGnksljj4rcc9K+vXCxtq0pRNW2fAy2wFxUS4Gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6291 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao A Wu Best Regards, Hao Wu > -----Original Message----- > From: Zhu, Weipu > Sent: Thursday, February 2, 2023 2:42 PM > To: devel@edk2.groups.io > Cc: Zhu, Weipu ; Wu, Hao A ; > Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang > Subject: [PATCH v2 1/2] MdePkg: Add RPMB related commands and DCB > definition for NVMe >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4303 >=20 >=20 >=20 > Add RPMB(Replay Protected Memory Block) access commands, >=20 > result and DCB(Device Configuration Block) definition for >=20 > NVMe according to the NVMe spec 2.0. >=20 >=20 >=20 > Signed-off-by: Weipu Zhu >=20 > Cc: Hao Wu >=20 > Cc: Michael D Kinney >=20 > Cc: Liming Gao >=20 > Cc: Zhiguang Liu >=20 > --- >=20 > MdePkg/Include/IndustryStandard/Nvme.h | 46 > +++++++++++++++++++++++++- >=20 > 1 file changed, 45 insertions(+), 1 deletion(-) >=20 >=20 >=20 > diff --git a/MdePkg/Include/IndustryStandard/Nvme.h > b/MdePkg/Include/IndustryStandard/Nvme.h >=20 > index 4a1d92c45d..3b4e9fe67c 100644 >=20 > --- a/MdePkg/Include/IndustryStandard/Nvme.h >=20 > +++ b/MdePkg/Include/IndustryStandard/Nvme.h >=20 > @@ -2,12 +2,13 @@ >=20 > Definitions based on NVMe spec. version 1.1. >=20 >=20 >=20 > (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>=20 > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > @par Specification Reference: >=20 > NVMe Specification 1.1 >=20 > NVMe Specification 1.4 >=20 > + NVMe Specification 2.0 >=20 >=20 >=20 > **/ >=20 >=20 >=20 > @@ -502,6 +503,49 @@ typedef struct { >=20 > // UINT8 *Data; /* Data to be written or re= ad by signed > access where M =3D 512 * Sector Count. */ >=20 > } NVME_RPMB_DATA_FRAME; >=20 >=20 >=20 > +// >=20 > +// RPMB Device Configuration Block Data Structure. >=20 > +// (ref. NVMe Base spec. v2.0 Figure 460). >=20 > +// >=20 > +typedef struct { >=20 > + UINT8 BPPEnable; /* Boot Partition Protection Enabled */ >=20 > + UINT8 BPLock; /* Boot Partition Lock */ >=20 > + UINT8 NameSpaceWrP; /* Namespace Write Protection */ >=20 > + UINT8 Rsvd1[509]; /* Reserved as of Nvm Express 2.0 Spec */ >=20 > +} NVME_RPMB_DCB; >=20 > + >=20 > +// >=20 > +// RPMB Request and Response Message Types. >=20 > +// (ref. NVMe Base spec. v2.0 Figure 461). >=20 > +// >=20 > +#define NVME_RPMB_AUTHKEY_PROGRAM 0x0001 >=20 > +#define NVME_RPMB_COUNTER_READ 0x0002 >=20 > +#define NVME_RPMB_AUTHDATA_WRITE 0x0003 >=20 > +#define NVME_RPMB_AUTHDATA_READ 0x0004 >=20 > +#define NVME_RPMB_RESULT_READ 0x0005 >=20 > +#define NVME_RPMB_DCB_WRITE 0x0006 >=20 > +#define NVME_RPMB_DCB_READ 0x0007 >=20 > +#define NVME_RPMB_AUTHKEY_PROGRAM_RESPONSE 0x0100 >=20 > +#define NVME_RPMB_COUNTER_READ_RESPONSE 0x0200 >=20 > +#define NVME_RPMB_AUTHDATA_WRITE_RESPONSE 0x0300 >=20 > +#define NVME_RPMB_AUTHDATA_READ_RESPONSE 0x0400 >=20 > +#define NVME_RPMB_DCB_WRITE_RESPONSE 0x0600 >=20 > +#define NVME_RPMB_DCB_READ_RESPONSE 0x0700 >=20 > + >=20 > +// >=20 > +// RPMB Operation Result. >=20 > +// (ref. NVMe Base spec. v2.0 Figure 462). >=20 > +// >=20 > +#define NVME_RPMB_RESULT_SUCCESS 0x00 >=20 > +#define NVME_RPMB_RESULT_GENERAL_FAILURE 0x01 >=20 > +#define NVME_RPMB_RESULT_AHTHENTICATION_FAILURE 0x02 >=20 > +#define NVME_RPMB_RESULT_COUNTER_FAILURE 0x03 >=20 > +#define NVME_RPMB_RESULT_ADDRESS_FAILURE 0x04 >=20 > +#define NVME_RPMB_RESULT_WRITE_FAILURE 0x05 >=20 > +#define NVME_RPMB_RESULT_READ_FAILURE 0x06 >=20 > +#define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07 >=20 > +#define NVME_RPMB_RESULT_INVALID_DCB 0x08 >=20 > + >=20 > // >=20 > // NvmExpress Admin Identify Cmd >=20 > // >=20 > -- >=20 > 2.37.1.windows.1 >=20 >=20