From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 37DEA1A1E56 for ; Wed, 31 Aug 2016 18:11:19 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP; 31 Aug 2016 18:11:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,264,1470726000"; d="scan'208";a="3338516" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 31 Aug 2016 18:11:12 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 31 Aug 2016 18:11:10 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 31 Aug 2016 18:11:09 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.174]) with mapi id 14.03.0248.002; Thu, 1 Sep 2016 09:11:06 +0800 From: "Fan, Jeff" To: Laszlo Ersek , "Zeng, Star" , "edk2-devel@ml01.01.org" CC: "Kinney, Michael D" , "Justen, Jordan L" , "Tian, Feng" Thread-Topic: [edk2] [Patch v5 48/48] UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependency Thread-Index: AQHR7Jy4Gz8Pd1vRVUq8pvPSUJUViKBPEBCAgACPpPD//4MCAIAABX8AgAADOQCABxy8AIAAudsAgAANcACAACBagIAAbTsAgAAePICAAbZq0IAHuI2AgALTdgA= Date: Thu, 1 Sep 2016 01:11:04 +0000 Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4A1D8F62@shsmsx102.ccr.corp.intel.com> References: <1470128388-17960-1-git-send-email-jeff.fan@intel.com> <1470128388-17960-49-git-send-email-jeff.fan@intel.com> <4f61b2b4-eeb4-8435-412f-20848347c88e@redhat.com> <542CF652F8836A4AB8DBFAAD40ED192A143D9CFD@shsmsx102.ccr.corp.intel.com> <795dd4fe-cd16-c0f1-7f04-f78601e2c7a8@redhat.com> <82c6b5c9-dcab-f3c1-5ffe-20fb27ddb1af@intel.com> <6cd44902-8c07-8f76-1204-d79c85559ae5@intel.com> <7d39ce29-88ce-c5f2-af61-7fd964acb5c0@intel.com> <801f810c-4cd7-d657-f536-a8471a37802c@redhat.com> <8c9e77d3-14d2-4a92-2407-eb80cd255bb4@intel.com> <542CF652F8836A4AB8DBFAAD40ED192A143DEF4E@shsmsx102.ccr.corp.intel.com> <8373cabb-8bf5-bb9e-2377-e7b045b54c59@redhat.com> In-Reply-To: <8373cabb-8bf5-bb9e-2377-e7b045b54c59@redhat.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGIzMmU5ZjAtMzYxMi00NzJmLTk1YzEtMjkxM2I1YTc2NTc0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjVpMVRKU01cLzNNdlFsZzBGUDZNNm96ZCtTSnlCMEpKRnVIVzFhOGx4Y2p3PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch v5 48/48] UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 01:11:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Laszlo, UefiCpuPkg/PiSmmCpuDxeSmm driver and UefiCpuPkg/Library/SmmCpuFeatuersLib h= ave no such requirement on gEfiVariableArchProtocolGuid to access HII type= PCD. In fact, our platform SmmCpuFeaturesLib instance (linked by PiSmmCpuDxeSmm)= is trying to read HII type PCD. The correct solution is to add gEfiVariableArchProtocolGuid dependency in = platform SmmCpuFeaturesLib instance and this dependency will be inherited b= y PiSmmCpuDxeSmm driver. We will drop this patch #48 eventually. It has been reverted suggested by = you! :-) Thanks your support on it. Jeff -----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com]=20 Sent: Tuesday, August 30, 2016 9:46 PM To: Fan, Jeff; Zeng, Star; edk2-devel@ml01.01.org Cc: Kinney, Michael D; Justen, Jordan L; Tian, Feng Subject: Re: [edk2] [Patch v5 48/48] UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVar= iableArchProtocolGuid dependency On 08/25/16 10:00, Fan, Jeff wrote: > Laszlo, >=20 > After discussed with Star, I understood OVMF's circle dependency on Varia= ble Arch protocol and SMM CPU driver. >=20 > I will defer to check-in this patch till found the better solution. Thank you! > Before the proper fix adopted, our platforms might not set the HII types = dynamic PCDs used by PiSmmCpuDxeSmm driver. If I understand correctly, such dynamic PCDs are stored in UEFI variables, = which are in turn exposed via HII (forms). Based on "MdeModulePkg/Universal= /PCD/Dxe/Pcd.inf", point 2.3 (b). It seems to me that "Default Storage" vs. "Variable Storage" is only separa= ted in the platform DSC file; the declaration for the dynamic PCDs in quest= ion should be identical in the package DEC file. So maybe PiSmmCpuDxeSmm should only read the new dynamic PCDs, and if those= are expected to come from UEFI variables, then the platform could plug a N= ULL library instance into PiSmmCpuDxeSmm that "imbued" PiSmmCpuDxeSmm with a depex on gEfiVariableArchProtocolGuid. Alternatively, maybe SmmCpuPlatformHookLib could be extended with a new fun= ction (or functions) for querying these dynamic settings. OvmfPkg could pro= vide a library instance that returned constant defaults (or even dynamic PC= Ds, but without variable access). And UefiCpuPkg could provide a library in= stance with variable-backed PCDs, plus the depex. Thanks! Laszlo