From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.2770.1587545462621345959 for ; Wed, 22 Apr 2020 01:51:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ssvRmnTz; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: zhiguang.liu@intel.com) IronPort-SDR: eeld6QJ6Z/UVw+riAZTxlvzzADDIcimfjwpDjFii51xS4LJ6Kqaovz9oUg4Kwi5maWUSZkCyTx lR6Fnd44x8eg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 01:51:02 -0700 IronPort-SDR: 0LpxscRyxHRo+OLi3OL/UmOBXbX+JJNg81aPy7Qb4ddJ291uekwiVMmyCDkQ1IX5B2KhrT8nvK y41j9LJ5NlQw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,413,1580803200"; d="scan'208";a="259004058" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 22 Apr 2020 01:51:01 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Apr 2020 01:51:01 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) 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 01:51:01 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx605.amr.corp.intel.com (10.18.126.85) 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 01:51:01 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Apr 2020 01:51:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g/tTqwygDzsGuAcRNPp5wMRLpRnginedt01xEdvl5ZsmSx9VVU+yd4X+9X0/xnTYg0zcg5io2jv++mHHwcicqEu0vjbZvPnPe/2spBW/1g6JKnhJFeEVKVe0fXwuedbVkhG2Mjie2W++DmC0YnWhrM2vSWO70+HHPmlgaVQJx2LuFQlhKmT/7/IApIpa+5wuqrCTUzNvO0NGKmb0LDdakqTHQ79Y97wlC1JLbYRt9HR5geVLsrsZfMLaykkYyNiq59bBw9KSYrlYpqiu7irIFUWN5KjtxvIyN6p3ZAWtzCaHLctnFKK5DlMb/GxSY9e0kIbnILQdtlz7YckohrJWxQ== 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=i+4CZNjpmpmqLGsJEV5gX9qIOV9scWsCICNnLr0/qos=; b=KD3UIMlSkAo2qjfGeKKNZRxwtvOj5D6qUgAYN2J15eHuLk3d8oaSVK0h87HxJcikRwg/sntkrCk4C3dMrK89OmxOdZkwZA3pl+s131MXdbdzGfnSkhlQkbpGPHzKdOFHU5LHRIMP1DW+SQNyfiy5kBjTzUi4ckuPLeuhHohbcW7xZwmHo9WRCAvep142CS2HWplfGdBFzM8XlxiXWUHCh7XKQG8OmdvZGYwQVMndesDyy616ORDKfto7aEG1DASvNeHDh12DL/iK3igPaLUNzGgw/dUqwH/Ve5Golf32/ejsQxMwKVk7HiC4tVY8wkJU6g6TjDTsmj1cUpVwGnj6Nw== 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=i+4CZNjpmpmqLGsJEV5gX9qIOV9scWsCICNnLr0/qos=; b=ssvRmnTzb4mDZ7xE9L8P7VuQnK8TsuYvWMwPX2x99wOtr/tBNvQaXJlLotURCTJS/uKmBlGoh+WZNRToOLjoe7Pr7j36UpL5jbiMfLvCafALulpGZ9iQ9OKg2ZgfE6jtziOqRRWhFIhZO0mCNWRtc31mJjYVYblXGeLFtz7I6w4= Received: from BN7PR11MB2804.namprd11.prod.outlook.com (2603:10b6:406:ac::12) by BN7PR11MB2770.namprd11.prod.outlook.com (2603:10b6:406:b4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 08:50:59 +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; Wed, 22 Apr 2020 08:50:59 +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 v1 7/7] MdePkg: UEFI JSON Capsule Support Thread-Topic: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support Thread-Index: AQHWDq1GFJbUpOTNe0qNSMiV0yLv4KiE45kg Date: Wed, 22 Apr 2020 08:50:58 +0000 Message-ID: References: <20200409202550.35116-1-oleksiyy@ami.com> <20200409202550.35116-8-oleksiyy@ami.com> In-Reply-To: <20200409202550.35116-8-oleksiyy@ami.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: 80dd2817-d699-4cfa-66f0-08d7e69a473f x-ms-traffictypediagnostic: BN7PR11MB2770: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 03818C953D 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)(39860400002)(396003)(366004)(376002)(346002)(136003)(52536014)(33656002)(66946007)(8676002)(71200400001)(66556008)(64756008)(66446008)(81156014)(966005)(9686003)(66476007)(110136005)(316002)(4326008)(2906002)(478600001)(55016002)(186003)(54906003)(8936002)(53546011)(76116006)(26005)(86362001)(6506007)(7696005)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QRCOY2fOkZMCB/eVLf1X/FY0plwbQGJYgdnHBoHzu9idGVEZcv8ZcTJ6h78j5pD2868rwpQJcYv77Cq/4TajiY9bwgVx2rVxN9PTgtWcMUhpp7C87jFa3caTKgvuxM5JIhEgLknU3ivLZ6NFQ4SeKA95ApBImPBmLDv94h17kEbVv+BNHrQ3CZoUIbmUY+lxQQWBMJymhWVt6FRgc7wBpD2zN1u0xfKyzsIIpSXVVtV9Du77wNPU90CO8zi3Y0wQ2lDxEX1sbhUUq9xz26l8ACJspGl1R0yioXktHXaO452VESR+eiZn+F9oyFpNhj2r7vTr9qS2QpY1RHRdccYb0tKT2mAXwcpiFVXwy9xnC63PaODE+NNIM4stF4YzmN+xEA5he+SaTZygiL8PcX31XBrEucbkqfodLS7bZqHf575kQqoZhdfCbcQisaXuUkG3elcLgBBMl+tGsxOv+68ljH5g78XHVDLdPdx6RKPwMg8udDOfobO+RRKCUb2hG8LfSB2X+xTdkd47wve/Rzhcww== x-ms-exchange-antispam-messagedata: MRe5SNKPx5xQErT1VYkD62HnTBMjh4CQAY8kI1139leyhn46LnYlLbs+98K94g/o1KGou6j5MMksqYGgJEK6haadsL7I5XnnauSPHglyqnTITfmj9mTjHcUbq0CNTUM/ikfvd+x7ThNhTJLVPsj0Dg== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 80dd2817-d699-4cfa-66f0-08d7e69a473f X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2020 08:50:58.8585 (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: oY3WtgXorNDYp2zL49LtVG9ebCGWfXpKlIiv48IoUxPH236jW3gqdTH7YNR/+P2RbFw2uJg7/ObTEas9VIHQBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2770 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, 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 Yak= ovlev 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 =09Version; + + /// + /// 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 0x00000000000= 00008 #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x00000000000= 00010 #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY 0x00000000000= 00040 +#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, { 0xa= a, 0xec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }} + gEfiJsonCapsuleDataTableGuid =09=3D { 0x35e7a725, 0x8dd2, 0x4cac, { 0= x80, 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }} + gEfiJsonCapsuleResultTableGuid =09=3D { 0xdbc461c3, 0xb3de, 0x422a, { 0= xb9, 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }} + gEfiJsonCapsuleIdGuid =09 =09=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.