From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 362FA21A00AC2 for ; Fri, 23 Jun 2017 05:04:22 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 23 Jun 2017 05:05:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,377,1493708400"; d="scan'208,217";a="118454222" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 23 Jun 2017 05:05:47 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 23 Jun 2017 05:05:47 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 23 Jun 2017 05:05:47 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.197]) with mapi id 14.03.0319.002; Fri, 23 Jun 2017 20:05:45 +0800 From: "Gao, Liming" To: "edk2-devel@lists.01.org" Thread-Topic: [RFC] Collect DynamicHii PCD value in Platform.dsc file as the default setting for EFI variable and EFI VarStore Thread-Index: AdLgJ4bR3atRtjGEQ2CP1WZomF2hkQDwRwPA Date: Fri, 23 Jun 2017 12:05:44 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D74E0C9@shsmsx102.ccr.corp.intel.com> References: <4A89E2EF3DFEDB4C8BFDE51014F606A14D74816B@shsmsx102.ccr.corp.intel.com> In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14D74816B@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: [RFC] Collect DynamicHii PCD value in Platform.dsc file as the default setting for EFI variable and EFI VarStore X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2017 12:04:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Requirement: In current working model, to change the default setting in HII VarStore, VF= R source files have to be modified. There is no platform override way. This= requirement is to move such configure setting to platform DSC, and provide= the centralized setting in platform DSC. The idea is to use DynamicHii PCD= setting in Platform DSC file as the EFI Variable and HII EFI VarStore defa= ult setting, because DynamicHii PCD has specified the relationship between = PCD and EFI variable. Dependency: 1) [RFC] StructuredPcd Value assignment in DEC/DSC 2) [RFC] VFR BIT and UNION extension in Varstore structure Proposal with below 4 changes: 1. Extend PcdsDynamicHii section in DSC file with DefaultStoreName. D= efaultStore is UEFI HII Default ID. New [DefaultStores] section is introduc= ed to list the map between DefaultStore name and DefaultId value. PcdsDynam= icHii can specify the default settings for the different DefaultStore. If D= efaultStoreName is not specified, the setting will target for Standard defa= ult. Default Store setting is specified for HII EFI VarStore. They will not= be built into PCD data base except for Standard default. Example in DSC file that PcdSetupConOutBuffer value will be used as= SetupConsoleConfig variable and HII EFI varstore: [DefaultStores] 0 | Standard # UEFI Standard default 1 | Manufacturing # UEFI Manufacturing default [PcdsDynamicHii.common.DEFAULT] [PcdsDynamicHii.common.DEFAULT.Standard] gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutBuffer|L"SetupConsoleConfig"|g= EfiNt32PkgTokenSpaceGuid|0x0|{0xFF}|NV,BS gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutBuffer.Column|80 gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutBuffer.Row|25 2. Introduce new PCD VOID* PcdNvStoreDefaultValueBuffer to store the = default setting in MdeModulePkg a. PcdNvStoreDefaultValueBuffer value is auto generated by build. Bas= eTools will collect PCD default settings in all PcdsDynamicHii section, and= save them as the normal variable storage format, then assign it to PcdNvSt= oreDefaultValueBuffer. b. PcdNvStoreDefaultValueBuffer value will include the default setting= for each SkuId and DefaultId. The default setting for SkuId 0 and Defaultd= 0 is stored as the whole copy. Other default setting are stored as the del= ta compared to the full setting. This way can save its buffer size. c. PcdNvStoreDefaultValueBuffer must be configured as DynamicExVPD in= platform DSC, and be placed into VPD region. Then, it can be kept as the r= ead only data in BIOS image. 3. Introduce new PCD UINT16 PcdSetNvStoreDefaultId to enable the defa= ult variable setting in MdeModulePkg a. PcdSetNvStoreDefaultId is configured as DynamicDefault. Its value = is the default store ID value. The default value is zero as Standard defaul= t. b. Once PcdSetNvStoreDefaultId is set, PcdPeim will read the matched d= efault setting from PcdNvStoreDefaultValueBuffer, and build the variable ho= b to store the default EFI variable settings with the normal variable stora= ge format (gEfiVariableGuid). c. PlatformPei must SetSkuId() first, then set PcdSetNvStoreDefaultI= d. Otherwise, the default variable setting may not be matched. d. If the matched VariableHob is found, Variable RuntimeDxe driver wil= l consume VariableHob and write them into NV region. This logic is ready no= w. The enhancement is to support the variable hob with gEfiVariableGuid eve= n if AuthVariable is used. 4. Enhance HiiDataBaseDxe to consume PcdNvStoreDefaultValueBuffer to = get the default setting and patch IFR default setting in the installed HII = packages. a. The patched HII package lists will be applied when Reset to defaul= t is trigged in UI page after ReadyToBoot b. Report System Configuration table with the patched HII package list= s at ReadyToBoot c. ExportPackageLists() API reports the patched HII package lists bas= ed on current SkuId Thanks Liming