From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web08.16124.1635056679051948375 for ; Sat, 23 Oct 2021 23:24:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=AmQgpE6+; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: benjamin.you@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10146"; a="229762682" X-IronPort-AV: E=Sophos;i="5.87,177,1631602800"; d="scan'208";a="229762682" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2021 23:24:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,177,1631602800"; d="scan'208";a="445811422" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga006.jf.intel.com with ESMTP; 23 Oct 2021 23:24:37 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2242.12; Sat, 23 Oct 2021 23:24:37 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Sat, 23 Oct 2021 23:24:37 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Sat, 23 Oct 2021 23:24:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YrFLTNeov7cHnWPPFVWm43goma4X1eEN/yx6EHNIIcGKO+0x43o5gx3mQBZaRDBHuzlA4MMqu3otH78gTMHGDjjcZpjJ6Lg5sYuGwi9QAQgcs9as0GYIsErnTCa0y6dFCm/K99y/rpNrTuc9ryRus0GAmDkfVgXFaCPwn3ObqCa50yTaE/ObSoS9jqB/0C/QAb0eB8Mw+ZY4+D/7IiS3CdhiOMTcFk+Cq77Q/RRabaPppd/K8A/MxsEFlyMlCHB8wR0FRgtajWctq278Bxo9+kt2bRqVKJ+nudaYHrhER5vfSATX8NApcB7UpXKKQquo5kcfaLuUHgZ/sKGSKR5MzQ== 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=NniC77lOgxPjheqLlYHVqRwdm4+1Va8BXRODgA/H8i4=; b=Cdy8nCUdSSTFPLZCdzIZY99B41ZyqVZZN1M2Dj+sCRFK1PXDYfSf7qoRcjySrTRAcwhxy6NqBN6IBL96BUe4peiSRGh3hq3F10/47dsrPv/pkQ9/JMbDSqkJHrw9DjyQsRkg6e5Eqff7LXN1yg8siY+xaFTsEMEhNzL3WjpGUe8B3BvW4kZfBMXw8YYL5DJT1i/qpQS1sfnc+XJIX5/q2dZKyvTHyQg/hFAC4B4ORIoKc+X6H29b0A2OvbwjG6sxtqKn4188YK8qH2pjXHqfT+ZehCM2oWk8NZroG25j4h8/38JNk2P2Lz0itcajEDPEvgSw6mOGilJ9r5O0nYigBQ== 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=NniC77lOgxPjheqLlYHVqRwdm4+1Va8BXRODgA/H8i4=; b=AmQgpE6+u2avjuM6upRJZEUFPYfk/uY7xHxnUsHCEzv5W6irxIlBJF+Ccdaz10lakswLrXP31H+fy0hgBRwFhmz0wNyR5wNxdMiX9cbZmhOnrlwLjPX5FjCSPmsJsFYnFUVgfmZqNO4vbFg0e0rQOs+fv5q97ryd1l9ZRgcBcvg= Received: from CO1PR11MB4867.namprd11.prod.outlook.com (2603:10b6:303:9a::13) by MWHPR11MB1791.namprd11.prod.outlook.com (2603:10b6:300:10f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Sun, 24 Oct 2021 06:24:35 +0000 Received: from CO1PR11MB4867.namprd11.prod.outlook.com ([fe80::455e:9cfb:d106:4480]) by CO1PR11MB4867.namprd11.prod.outlook.com ([fe80::455e:9cfb:d106:4480%8]) with mapi id 15.20.4628.020; Sun, 24 Oct 2021 06:24:35 +0000 From: "Benjamin You" To: "Dong, Guo" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Ma, Maurice" Subject: Re: [`edk2-devel][PATCH V3 0/8] Add SMM variable support for UEFI payload Thread-Topic: [`edk2-devel][PATCH V3 0/8] Add SMM variable support for UEFI payload Thread-Index: AQHXx1wHYY5o3XUHt0WxyMr2pflic6vhsMpQ Date: Sun, 24 Oct 2021 06:24:35 +0000 Message-ID: References: <20211022154627.1607-1-guo.dong@intel.com> In-Reply-To: <20211022154627.1607-1-guo.dong@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 343383b3-3ee5-4b25-2256-08d996b6f31a x-ms-traffictypediagnostic: MWHPR11MB1791: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Bz8f5r1scAyg/4ev4KXXnTJBAKveX8kVD0W/s5HLdqFXJzVBX4gEpv7xsEavpOwHTfHz1/OrsgIKDRwVWRE6SejG1UcG8MeeYcQ+rXWILuVIOUJm375Iuhn04aSJ+zZz3jdrJoPWNV8GPHoaNt3Sr2qwdqpTSk5Y2LOAxf8QSRBaIqyu0vHnBapA4gXbaG3nhlZxsfgTzptHLim/cRKFunCURZOeMNeE4FTmiGE0ZmvcMUnPJkw+1n33wFmYcsAkqK8yyhw4RK1Azdfmnhnd9jSYKWyZM9VjWlFfnaPPnevYsPsPCo2j0yFuVIKZtd9NIXIvVC3zzKaJSun/SSqUuiurdSGwesmwD3otO/M6isLpmSYqNMzJipjZT4wWZsD8fhR2WwJJ+jmMaLrxglc6DITzpWG6Xc3K6H6NjNwuZKca72v5/M3Hiebx6yy4OzSsXzj9N9s1bJzL9UME2iqzajfRog+KbYPG/64abJcL/ICHv95tto04xOoQZ/6OIph621fcZeErg1D3KONmMExSJYqpBe0MYlGwaWv6wDqjwJ/nd8B3DhDp8z4VkEl6x9pfvSxKYnhW5VrgXXEYUX9nDza6Uyww6Dx/k+5aosxpdT0RoaUkmLn6MrswfCvG4PS2dKYTxh5KVDW/FYvJVUEJhE3xcNYShR/XUMeFvrL+OVlP5R4o9TCy6stFDZ73sAEVt0Sx3AbsVr6pKQJAmwxgPjJY3n7KJBhbxj4thWYkQq5vtns6VAmmpGgT1hKtEnuT6CMfMkDQ9qbgX5A/igK+CSCvHQRM3jTn6S2W4kEoT+0ahmlfyXLdEc4EkN714qc1 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4867.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(5660300002)(2906002)(76116006)(55016002)(8936002)(26005)(8676002)(86362001)(186003)(66476007)(19627235002)(7696005)(52536014)(316002)(82960400001)(38100700002)(110136005)(66946007)(53546011)(966005)(38070700005)(9686003)(83380400001)(71200400001)(122000001)(508600001)(64756008)(66556008)(4326008)(6506007)(54906003)(107886003)(66446008)(33656002)(81973001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WzLwPL0Sbw8owKXRZqj/kPv9AoYyToglRG8+rU0pHc8yGGibhgFJ9OytKypZ?= =?us-ascii?Q?GwssPQcea4zDDEMmFuit9LDYf3pefavmOqKQt4b/OQSggVdt+npq+bkqWbzE?= =?us-ascii?Q?GaKffIthbIZjufx292DyWVWVSxRppmiBzND4/a1hz8HcSbcb1RNvIP8rzORV?= =?us-ascii?Q?y3l30PzhG6RHi0QQgs42y2FtY/cDOF62OlEMlAGm8VWLKR/VZnh3/PlUIbUo?= =?us-ascii?Q?GimcId3ivIFNQkrRdOdw8VYfzgTzTdUi/Xzbhim5JuhEsfWqoPrQcNATMPJu?= =?us-ascii?Q?d9PMItQXwENTaAZ+3iMh/eJqxT9OILXK1Ta/wHIRCpK3q0pTYWklj48Ub5Vn?= =?us-ascii?Q?nj3tZmf1MhAj/5Th48UPJoBNE6Fxd1F1SpYWodENS+neXZzbJjbPCPmGn8gX?= =?us-ascii?Q?pC3iThD1TsNdB2n9ptrH6CReFl2XsGoeKwF3PGQjcD41IQEHITVSExMW2akm?= =?us-ascii?Q?7b+8kIENfjuGfXenUuJHGZflP52IGofvs8TqptCyIR67YcuKmhnZqpQChk3a?= =?us-ascii?Q?vsPARPmqhntK4an79dI6ZXqXbI2EgNDCt1NibBWwOdOS5yiccPtRqbceDGus?= =?us-ascii?Q?4EEAGJStEo+5orGaqxr3KNIRZVQefwpF5WN4R30K86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xQwNtI8LwEOxsPqQI44GkTSeJyUnUN8SisujZkhpRhRzkJ0GuWx?= =?us-ascii?Q?3xtHPPDZZISBcw7BwWSJyH5bqFpn8Fkoxw6AD7pfYo3itkr0LyXVmPFiJ4lf?= =?us-ascii?Q?ahc8w7v9EKL4GnT0dHq5hLg=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4867.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 343383b3-3ee5-4b25-2256-08d996b6f31a X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2021 06:24:35.5390 (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: f+VuOoRcyx5USw8kx1GayGH+jxaBSjW+Eu7Hh3t5yeLgakK4EcaS0abYjVJKdV6fTt0hswmZkcYsdcy7iQ1SqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1791 Return-Path: benjamin.you@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Benjamin You > -----Original Message----- > From: Dong, Guo > Sent: Friday, October 22, 2021 11:46 PM > To: devel@edk2.groups.io > Cc: Dong, Guo ; Ni, Ray ; Ma, > Maurice ; You, Benjamin > Subject: [`edk2-devel][PATCH V3 0/8] Add SMM variable support for UEFI > payload >=20 > From: Guo Dong >=20 > V3: Add SMM communication region EFI_ALLOCATED check > in UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c > V2: Added SMM communication region size check > Fixed ECC reported issues and other minor update. >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3084 >=20 > Currently UEFI payload uses emulated variable driver. So it could > not support secureboot and measured boot since both need NV variable > support. >=20 > EDKII already has SMM modules and variable modules. And modern Intel > platform supports SPI flash hardware sequence to operate flash. So it > is possible to have a common SPI module for Intel platforms. >=20 > This patch enhances UEFI payload to support SMM variable with a > common SPI library for Intel platforms. To avoid impact existing > usage, all the new modules are included under SMM_ENABLE and > VARIABLE_SUPPORT and by default SMM variable is not be enabled. >=20 > SMM variable could be enabled only when UNIVERSAL_PAYLOAD is set > since non-universal payload need update ParseLib to provide SMM > variable related infromation which is not in the plan. >=20 > Signed-off-by: Guo Dong > Cc: Ray Ni > Cc: Maurice Ma > Cc: Benjamin You > Reviewed-by: Ray Ni > Reviewed-by: Benjamin You =20 > Guo Dong (8): > UefiPayloadPkg: Add a common SmmAccessDxe module > UefiPayloadPkg: Add a common SMM control Runtime DXE module > UefiPayloadPkg: Add bootloader SMM support module > UefiPayloadPkg: Add SpiFlashLib > UefiPayloadPkg: Add FlashDeviceLib > UefiPayloadPkg: Add a common FVB SMM module > UefiPayloadPkg: Add a SMM dispatch module > UefiPayloadPkg: Add SMM support and SMM variable support >=20 > UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c | 431 +++++++ > UefiPayloadPkg/BlSupportSmm/BlSupportSmm.h | 41 + > UefiPayloadPkg/BlSupportSmm/BlSupportSmm.inf | 49 + > UefiPayloadPkg/FvbRuntimeDxe/FvbInfo.c | 151 +++ > UefiPayloadPkg/FvbRuntimeDxe/FvbService.c | 1088 +++++++++++++++++ > UefiPayloadPkg/FvbRuntimeDxe/FvbService.h | 187 +++ > UefiPayloadPkg/FvbRuntimeDxe/FvbServiceSmm.c | 139 +++ > UefiPayloadPkg/FvbRuntimeDxe/FvbSmm.inf | 71 ++ > UefiPayloadPkg/FvbRuntimeDxe/FvbSmmCommon.h | 69 ++ > .../Include/Guid/NvVariableInfoGuid.h | 24 + > .../Include/Guid/SmmRegisterInfoGuid.h | 48 + > .../Include/Guid/SmmS3CommunicationInfoGuid.h | 54 + > .../Include/Guid/SpiFlashInfoGuid.h | 38 + > .../Include/Library/FlashDeviceLib.h | 108 ++ > UefiPayloadPkg/Include/Library/SpiFlashLib.h | 215 ++++ > .../Library/FlashDeviceLib/FlashDeviceLib.c | 165 +++ > .../Library/FlashDeviceLib/FlashDeviceLib.inf | 38 + > UefiPayloadPkg/Library/SpiFlashLib/PchSpi.c | 173 +++ > UefiPayloadPkg/Library/SpiFlashLib/RegsSpi.h | 129 ++ > .../Library/SpiFlashLib/SpiCommon.h | 208 ++++ > .../Library/SpiFlashLib/SpiFlashLib.c | 857 +++++++++++++ > .../Library/SpiFlashLib/SpiFlashLib.inf | 48 + > .../PchSmiDispatchSmm/PchSmiDispatchSmm.c | 455 +++++++ > .../PchSmiDispatchSmm/PchSmiDispatchSmm.h | 37 + > .../PchSmiDispatchSmm/PchSmiDispatchSmm.inf | 51 + > UefiPayloadPkg/SmmAccessDxe/SmmAccessDxe.c | 254 ++++ > UefiPayloadPkg/SmmAccessDxe/SmmAccessDxe.h | 37 + > UefiPayloadPkg/SmmAccessDxe/SmmAccessDxe.inf | 51 + > .../SmmControlRuntimeDxe.c | 256 ++++ > .../SmmControlRuntimeDxe.inf | 50 + > UefiPayloadPkg/UefiPayloadPkg.dec | 10 + > UefiPayloadPkg/UefiPayloadPkg.dsc | 101 +- > UefiPayloadPkg/UefiPayloadPkg.fdf | 38 +- > 33 files changed, 5660 insertions(+), 11 deletions(-) > create mode 100644 UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c > create mode 100644 UefiPayloadPkg/BlSupportSmm/BlSupportSmm.h > create mode 100644 UefiPayloadPkg/BlSupportSmm/BlSupportSmm.inf > create mode 100644 UefiPayloadPkg/FvbRuntimeDxe/FvbInfo.c > create mode 100644 UefiPayloadPkg/FvbRuntimeDxe/FvbService.c > create mode 100644 UefiPayloadPkg/FvbRuntimeDxe/FvbService.h > create mode 100644 UefiPayloadPkg/FvbRuntimeDxe/FvbServiceSmm.c > create mode 100644 UefiPayloadPkg/FvbRuntimeDxe/FvbSmm.inf > create mode 100644 UefiPayloadPkg/FvbRuntimeDxe/FvbSmmCommon.h > create mode 100644 UefiPayloadPkg/Include/Guid/NvVariableInfoGuid.h > create mode 100644 UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h > create mode 100644 > UefiPayloadPkg/Include/Guid/SmmS3CommunicationInfoGuid.h > create mode 100644 UefiPayloadPkg/Include/Guid/SpiFlashInfoGuid.h > create mode 100644 UefiPayloadPkg/Include/Library/FlashDeviceLib.h > create mode 100644 UefiPayloadPkg/Include/Library/SpiFlashLib.h > create mode 100644 UefiPayloadPkg/Library/FlashDeviceLib/FlashDeviceLib.= c > create mode 100644 UefiPayloadPkg/Library/FlashDeviceLib/FlashDeviceLib.= inf > create mode 100644 UefiPayloadPkg/Library/SpiFlashLib/PchSpi.c > create mode 100644 UefiPayloadPkg/Library/SpiFlashLib/RegsSpi.h > create mode 100644 UefiPayloadPkg/Library/SpiFlashLib/SpiCommon.h > create mode 100644 UefiPayloadPkg/Library/SpiFlashLib/SpiFlashLib.c > create mode 100644 UefiPayloadPkg/Library/SpiFlashLib/SpiFlashLib.inf > create mode 100644 > UefiPayloadPkg/PchSmiDispatchSmm/PchSmiDispatchSmm.c > create mode 100644 > UefiPayloadPkg/PchSmiDispatchSmm/PchSmiDispatchSmm.h > create mode 100644 > UefiPayloadPkg/PchSmiDispatchSmm/PchSmiDispatchSmm.inf > create mode 100644 UefiPayloadPkg/SmmAccessDxe/SmmAccessDxe.c > create mode 100644 UefiPayloadPkg/SmmAccessDxe/SmmAccessDxe.h > create mode 100644 UefiPayloadPkg/SmmAccessDxe/SmmAccessDxe.inf > create mode 100644 > UefiPayloadPkg/SmmControlRuntimeDxe/SmmControlRuntimeDxe.c > create mode 100644 > UefiPayloadPkg/SmmControlRuntimeDxe/SmmControlRuntimeDxe.inf >=20 > -- > 2.32.0.windows.2