From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.3701.1658458008287816485 for ; Thu, 21 Jul 2022 19:46:48 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=aq34VnKF; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: yi1.li@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658458008; x=1689994008; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HTiKJMtmCMMHZ5HNZwB04sZIfz7bXl0Y5uWM2NPyzxI=; b=aq34VnKFRHov+5vPuPyk4bbnBRbWPXPq9mBAUKmIV9PKmeeJab7Vm9Fr 0Hkm2fE3MS0xN+SSJuV0mJ2dZcpdDF3nVUyMk/rz0eBhg+/NwDoJeBtup Uq6GO/JncjDW68IWgFhaBKxa9nNnAbJey6fFT1W6EJgvnCimQ462mbv3g 2MFD+nr0kA7iLhWztSH9vtdXREMU/y7jZROa6pTqxZmn8rBc/y2EfWLUh zecunUNcyH0xL3+s7P9LjTCOIKTwsMxIl15eGDuzcEjEFId62OjzlGGvI bLQIi5B+w0p7uMaUe1EYBvSuAIVtorpwfNj6vZHd7MG9ei8G5rOVN/Cmi A==; X-IronPort-AV: E=McAfee;i="6400,9594,10415"; a="348924111" X-IronPort-AV: E=Sophos;i="5.93,184,1654585200"; d="scan'208";a="348924111" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2022 19:46:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,184,1654585200"; d="scan'208";a="688137012" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by FMSMGA003.fm.intel.com with ESMTP; 21 Jul 2022 19:46:47 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 19:46:47 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Thu, 21 Jul 2022 19:46:47 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 21 Jul 2022 19:46:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z3pMzmdK5ue+xjjRZJQbfIw8xR81QcuPvDEDXBtyWonSfFV3WBLnGg09Em3WpfYkWkhIxRQXs8d+6sobENOC1YzHEE3b+RYCVczCekfPooikWuO035aG8AMRaYAoPbjUIrUdtFE9s5S1EPnQGFd3yJ6mVqMbSu4vlyttUrA/dtX8JCATMCXLvMfjc4OnXdah7RV+SSeIb+NBu6yAtlhoksdNihjPrSehrrohTClw0VbJXQExLKCfC7d2ujtKrLxgrmYZ8xGlJlJxVKGuTDm/cV7MNpVXcjbncgnlNGd5SywI0qB3fIXur9YSiPZkROuF0aDSAhJnoCgbvisudbgJ4g== 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=zcXyHMQnCtL0j7XA0wz4I+Y7j0Nbv8RzPFAxWH+nwds=; b=gRmVOoWKr7KPIhbSrKkXkUFl+G1VgCfEIVQsjqFVMdNfwSCE/XQ6Y48EhAMF9ZUBYVy9aDRct7s9U8B3AFTgAZNQjyJFzr1jgI2O+oxTy53MDNzBVemgHWSAdStKh8O/LUPMibL6J/pKHpIe2k/C9QumP2QD7rvo1NCf3ZBvpzbcgxpN6LkGSdKSMW7XKUdI9/FrKKKs1/QdzKgT2WZ7U8wV3rXjN3DS5WN2rPV2XDw3Fpb8Na6oq+9LShFzmZMOCqST5Tuu4iA5Ukkfo59Wx25hP/LX754m7tR2MKZnZeYyAfmdiUGFYZTk3QYec7hFiNsJIN3CZM4kCKeBomAZDA== 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 Received: from SJ1PR11MB6227.namprd11.prod.outlook.com (2603:10b6:a03:45a::10) by MWHPR11MB1536.namprd11.prod.outlook.com (2603:10b6:301:b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.20; Fri, 22 Jul 2022 02:46:44 +0000 Received: from SJ1PR11MB6227.namprd11.prod.outlook.com ([fe80::3c1c:4489:16fe:750a]) by SJ1PR11MB6227.namprd11.prod.outlook.com ([fe80::3c1c:4489:16fe:750a%5]) with mapi id 15.20.5438.023; Fri, 22 Jul 2022 02:46:44 +0000 From: "yi1 li" To: "Chen, Christine" , "devel@edk2.groups.io" CC: "Feng, Bob C" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value Thread-Topic: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value Thread-Index: AQHYlOnctO9yvnCZH0+lr8yNTLMRra2Ju64AgAAAT7A= Date: Fri, 22 Jul 2022 02:46:43 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 22533fc4-23cd-451e-4477-08da6b8c69b8 x-ms-traffictypediagnostic: MWHPR11MB1536:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mloZbC7Ai00+xGrUMTXtuITPDDgysEGS1tWr8KQhTMNWDP4iAXs6UlxY4+ru1JOBwYEl90FhMijsoNkIMnntQrrqwL8vPcouoIW1W7lL3k9FXqg5MWAcO6G6QLPXZp6sbFwa20OGUJiFl0BsLhlfdkcxA7GGjK+VS8HLZ19Rvs7ie+bRDTz86Q79AIpHGcSw7m5TOYV3CaPaFfr7HD2Y7gtdjSRdm60aJUVVYYMxjvMP1JJ3tLU9cTJZDG3+Rn3zizJ7DM+oFif1J4LLfoQG28SGvUocy5BcnyWwzXdv+JePMgkuYSu0vygjZ+LfUoI2kvH16aChyE1XU2N7OiHqsWYSlf/2ntM6tjfxsBNFlgfEKgpiCHxMbfXTiLj0BYWfMwe1F4bHrCA6azKhynH/OOAIKLeldWSeAGFbGct6uqfpcUxOfADcG/qajjXqKvdUCrysqGuD0KgDhVXbmmIuoBnZUt9SjazPo1yYO4du+QOYo3yocYIxeBuC0x54fmpsX+q/smNZNDcLY0r0SDZZDB9FNJZforDPL9EtX0Jxr5W8BKqhMewCXqZaRZ3ZHI86W59sGUGS609kOMxDcy2PU930OtnhXHQyEd9uzuhuQKtXCoWi14XMG14A4z1/vtk3pRbm98nEOkzn/dqrdmXa1wJs4aQTV+8rx0yMT7R15cueI8ngD4X8wn2iqAPH1CtSwGsPdQ1Dj3xuU3Ns1zPX4sFYDzTmi59Yvx//ueGUVSFHSIFWXuRxz1eVDgflfFAdo9l527oQsOsit+g+DteQvUoz3pT2f7/ANHcI6agzr3N9lymWE5HqYoBLzjJYG0aneh1Pji/bOhw6MOw3Xu//IpfnlgMtmkP5bsOr4m+oreUh4vwKuO+9rFt2W0Q6rK0X x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ1PR11MB6227.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39860400002)(376002)(366004)(136003)(346002)(396003)(83380400001)(55016003)(186003)(66446008)(38070700005)(82960400001)(38100700002)(122000001)(76116006)(64756008)(66476007)(4326008)(8676002)(66946007)(66556008)(2906002)(316002)(33656002)(8936002)(5660300002)(53546011)(7696005)(6506007)(41300700001)(26005)(9686003)(54906003)(110136005)(52536014)(71200400001)(86362001)(966005)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ttkcseKHQSKJW379Nk12dQGaw+m5yv79WdPJHFd+YmG4NeJ55GfbmenB3qqE?= =?us-ascii?Q?kchVbl1kjqZs17iKVIHCnb3LX2vsJanAkDDTiVX2rX4NLec6nAmd+y3+f3PW?= =?us-ascii?Q?Idk67pYmQticfa/8BqimbbDWA3eHIoBIeepw/IzJov4lj7AYtSYKRLn0wlVO?= =?us-ascii?Q?Gyql85Fvg+eNO268YvIk7h4lQ7dUzs0HrAO2p3z6+5tjjs9DuS3tMPP0P/sO?= =?us-ascii?Q?OTjgXUe/0o692jUJ+nZnaKZ4ixea5mVPil2jQ14V9CrTeIBB4usOfN12F/PD?= =?us-ascii?Q?ZinL+kq+K+p4UCV0m+OboPIh8aFOCuQGmlzTZAvveOf8GEKmFy5cul9WZ5T8?= =?us-ascii?Q?WY8LUXPGMLOU4KnPTGhl8eLnUw1eJuJOrHIF2sRxAsW0zzBZjnr/1BSkCqu6?= =?us-ascii?Q?TaSv8OO5AuUYuxa9T872n/pq+e8S5Amo5ywohZYkzqXWFcS2ch/OR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nEfRxIu0atMpsvb31/wF+HNzLEgOP0TJD47HyW0yhX?= =?us-ascii?Q?wWj54BttP1fAPgLOh71ZWGSanKKj7QZ93Fct1C4B8jPHeFjd91H8QkQOgC11?= =?us-ascii?Q?umemZW+LGsI15B2XnFVqMhhWP545FSb3JSMZt5qsUHwANfFbjtwMbSmQB+nN?= =?us-ascii?Q?Hy0GHg8Rvw3BaDoAoKwgzjwRhyPN+3RzL4QwhpXtXZAjcE/QjQLrahlkLAzx?= =?us-ascii?Q?ra4AuQuHe10xWchb4NA=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ1PR11MB6227.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22533fc4-23cd-451e-4477-08da6b8c69b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jul 2022 02:46:43.9312 (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: RSkDTUa6UwEIXb+bIEmZFWdsFXnIWl9cvNEN1H6gLmDM4lZNI2I4G1S0cMnp3uL762OiUKPGqCCGQ2Qn+XWaKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1536 Return-Path: yi1.li@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Christine, Thanks for review, and this bug is come from commit : https://github.com/ti= anocore/edk2/commit/bf9230a9f3dde065c3c8b4175ccd32e44e8f0362 This commit introduce a new feature to conditional build source file in INF= , Such like: curve25519.c |*|*|*|gEfiCryptoPkgTokenSpaceGuid.PcdOpensslE= cEnabled The issue is : If FeatureFlagExpression is a PCD expression, not just PCD, e.g. (!gEfiTest= Guid.Pcd) ,(NOT gEfiTestGuid.Pcd) ..., Basetools can not calculate the correct value. The root-cause is INF now use default PCD value in DEC (self.Pcds[(Name, Gu= id)].DefaultValue) when calculating expression, If a PCD has be set in DSC (the new value will be stored in gPlatformFinalP= cds), we need to use the new value. Hope it's clear. -----Original Message----- From: Chen, Christine =20 Sent: Friday, July 22, 2022 10:29 AM To: devel@edk2.groups.io; Li, Yi1 Cc: Feng, Bob C ; Gao, Liming Subject: RE: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd = value instead of default value Hi Yi, Could you describe the bug with an example? In which scenario the dsc defin= ed pcd will not override the dec definition?=20 Thanks, Christine > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of yi1 li > Sent: Monday, July 11, 2022 1:48 PM > To: devel@edk2.groups.io > Cc: Li, Yi1 ; Feng, Bob C ;=20 > Gao, Liming > Subject: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd=20 > value instead of default value >=20 > This patch is a bug fix about FeatureFlagExpression in INF file: > INF [Source] section now unconditionally use Pcd default value in DEC = =20 > when handling FeatureFlagExpression, it is wrong. > If a Pcd value has been set in the DSC file, we should use latest =20 > value in DSC instead of default value. >=20 > Cc: Bob Feng > Cc: Liming Gao >=20 > Signed-off-by: Yi Li > --- > BaseTools/Source/Python/Workspace/InfBuildData.py | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py > b/BaseTools/Source/Python/Workspace/InfBuildData.py > index 5b9b3d7b4f..e4ff1c6686 100644 > --- a/BaseTools/Source/Python/Workspace/InfBuildData.py > +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py > @@ -1084,7 +1084,9 @@ class InfBuildData(ModuleBuildClassObject): > else: > for Name, Guid in self.Pcds: > if self.Pcds[(Name, Guid)].Type =3D=3D 'FeatureFlag' or= =20 > self.Pcds[(Name, Guid)].Type =3D=3D 'FixedAtBuild': > - Pcds['%s.%s' % (Guid, Name)] =3D self.Pcds[(Name, > Guid)].DefaultValue > + PcdFullName =3D '%s.%s' % (Guid, Name); > + if not PcdFullName in Pcds: > + Pcds[PcdFullName] =3D self.Pcds[(Name,=20 > + Guid)].DefaultValue > try: > Value =3D ValueExpression(Instance, Pcds)() > if Value =3D=3D True: > -- > 2.31.1.windows.1 >=20 >=20 >=20 >=20 >=20