From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.166.1587609018414110814 for ; Wed, 22 Apr 2020 19:30:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Ab/f0ZgN; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: zhiguang.liu@intel.com) IronPort-SDR: 8Z7A1Y0A56NfhVcuYoYZ8vzCl0a3uRq6314cCh+3gfAA13WaykKrynmGJUxLHK0LlE/2UiNJGf RXk7e9Aee0Vw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 19:30:17 -0700 IronPort-SDR: p8oswb9faJyWcx+TkP5E9SmEAsyouuF2MzzkrLTgBjF5apCA6zX3yN5xbLG53/5+f9s+1/brQt I4Wjq9wTrYgg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,305,1583222400"; d="scan'208,217";a="274087535" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by orsmga002.jf.intel.com with ESMTP; 22 Apr 2020 19:30:17 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Apr 2020 19:30:16 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 22 Apr 2020 19:30:16 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 22 Apr 2020 19:30:16 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Apr 2020 19:30:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bu0JogTDmtrpWGjtSz1HIV1UzfMN6/qdwaMb/qX6yNTsuXOp0U3noDSXSvle+uxgMjvdXsNDPmAHAt2bKIqC2oeJhVRVu58Ie8ax92nOPwjukvGuqj6/7ATZE6MZPhDybrG6+TNtnocMl7ZaykF3k5UhDeURwx6zljp6QvUc+gQIrLIWdzj9u3N4/PkIgBOV1mXGWMkTt3XFWd6Cw/OG5FYKeBxdCfYfcgiVHMaxZ0EngfYGZ1aiYHtXydgMIMBK7oK/CnLgHKJAdtStVg/+k0oFotmGLHKlMQ6lV1EFRzWFlHZea3xbO7hqQc/aKgavs72KJy7oNwn/AlQGvwqMOw== 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=7rdw4yugb6KqWZ+Y5JAzmJBps2MWr4+BiWCoPukDz74=; b=LLsYvqvKAFXvCraAnIaLjdXo4imqFOhyUeVp4oluclg2KzUNe+zHrk7IeNifRPedg0GdFxGGTr52pSXa7qziT9mJ8dSQ446HOx51e0xn0S4JGNmTcyaj6OP5Ew1CeN/1Tjyr0PoyX6hzLH63rXBFF8DWBWiAuM/qcYb8xn4TaMzw1yi9u/QZIMc0HPt6pjvla7gpAjM1LfXYWpF6oQ4wfVqOyKPsH/sSHxEwsY7mUMxbyugHs9sSlaGGh8YdobfMVqY2zTLLRS7HmLfhEhGnqFMKr8Eg0qV05GAUiZd9p4XREs9mmCjW9Yrn9hN1PsnaaOQ+xz9oZwHUd83OsPV5eQ== 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=7rdw4yugb6KqWZ+Y5JAzmJBps2MWr4+BiWCoPukDz74=; b=Ab/f0ZgN/Q9U8B1jTMbgPW1Bs9nretAr2y0CETK0PwewYQaQb15VGSUihY5TBzGqODFSSt0KP6azA+qRDgRUmp1u5dXcSCIxfFD/JqO5EyvVZ/VmqDaiHgwwwlH8qKCFgousNgz8P1VcisiHDMgf/PR1UVN7Xul7Mv3lPHSxYWY= Received: from BN7PR11MB2804.namprd11.prod.outlook.com (2603:10b6:406:ac::12) by BN7PR11MB2708.namprd11.prod.outlook.com (2603:10b6:406:a9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.27; Thu, 23 Apr 2020 02:30:13 +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.2921.030; Thu, 23 Apr 2020 02:30:13 +0000 From: "Zhiguang Liu" To: Oleksiy Yakovlev , "devel@edk2.groups.io" CC: "Feng, Bob C" , "Gao, Liming" , "Kinney, Michael D" , Felix Polyudov Subject: Re: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support Thread-Topic: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support Thread-Index: AQHWDq1GFJbUpOTNe0qNSMiV0yLv4KiE45kggADL1wCAAF+rQA== Date: Thu, 23 Apr 2020 02:30:13 +0000 Message-ID: References: <20200409202550.35116-1-oleksiyy@ami.com> <20200409202550.35116-8-oleksiyy@ami.com> <6BD875C24FFE2A4E8D6EFC142C67836F03FF656FB5@atlms1.us.megatrends.com> In-Reply-To: <6BD875C24FFE2A4E8D6EFC142C67836F03FF656FB5@atlms1.us.megatrends.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiguang.liu@intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 79fc4b67-728e-4b05-63b4-08d7e72e40b9 x-ms-traffictypediagnostic: BN7PR11MB2708: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 03827AF76E 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:(10019020)(396003)(366004)(376002)(39860400002)(346002)(136003)(478600001)(66946007)(9686003)(52536014)(8936002)(86362001)(54906003)(33656002)(5660300002)(316002)(30864003)(76116006)(81156014)(966005)(4326008)(26005)(66556008)(6506007)(110136005)(2906002)(66476007)(7696005)(8676002)(55016002)(66446008)(9326002)(16799955002)(71200400001)(64756008)(53546011)(186003);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TSv8eDnGrrrvihMlnYUQm2ngU43p876KTMrTjzOKpJd1pmKUxR3VU7lN5sTOMPDa++seI+/j2LfFgAn7aR/M3jThRgoViHGxhFjTC7ziegbI1T2QxV7i9WyhhFL7lFcp04rQQwkAlYjWus2nCTsA3WakAByvQW+2ivhZoNLPNvvV+fJatZR4FfLC07u1+WZ1A0uh9fy2KKKutZVdxxNpH3bXl8tKm7dI4U3O37RAGHooOt4Lbr/oVWRPNR2o3Is5QS0GvGQGPeAxSGbMMsdFPFYw23Vmme2+JinjbAglHx9+CxfYXIXmdH+y7FHDGZyYLCpwZN9MuXqSYafydVkzLVw+VZ3IL0d5NyRSpHQ0bqSMtth5a6KAbI4Lzzc81sn0UwgALpX2vBWQtUkQc3Drd6aTs6beKsxFUEnU8Ln92XH3VDlSaT6jZr7F6BxE6SwL6QWYJR/nEkruzVbC/KUH5sDGeZMoZAopVOg67smWyaRN7LSNmj99uezVK+UIa9XOKn+lerGEA2PrhbtnJaXSnA== x-ms-exchange-antispam-messagedata: zVQiY5LrUcM9wB+1PlNkdjdCmSD4bypNgLUhaFW99iuDCYUShhKpLqDyhyq9IHpLJt0pR5gGvyktg7OpN/JBuV6ZYGdDCxDlIX7g9E8j06eXMi0ZG0FzSJKPlMmNPGKWaF+bIFvC4OLC5HJFPSrNUg== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 79fc4b67-728e-4b05-63b4-08d7e72e40b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2020 02:30:13.4509 (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: Qyb8gXvMueCPuMIUAcN8zakmC3HUHKrLRRhzC0A4EUjy7IflV5/mxNlVKn1hySlIbjWUOICAQHRH2Lj55gflrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2708 Return-Path: zhiguang.liu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN7PR11MB280490AEFD37D3B1762314AA90D30BN7PR11MB2804namp_" --_000_BN7PR11MB280490AEFD37D3B1762314AA90D30BN7PR11MB2804namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Oleksiy, I agree with you that your original code change is good. But I can't open the link you posted. Can you send your new code change here, so that everyone can give their co= mments. Thanks Zhiguang From: Oleksiy Yakovlev Sent: Thursday, April 23, 2020 4:41 AM To: Liu, Zhiguang ; devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming = ; Kinney, Michael D ; Felix Polyudov Subject: RE: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support Hi Zhiguang. Thank you for your feedback. Using definition from Spec: typedef struct { UINT32 ConfigDataLength; UINT8 ConfigData[ConfigDataLength]; } EFI_JSON_CONFIG_DATA_ITEM; will result in build error. You can't use structure field to define array = size. I addressed this issue by commenting out ConfigData, because 3 additional = structures, introduced by same mantis use this approach for arrays of unkno= wn size. But discussing it further with my colleagues here at AMI, we decided that = commenting out arrays of unknown size in structures make them harder to use= . So I proposed another approach - use UINT8 ConfigData[]; for this structur= e and for additional 3 structures introduced by this JSON capsule update fe= ature. See here: Mantis 2096 Regards, Oleksiy. -----Original Message----- From: Liu, Zhiguang [mailto:zhiguang.liu@intel.com] Sent: Wednesday, April 22, 2020 4:51 AM To: devel@edk2.groups.io; Oleksiy Yakovlev Cc: Feng, Bob C; Gao, Liming; Kinney, Michael D; Felix Polyudov Subject: RE: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support Hi Oleksiy, The definition of EFI_JSON_CONFIG_DATA_ITEM doesn't totally follow the spe= c. It is as below in spec without commenting ConfigData. typedef struct { UINT32 ConfigDataLength; UINT8 ConfigData[ConfigDataLength]; } EFI_JSON_CONFIG_DATA_ITEM; Can you explain why? Thanks Zhiguang -----Original Message----- From: devel@edk2.groups.io > On Behalf Of Oleksiy Yakovlev Sent: Friday, April 10, 2020 4:26 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 v1 7/7] MdePkg: UEFI JSON Capsule Support Added Guids and structures, that defines the work flow to perform capsule update using JSON objects. (UEFI 2.8 mantis 1935) 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 diff --git a/MdePkg/Include/Guid/CapsuleReport.h b/MdePkg/Include/Guid/Cap= suleReport.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; - +typedef struct { + + /// + /// Version of this structure, currently 0x00000001 + /// + UINT32 Version; + + /// + /// The unique identifier of the capsule whose processing result is rec= orded 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, se= e DMTF-Redfish + /// Specification. + /// + UINT32 CapsuleId; + + /// + /// The length of Resp in bytes. + /// + UINT32 RespLength; + + /// + /// Variable length buffer containing the replied JSON payload to the c= aller who delivered JSON + /// capsule to system. The definition of the JSON schema used in the re= plied payload is beyond + /// the scope of this specification. + /// + /// UINT8 Resp[]; + /// + } EFI_CAPSULE_RESULT_VARIABLE_JSON; + extern EFI_GUID gEfiCapsuleReportGuid; #endif diff --git a/MdePkg/Include/Guid/JsonCapsule.h b/MdePkg/Include/Guid/JsonC= apsule.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 configura= tion data to EFI +Configuration Tables and also for processing JSON payload capsule. + + +Copyright (c) 2020, American Megatrends International LLC. All rights res= erved.
+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 p= reboot to runtime phase. The +// addresses reported in these table entries identified by EFI_JSON_CONFI= G_DATA_TABLE_GUID and +// EFI_JSON_CAPSULE_RESULT_TABLE_GUID will be referenced as virtual and w= ill 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, i= n bytes. + /// + UINT32 PayloadLength; + + /// + /// Variable length buffer containing the JSON payload that should be p= arsed and applied to the system. The + /// definition of the JSON schema used in the payload is beyond the sco= pe 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 o= ne group of configuration data within + /// current system. The definition of the JSON schema used in this payl= oad is beyond the scope of this specification. + /// + ///UINT8 ConfigData[ConfigDataLength]; +} 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 0x000000000000= 0008 #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x000000000000= 0010 #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY 0x000000000000= 0040 +#define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_REFRESH 0x00000000000= 00080 // // 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, { 0x8a= , 0xc9, 0x17, 0x23, 0x92, 0x82, 0xd3, 0xf8 }} # + # 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, { 0= x91, 0x70, 0x5f, 0xf7, 0x11, 0x31, 0x8b, 0x27 }} + + # # GUID defined in PI1.0 # ## Include/Guid/AprioriFileName.h -- 2.9.0.windows.1 Please consider the environment before printing this email. The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be rea= d only by the individual or entity to whom it is addressed or by their desi= gnee. If the reader of this message is not the intended recipient, you are = on notice that any distribution of this message, in any form, is strictly p= rohibited. Please promptly notify the sender by reply e-mail or by telepho= ne at 770-246-8600, and then delete or destroy all copies of the transmissi= on. P Please consider the environment before printing this email The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. 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= . --_000_BN7PR11MB280490AEFD37D3B1762314AA90D30BN7PR11MB2804namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Oleksiy,

I agree with you that your original code change is = good.

But I can’t open the link you posted.

Can you send your new code change here, so that eve= ryone can give their comments.

Thanks

Zhiguang

 

From: Oleksiy Yakovlev <Oleksiyy@ami.com&= gt;
Sent: Thursday, April 23, 2020 4:41 AM
To: Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups= .io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <limin= g.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; = Felix Polyudov <Felixp@ami.com>
Subject: RE: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule = Support

 

Hi Zhiguang.

 

Thank you for your feedback.

 

Using definition from Spec:

typedef struct {

UINT32 ConfigDataLength;

UINT8 ConfigData[ConfigDa= taLength];

} EFI_JSON_CONFIG_DATA_ITEM;

will result in build error. You can't use structure= field to define array size.

I addressed this issue by commenting out ConfigData= , because 3 additional structures, introduced by same mantis use this appro= ach for arrays of unknown size.

 

But discussing it further with my colleagues here a= t AMI, we decided that commenting out arrays of unknown size in structures = make them harder to use.

So I proposed another approach - use UINT8 ConfigDa= ta[]; for this structure and for additional 3 structures introduced by this= JSON capsule update feature.

 

See here:

 

 

Regards, Oleksiy.

 

-----Original Message-----

From: Liu, Zhiguang [mailto:zhiguang.liu@intel.com]

Sent: Wednesday, April 22, 2020 4:51 AM<= /p>

To: devel@e= dk2.groups.io; Oleksiy Yakovlev

Cc: Feng, Bob C; Gao, Liming; Kinney, Michael D; Fe= lix Polyudov

Subject: RE: [edk2-devel] [PATCH v1 7/7] MdePkg: UE= FI JSON Capsule Support

 

Hi Oleksiy,

 

The definition of EFI_JSON_CONFIG_DATA_ITEM doesn't= totally follow the spec.

It is as below in spec without commenting ConfigDat= a.

 

typedef struct {

UINT32 ConfigDataLength;

UINT8 ConfigData[ConfigDataLength];

} EFI_JSON_CONFIG_DATA_ITEM;

 

Can you explain why?

 

Thanks

Zhiguang

 

-----Original Message-----

From: devel= @edk2.groups.io <devel@edk2.= groups.io> On Behalf Of Oleksiy Yakovlev

Sent: Friday, April 10, 2020 4:26 AM

Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com&g= t;; Felixp@ami.com; oleksiyy@ami.com

Subject: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI J= SON Capsule Support

 

Added Guids and structures, that defines the work f= low to perform capsule

update using JSON objects.

(UEFI 2.8 mantis 1935)

 

Signed-off-by: Oleksiy Yakovlev <oleksiyy@ami.com>

---

MdePkg/Include/Guid/CapsuleReport.h | 32 ++= +++++++++-

MdePkg/Include/Guid/JsonCapsule.h   | 99 = +++++++++++++++= +++++++++++++++= +++++++

MdePkg/Include/Uefi/UefiSpec.h   &nb= sp;  |  1 +

MdePkg/MdePkg.dec     &nbs= p;             = | 12 +++++

4 files changed, 143 insertions(+), 1 deletion(= -)

create mode 100644 MdePkg/Include/Guid/JsonCapsule.= h

 

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 {<= /p>

   ///

} EFI_CAPSULE_RESULT_VARIABLE_FMP;

 

-

+typedef struct {

+

+  ///

+  /// Version of this structure, currentl= y 0x00000001

+  ///

+  UINT32     &nb= sp;  Version;

+

+  ///

+  /// The unique identifier of the capsul= e whose processing result is recorded in this variable.

+  /// 0x00000000 b  0xEFFFFFFF b&nbs= p; Implementation Reserved

+  /// 0xF0000000 b  0xFFFFFFFF b&nbs= p; Specification Reserved

+  /// #define REDFISH_DEFINED_JSON_SCHEMA= 0xF000000

+  /// The JSON payload shall conform to a= Redfish-defined JSON schema, see DMTF-Redfish

+  /// Specification.

+  ///

+  UINT32 CapsuleId;

+

+  ///

+  /// The length of Resp in bytes.

+  ///

+  UINT32 RespLength;

+

+  ///

+  /// Variable length buffer containing t= he replied JSON payload to the caller who delivered JSON

+  /// capsule to system. The definition o= f the JSON schema used in the replied payload is beyond

+  /// the scope of this specification.

+  ///

+  /// UINT8 Resp[];

+  ///

+ } EFI_CAPSULE_RESULT_VARIABLE_JSON;

+

extern EFI_GUID gEfiCapsuleReportGuid;

 

#endif

diff --git a/MdePkg/Include/Guid/JsonCapsule.h b/Md= ePkg/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 f= or reporting firmware configuration data to EFI

+Configuration Tables and also for processing J= SON payload capsule.

+

+

+Copyright (c) 2020, American Megatrends Intern= ational LLC. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#ifndef _JSON_CAPSULE_GUID_H__

+#define _JSON_CAPSULE_GUID_H__

+

+//

+// The address reported in the table entry ide= ntified by EFI_JSON_CAPSULE_DATA_TABLE_GUID will be

+// referenced as physical and will not be fixe= d up when transition from preboot to runtime phase. The

+// addresses reported in these table entries i= dentified 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 \=

+       {0x87367f= 87, 0x1119, 0x41ce, \

+       {0xaa, 0x= ec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }}

+#define EFI_JSON_CAPSULE_DATA_TABLE_GUID \

+       {0x35e7a7= 25, 0x8dd2, 0x4cac, \

+       {0x80, 0x= 11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }}

+#define EFI_JSON_CAPSULE_RESULT_TABLE_GUID \

+       {0xdbc461= c3, 0xb3de, 0x422a,\

+       {0xb9, 0x= b4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }}

+#define EFI_JSON_CAPSULE_ID_GUID \<= /p>

+       {0x67d6f4= cd, 0xd6b8,  0x4573, \

+       {0xbf, 0x= 4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }}

+

+

+

+

+#pragma pack(1)

+

+typedef struct {

+  ///

+  /// Version of the structure, initially= 0x00000001.

+  ///

+  UINT32 Version;

+

+  ///

+  /// The unique identifier of this capsu= le.

+  ///

+  UINT32 CapsuleId;

+

+  ///

+  /// The length of the JSON payload imme= diately following this header, in bytes.

+  ///

+  UINT32 PayloadLength;

+

+  ///

+  /// Variable length buffer containing t= he JSON payload that should be parsed and applied to the system. The

+  /// definition of the JSON schema used = in the payload is beyond the scope of this specification.

+  /// UINT8 Payload[];

+} EFI_JSON_CAPSULE_HEADER;

+

+typedef struct {

+  ///

+  /// The length of the following ConfigD= ata, in bytes.

+  ///

+  UINT32 ConfigDataLength;

+

+  ///

+  /// Variable length buffer containing t= he JSON payload that describes one group of configuration data within<= /o:p>

+  /// current system. The definition of t= he JSON schema used in this payload is beyond the scope of this specificati= on.

+  ///

+  ///UINT8 ConfigData[ConfigDataLength];<= o:p>

+} EFI_JSON_CONFIG_DATA_ITEM;

+

+typedef struct {

+  ///

+  /// Version of the structure, initially= 0x00000001.

+  ///

+  UINT32 Version;

+

+  ///

+  ////The total length of EFI_JSON_CAPSUL= E_CONFIG_DATA, in bytes.

+  ///

+  UINT32 TotalLength;

+

+  ///

+  /// Array of configuration data groups.=

+  ///

+  /// EFI_JSON_CONFIG_DATA_ITEM ConfigDat= aList[];

+} EFI_JSON_CAPSULE_CONFIG_DATA;

+

+#pragma pack()

+

+extern EFI_GUID gEfiJsonConfigDataTableGuid;

+extern EFI_GUID gEfiJsonCapsuleDataTableGuid;<= o:p>

+extern EFI_GUID gEfiJsonCapsuleResultTableGuid= ;

+extern EFI_GUID gEfiJsonCapsuleIdGuid;

+

+

+#endif

diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePk= g/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&nb= sp;           0x000000000= 0000008

#define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPO= RTED     0x0000000000000010

#define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY&= nbsp;         0x0000000000000040

+#define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_RE= FRESH         0x0000000000000080

 

//

// EFI Runtime Services Table

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec<= o:p>

index ac1f533..77c573e 100644

--- a/MdePkg/MdePkg.dec

+++ b/MdePkg/MdePkg.dec

@@ -646,6 +646,18 @@

   gEfiBttAbstractionGuid  &nbs= p;      =3D { 0x18633bfc, 0x1735, 0x4217, { 0x8a, = 0xc9, 0x17, 0x23, 0x92, 0x82, 0xd3, 0xf8 }}

 

   #

+  # 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, 0x4ca= c, { 0x80, 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }}

+  gEfiJsonCapsuleResultTableGuid &nb= sp;      =3D { 0xdbc461c3, 0xb3de, 0x422a, { 0xb9,= 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }}

+  gEfiJsonCapsuleIdGuid   =             &nb= sp;            =     =3D { 0x67d6f4cd, 0xd6b8, 0x4573, { 0xbf, 0x4a, 0xde, 0x= 5e, 0x25, 0x2d, 0x61, 0xae }}

+

+  ## Include\Guid\HiiPlatformSetupFormset= .h

+  gEfiHiiResetStyleFormsetGuid  = ;    =3D { 0x790217bd, 0xbecf, 0x485b, { 0x91, 0x70, 0x5f, 0= xf7, 0x11, 0x31, 0x8b, 0x27 }}

+

+  #

   # GUID defined in PI1.0

   #

   ## Include/Guid/AprioriFileName.h=

--

2.9.0.windows.1

 

 

Please consider the environment before printing thi= s email.

 

The information contained in this message may be co= nfidential and proprietary to American Megatrends (AMI).  This communi= cation is intended to be read only by the individual or entity to whom it i= s addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice t= hat any distribution of this message, in any form, is strictly prohibited.&= nbsp; 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.

 

 

 

P Please = consider the environment before printing this email

The information contained in this message may be confidential and propr= ietary to American Megatrends (AMI). This communication is intended to be r= ead only by the individual or entity to whom it is addressed or by their de= signee. If the reader of this message is not the intended recipient, you are on notice that any distribution of= this message, in any form, is strictly 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.

--_000_BN7PR11MB280490AEFD37D3B1762314AA90D30BN7PR11MB2804namp_--