From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.5439.1588916348006798551 for ; Thu, 07 May 2020 22:39:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=EPDE0neM; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: zhiguang.liu@intel.com) IronPort-SDR: aKaDYca+0W49je2ZLPhPH/QuoziqdBSrqwsqkj3uuI13le57UhLPcNfiJxjpAmkFhapSGWEeTu aLDf5iU/uccQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 22:39:07 -0700 IronPort-SDR: EgjMd1igIPwAmGsLxAN1SjwYzdA3xmXYiOQMC0omat/qfioB612AUzJ4++VlMGLjaf9rVBSL9f kZjgPxqlcvTQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="370342722" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 07 May 2020 22:39:07 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 7 May 2020 22:39:06 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 7 May 2020 22:39:06 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 7 May 2020 22:39:06 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 7 May 2020 22:39:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GgIz+ZcwjAoc1sZ5DPjs2GUu6Wh+GUmMfK9wD5cfLBa/3TV1vyQutFk3uomcQP/O6mQHSgZov3f9dP0W5HXHeDsnsxS0JSgrzCw5TySAWfb3sLYCNfStlcvzT3A/4mG5yER3AqR/ha5ROOPbfPxJxdi7YavZrOrAJon/XDbKtxIOABEFqFeEXp3dqC2Lt8SPnTIpT/LaHbYzS0tTC8f7/0ByItVkfB0eHq73D/CkwsD/Z8tCEWZusL6+AIu8pT35pO0G5MKJA3flKohokdKmwrHuGwwQSPjm83gwaNjtTA879i8xle70PqdomO5pKMZ9SVdNZ874zIiSyih4rGiv+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-SenderADCheck; bh=Qyn+ek0eN49iBBs04Bxfls3ajZJ781yNhNgeRX+f0uw=; b=dnd9HMCjzSRxenP6H98qOrqmEtC2JBhILvJVLd9zx6nRf1Gr53ljWcZPCZJmRTGB+nFYm9PSxJIpFRhf3v26zw4vBqqzgYZx2o2CLwk/+vgt0QwaXy+xPzlRobwMbUXqUZVEAn3NRVH927Fdtjy8rfoCdVh+QYZvumxwgM40Fh2CyTvawKd84wVQ6bzUKiP8SLjTkbxZPUXUUy8cihnH/IdiKY/NAD0bI908gGSjQkFnBktNsuwGK/d+YePxuf8J+7VARv7kzT4jWtbKgMHUAChPV4O/HR7AwEz6aMQP1mXnMp6ATbBpn+i5ei9E3bdnJ5vYbzZbtVYCIRtELJq38w== 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=Qyn+ek0eN49iBBs04Bxfls3ajZJ781yNhNgeRX+f0uw=; b=EPDE0neMjlNLi3Oav0dgM1cvAbh8V1jQAWUS886udvsG/NvIJHIlOxrbJ+iZ7nczqa3Kw89oJV2svPLK6dt1V6eELm9DicMTJNQO7DSVkLgKPkFVUgON/92RGHoUvbBzkvlLla4J+4MCxVvSpJhE6ZALi1+YDDqPi3V2OasD4Jo= Received: from BN7PR11MB2804.namprd11.prod.outlook.com (2603:10b6:406:ac::12) by BN7PR11MB2595.namprd11.prod.outlook.com (2603:10b6:406:b1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Fri, 8 May 2020 05:39:04 +0000 Received: from BN7PR11MB2804.namprd11.prod.outlook.com ([fe80::79e2:ed1f:4d6b:532c]) by BN7PR11MB2804.namprd11.prod.outlook.com ([fe80::79e2:ed1f:4d6b:532c%7]) with mapi id 15.20.2958.033; Fri, 8 May 2020 05:39:04 +0000 From: "Zhiguang Liu" To: "devel@edk2.groups.io" , "oleksiyy@ami.com" CC: "Feng, Bob C" , "Gao, Liming" , "Kinney, Michael D" , "Felixp@ami.com" Subject: Re: [edk2-devel] [PATCH v3 7/7] MdePkg: UEFI JSON Capsule Support Thread-Topic: [edk2-devel] [PATCH v3 7/7] MdePkg: UEFI JSON Capsule Support Thread-Index: AQHWJKP647LpXW+apUe5gQVv2J8ZG6idq7oQ Date: Fri, 8 May 2020 05:39:04 +0000 Message-ID: References: <20200507191358.74904-1-oleksiyy@ami.com> <20200507191358.74904-8-oleksiyy@ami.com> In-Reply-To: <20200507191358.74904-8-oleksiyy@ami.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 27b7f1da-db52-4581-1624-08d7f3121ebd x-ms-traffictypediagnostic: BN7PR11MB2595: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 039735BC4E x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aWXjfwkoJuehtpB9mdIdPN8pMdXcpOWTH1te4PE/DVx0GCtUnULiWM0J7TlOiRn2oRl0XG/OFnlLqP3oRW4OEyjz1xtFIFAheQda5UqQbcc0iObS06CRX/92AKjn2YF88T7uXTsV1rdSEf9dWW6/WvfYIl8+x5PYQVtKy1CkiQfuJkqSotLBK/fNhF7Wj8k61f0SzJvNLf8IWuvFiHAEBAImpWkOQFxgicxViPNOmUPMm26L3K5atKPF4vlXCGFGF6p3c3LlAUFmblmT30vFaRCeAlSWXrsjxOGNT2HlvrIbuXiVFV7ULoC7dVHTqAHfDulCzXyeSCvAyfd23kaTdQSe9F8odLsAKtQ0JnfMIqv9PDCZd33LFzo153Bhv1JbKbimYvQJMEQJJVpizxIbRk7thwtiP9PoTLkvGJhFt3q0bnYvnE5JMMSpJvZZjWWzFIivGQQCFv97rdZcy+2GV9KDYdnH8CdXx0m+IjSeb0loPQvN2WRemOnbQ684WSBfEk/Xp1DaV2085XQ21f0qX2pJBVS+cTlJzGIFMq0V3rQS3f+lraXLgo81kJpmuOq6tSqNZjYdAqHE/TpI4DzuT4bjTkGmQV1c7EP4BSHucCc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN7PR11MB2804.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(376002)(136003)(396003)(366004)(39860400002)(346002)(33430700001)(66446008)(71200400001)(33656002)(66946007)(66476007)(478600001)(5660300002)(186003)(83300400001)(966005)(8676002)(33440700001)(26005)(8936002)(83320400001)(83280400001)(83310400001)(83290400001)(86362001)(316002)(66556008)(54906003)(7696005)(76116006)(6506007)(53546011)(55016002)(2906002)(64756008)(9686003)(52536014)(110136005)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: oXkUgrbWUE7HdumgZGiqcQHW5e1I5MSY/++I/8G8+KNild12pubs4kOeSzgVzK6rCS28wg63buCEaopoC4QuMIrfF89cVEOi6wl4ivw1k9iOXmQMOIhkgOZ+Mj3Vo0x4ljwsXuGFIxe7l8OeBlH+XnG+ORByDtRHNqEJ26a+LMPWmTdwutgqBwyWgHoo0ueMGP354xFOtrT0VFMVbdF9IKhwOEhV03NWbFWJFjEh+A2W4QNs0EkhFi/FVwETF8oPL+3UQtXrmCaLbmWzW4mXO1JJ+HlL+u76V3sataXZkrD4Poged/LGXblhXCxs6rwrea1zsvQ57rT9JGCEsItMFrBde7kqW9iTjSXdgqPJRLpjaR1p62MeV/DrQzz8KsJowE1TqbYsyeZE8RcPC+91Q+h+d+DAIGDUEzkfLAXekUUkkqYRnhVzoRPv5DuQAGVVJzqi68T1mu3BfFqqarjyIFOSDzaLi2gOPsbR5IzK88bQ5l5uvLZhuHr68UghqGX3 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 27b7f1da-db52-4581-1624-08d7f3121ebd X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2020 05:39:04.5714 (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: FsvAVVA87A5pSWxhzjnfd936jaurho3pPEyN+QutarYkHo7eo6aUwtvLR21FsSmxmNR5iq9Q+vmhvKdzoSMx1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2595 Return-Path: zhiguang.liu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Oleksiy, Add my comments inline. Thanks Zhiguang > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Oleksiy > Yakovlev > Sent: Friday, May 8, 2020 3:14 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Kinney, Michael D ; > Felixp@ami.com; oleksiyy@ami.com > Subject: [edk2-devel] [PATCH v3 7/7] MdePkg: UEFI JSON Capsule Support >=20 > Added Guids and structures, that defines the work flow to perform capsul= e > update using JSON objects. > (UEFI 2.8 mantis 1935) >=20 > Signed-off-by: Oleksiy Yakovlev > --- > MdePkg/Include/Guid/CapsuleReport.h | 32 +++++++++++- > MdePkg/Include/Guid/JsonCapsule.h | 99 > +++++++++++++++++++++++++++++++++++++ > MdePkg/Include/Uefi/UefiSpec.h | 1 + > MdePkg/MdePkg.dec | 12 +++++ > 4 files changed, 143 insertions(+), 1 deletion(-) > create mode 100644 MdePkg/Include/Guid/JsonCapsule.h >=20 > diff --git a/MdePkg/Include/Guid/CapsuleReport.h > b/MdePkg/Include/Guid/CapsuleReport.h > index 93d2bb7..bdaf275 100644 > --- a/MdePkg/Include/Guid/CapsuleReport.h > +++ b/MdePkg/Include/Guid/CapsuleReport.h > @@ -93,7 +93,37 @@ typedef struct { > /// > } EFI_CAPSULE_RESULT_VARIABLE_FMP; >=20 > - > +typedef struct { > + > + /// > + /// Version of this structure, currently 0x00000001 > + /// > + UINT32 Version; > + > + /// > + /// The unique identifier of the capsule whose processing result is > recorded in this variable. > + /// 0x00000000 b 0xEFFFFFFF b Implementation Reserved > + /// 0xF0000000 b 0xFFFFFFFF b Specification Reserved > + /// #define REDFISH_DEFINED_JSON_SCHEMA 0xF000000 > + /// The JSON payload shall conform to a Redfish-defined JSON schema, > see DMTF-Redfish > + /// Specification. > + /// Zhiguang: Where are these message from? I didn't find in UEFI spec. > + UINT32 CapsuleId; > + > + /// > + /// The length of Resp in bytes. > + /// > + UINT32 RespLength; > + > + /// > + /// Variable length buffer containing the replied JSON payload to the= caller > who delivered JSON > + /// capsule to system. The definition of the JSON schema used in the > replied payload is beyond > + /// the scope of this specification. > + /// > + UINT8 Resp[]; > + /// Zhiguang: Please remove the upper comment symbols > + } EFI_CAPSULE_RESULT_VARIABLE_JSON; > + > extern EFI_GUID gEfiCapsuleReportGuid; >=20 > #endif > diff --git a/MdePkg/Include/Guid/JsonCapsule.h > b/MdePkg/Include/Guid/JsonCapsule.h > new file mode 100644 > index 0000000..eaa126f > --- /dev/null > +++ b/MdePkg/Include/Guid/JsonCapsule.h > @@ -0,0 +1,99 @@ > +/** @file > +Guid & data structure for tables defined for reporting firmware > configuration data to EFI > +Configuration Tables and also for processing JSON payload capsule. > + > + > +Copyright (c) 2020, American Megatrends International LLC. All rights > reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef _JSON_CAPSULE_GUID_H__ > +#define _JSON_CAPSULE_GUID_H__ > + > +// > +// The address reported in the table entry identified by > EFI_JSON_CAPSULE_DATA_TABLE_GUID will be > +// referenced as physical and will not be fixed up when transition from > preboot to runtime phase. The > +// addresses reported in these table entries identified by > EFI_JSON_CONFIG_DATA_TABLE_GUID and > +// EFI_JSON_CAPSULE_RESULT_TABLE_GUID will be referenced as virtual > and will be fixed up when > +// transition from preboot to runtime phase. > +// > +#define EFI_JSON_CONFIG_DATA_TABLE_GUID \ > + {0x87367f87, 0x1119, 0x41ce, \ > + {0xaa, 0xec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }} > +#define EFI_JSON_CAPSULE_DATA_TABLE_GUID \ > + {0x35e7a725, 0x8dd2, 0x4cac, \ > + {0x80, 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }} > +#define EFI_JSON_CAPSULE_RESULT_TABLE_GUID \ > + {0xdbc461c3, 0xb3de, 0x422a, \ > + {0xb9, 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }} > +#define EFI_JSON_CAPSULE_ID_GUID \ > + {0x67d6f4cd, 0xd6b8, 0x4573, \ > + {0xbf, 0x4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }} > + > + > + > + > +#pragma pack(1) > + > +typedef struct { > + /// > + /// Version of the structure, initially 0x00000001. > + /// > + UINT32 Version; > + > + /// > + /// The unique identifier of this capsule. > + /// > + UINT32 CapsuleId; > + > + /// > + /// The length of the JSON payload immediately following this header,= in > bytes. > + /// > + UINT32 PayloadLength; > + > + /// > + /// Variable length buffer containing the JSON payload that should be > parsed and applied to the system. The > + /// definition of the JSON schema used in the payload is beyond the s= cope > of this specification. > + UINT8 Payload[]; > +} EFI_JSON_CAPSULE_HEADER; > + > +typedef struct { > + /// > + /// The length of the following ConfigData, in bytes. > + /// > + UINT32 ConfigDataLength; > + > + /// > + /// Variable length buffer containing the JSON payload that describes= one > group of configuration data within > + /// current system. The definition of the JSON schema used in this pa= yload > is beyond the scope of this specification. > + /// > + UINT8 ConfigData[]; > +} EFI_JSON_CONFIG_DATA_ITEM; > + > +typedef struct { > + /// > + /// Version of the structure, initially 0x00000001. > + /// > + UINT32 Version; > + > + /// > + ////The total length of EFI_JSON_CAPSULE_CONFIG_DATA, in bytes. > + /// > + UINT32 TotalLength; > + > + /// > + /// Array of configuration data groups. > + /// > + EFI_JSON_CONFIG_DATA_ITEM ConfigDataList[]; > +} EFI_JSON_CAPSULE_CONFIG_DATA; > + > +#pragma pack() > + > +extern EFI_GUID gEfiJsonConfigDataTableGuid; > +extern EFI_GUID gEfiJsonCapsuleDataTableGuid; > +extern EFI_GUID gEfiJsonCapsuleResultTableGuid; > +extern EFI_GUID gEfiJsonCapsuleIdGuid; > + > + > +#endif > diff --git a/MdePkg/Include/Uefi/UefiSpec.h > b/MdePkg/Include/Uefi/UefiSpec.h > index c6d306d..ce1b624 100644 > --- a/MdePkg/Include/Uefi/UefiSpec.h > +++ b/MdePkg/Include/Uefi/UefiSpec.h > @@ -1781,6 +1781,7 @@ EFI_STATUS > #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED > 0x0000000000000008 > #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED > 0x0000000000000010 > #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY > 0x0000000000000040 > +#define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_REFRESH > 0x0000000000000080 >=20 > // > // EFI Runtime Services Table > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index ac1f533..77c573e 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -646,6 +646,18 @@ > gEfiBttAbstractionGuid =3D { 0x18633bfc, 0x1735, 0x4217, { 0x= 8a, 0xc9, > 0x17, 0x23, 0x92, 0x82, 0xd3, 0xf8 }} >=20 > # > + # GUIDs defined in UEFI2.8 > + # > + ## Include/Guid/JsonCapsule.h > + gEfiJsonConfigDataTableGuid =3D { 0x87367f87, 0x1119, 0x41ce, { = 0xaa, > 0xec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }} > + gEfiJsonCapsuleDataTableGuid =3D { 0x35e7a725, 0x8dd2, 0x4cac, { = 0x80, > 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }} > + gEfiJsonCapsuleResultTableGuid =3D { 0xdbc461c3, 0xb3de, 0x422a, { = 0xb9, > 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }} > + gEfiJsonCapsuleIdGuid =3D { 0x67d6f4cd, 0xd6b8, 0x4573, { = 0xbf, 0x4a, > 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }} > + > + ## Include\Guid\HiiPlatformSetupFormset.h > + gEfiHiiResetStyleFormsetGuid =3D { 0x790217bd, 0xbecf, 0x485b, {= 0x91, > 0x70, 0x5f, 0xf7, 0x11, 0x31, 0x8b, 0x27 }} > + > + # > # GUID defined in PI1.0 > # > ## Include/Guid/AprioriFileName.h > -- > 2.9.0.windows.1 >=20 >=20 > Please consider the environment before printing this email. >=20 > The information contained in this message may be confidential and > proprietary to American Megatrends (AMI). This communication is intende= d > to be read only by the individual or entity to whom it is addressed or b= y their > designee. If the reader of this message is not the intended recipient, y= ou are > on notice that any distribution of this message, in any form, is strictl= y > prohibited. Please promptly notify the sender by reply e-mail or by > telephone at 770-246-8600, and then delete or destroy all copies of the > transmission. >=20 >=20