From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.3751.1621307867401378340 for ; Mon, 17 May 2021 20:17:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=TEJIJ8qc; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: chasel.chiu@intel.com) IronPort-SDR: G9r3FVaBTGEJ9ebrJBooiBC+HAyF9pDa9OZD3kZgA/DEu6jHnX7q65O7s8VrmBizhiu3qqPtfh +McMRJNWDmCA== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="200669362" X-IronPort-AV: E=Sophos;i="5.82,309,1613462400"; d="scan'208";a="200669362" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 20:17:45 -0700 IronPort-SDR: HBoyApDsDV1VVzX0/wYV5Jm+kNnuLe/8fxX5EbEM5/fpVRElve+Jvw0auCUsqiO28Sjr1BfbWd qHBCkS/Hrtig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,309,1613462400"; d="scan'208";a="472718193" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP; 17 May 2021 20:17:45 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 17 May 2021 20:17:45 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 17 May 2021 20:17:44 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Mon, 17 May 2021 20:17:44 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Mon, 17 May 2021 20:17:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8iC6JOmOLdj/7FdDPde5/vZIeLVLM/ZWq/3Ptx9JqVe/kgNhidwE98RSoC7acG5A3BGHagc42sJ9bbgqwiKa7S90HN5ID4an6yJigjpe2lutr08A03ueOp+6q1ifn65VgiE65xypGpH9HthFI2pZWYcPwJmGdKs25S9DZ3UvraW85UuBYhbkKV57pYHRevoF3EqdKSyPuyGhG4oj02IKTFIHcUt+ehYtf+ZX3Cr20+KdUdfDZV2e+oKUWr8Dru5b74u9xS+yBpNz6ekIFGGL2OEjbHD8A4XV0c7Jl6hvgZp8Pdnz/6ROfD/hiX66aQAo4gN1WW4VcKPKqEW4/DGZg== 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=MbDVm4a9fincdfZohe6Zbn8lzrv1jnxPZi4ZEnZ6mRw=; b=a5mgux85qHx1OsvcFTdBo/9Y84ACofYjMmCHtjiyBGt+2LZdSV4anXE2BgaMpReXp39kDTtJztaYNFhF7JtKeye+HIVWv7z++KyN/5K/sYkKUcvD5ObzolfVp4zEJQcvY0P+Bgv0u+9NkYTJnCtnPA9/j+1e67LBX8vj9ag/mqjx+bXdcRMtopbBYmG5sCpjqIYOsa7r3X4NrcYvOVVCt9jSiFELJwdjjtkF7FsJmFMLokuD/TI1lHv0rI3+zZDrp9zt7VQ7huZeuC/7dgNc+ozW+33rDmspLj6y9XNVt7vccWcYOGUjNEGY8Vg9g2XaTzZ/2/LZ3CmF7+YVvwlH/Q== 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=MbDVm4a9fincdfZohe6Zbn8lzrv1jnxPZi4ZEnZ6mRw=; b=TEJIJ8qcdvB8bbE9DCL+oTRgw/menWEzPMlQXVgP1o4/3mZHn0F9DQfiGkCGJRjQUGWaKyGQajo+wQtzHRRMvnMwMjr/KnX3yl8z/x7G6NToxa3oZM1qBU5ty6YjFgLaWgL4ArWbbC9IsNU6kjmXwpnnnhqKr4LfxlNfP1PHGy8= Received: from SN6PR11MB2814.namprd11.prod.outlook.com (2603:10b6:805:55::15) by SN6PR11MB3503.namprd11.prod.outlook.com (2603:10b6:805:ce::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Tue, 18 May 2021 03:17:43 +0000 Received: from SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::6157:b65c:53b6:a320]) by SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::6157:b65c:53b6:a320%6]) with mapi id 15.20.4129.031; Tue, 18 May 2021 03:17:43 +0000 From: "Chiu, Chasel" To: "Loo, Tung Lun" , "devel@edk2.groups.io" CC: "Ma, Maurice" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH v3] IntelFsp2Pkg: YAML script bug fix Thread-Topic: [PATCH v3] IntelFsp2Pkg: YAML script bug fix Thread-Index: AQHXStG82JZpqOiEzUa1dqyY/DHL96rokwUQ Date: Tue, 18 May 2021 03:17:43 +0000 Message-ID: References: <20210517040413.1025-1-tung.lun.loo@intel.com> In-Reply-To: <20210517040413.1025-1-tung.lun.loo@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.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [114.43.28.163] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3b032f7b-a9aa-4bad-ffc1-08d919ab8073 x-ms-traffictypediagnostic: SN6PR11MB3503: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1824; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0e1kIFDO9HzSgdT9cAYXkMq+aAfvnPajHFV2R+Rcn550/N9uagZ2HQw5kBC5MmcWL0DC1taSsRI2ihMObgQTE9fKGRMyoLJA2zYX8RpRhU/LVPobACjIcRAJxaf+9/JWCiqA61pbGMyx5mvKHb8ZxczxgmdyWrkz5TuqUunSNcOsuiaWUroHOdNRFtn3tRxdVRge6K5iF7xpr9hq+gW4soU5UNaz2QZUMCkZg6btnUsYB5cBjwC4fm3v8FSEMuhfzQLj6PRm3AnTWmh1snd/39ZmUSfMf6IJsqC9YMnIEstmW0xdXIIcf6GiasU1b7maT2Ojv5+TLXgmOatX8Z2xfLqBCbyjTJtLSpncG5GA8g/q8dJ+kGxqAhBnaX8TdWQzd6OoCbFtvmi0zSoa52bDDMH1OkOekoaEq+evGjtuzY0AUOPoRVwgm+DhFGaTxrDl1enkRigEjox6FM/fXA8qAOMbLPbDD+/jDeT1lnQrhWMUu0YJ7oCYnCC1c8I5GTqoWgb8NHsPAjfWvLGuYDEZCQxGhs3LaMLN2YyrhIGPV4zRrwMcuAS9LcoO5VEk4k4ILJpZAoOJzPSS64ZXThnUMyVmf4w5hcHfP98BClv4ziDiZfUHiqDsUb6zis2ZDUBk2n4nTRB79oOtJxx82eUJPVWUUpH7oOHDvQ7ogB/7cSThQ91oFDF/CTBZ8hkfJ8ASzqXvmNHbtFi9IaEZD4iSL2lXxWJdavwLnOalUfQe4U4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2814.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(396003)(39860400002)(136003)(346002)(376002)(316002)(26005)(54906003)(71200400001)(86362001)(478600001)(110136005)(66946007)(7696005)(38100700002)(122000001)(8676002)(9686003)(19627235002)(33656002)(107886003)(8936002)(66476007)(66446008)(64756008)(53546011)(55016002)(186003)(6506007)(83380400001)(52536014)(2906002)(5660300002)(4326008)(66556008)(76116006)(11716005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?CzCgITtT9W3lbS/nJndDZUDx92yBVJM3VKIDjuAJvubQ0E9FdOzR9TYEMU6w?= =?us-ascii?Q?uaFRse+jCupaMQHTNY3NazWGB9uYrlcBosAXF3TcCpG0r+Y+ip6Vb5t5Hr2+?= =?us-ascii?Q?ICfYZWEZqx87BUTv6cruAFegUUUS/V9VwACdsBhLQ/vCpyIKD3P93hkTYZge?= =?us-ascii?Q?J7741pTzrPlMIj76mhHeSXwniZYaiZ694PtJKcsG63MXEBJCY4Qi5ucMjUoO?= =?us-ascii?Q?96ev82JCL5PplKIXRdF8MLfldLG619KcmmmGl/bq1GoJsAa5mH6dHk5mhv+J?= =?us-ascii?Q?PDW5YWWc+F6BIMt/EyJ5wt6OhNs2A1yvt6yLYbErfV5/pYqMJb8AYnhUVy1M?= =?us-ascii?Q?f+j/W8MY5tRcAnz4geFiajRip7iHP5aMzKkz7cb7yGK07MSGq/ioSLZl54zs?= =?us-ascii?Q?XPwQ0VqCbVLJ83TIGyyGJ9TPautxKfypfvG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pmroLUOG/oPqoOQGLJNG?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2814.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b032f7b-a9aa-4bad-ffc1-08d919ab8073 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 May 2021 03:17:43.3394 (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: J/Fq6e1v2AaCDxpIIJ12DQxXNWttWAsv0IQjiBQqHCGuZzae2KTfDrhq4v0RCYoZyzYWi+tIVffkFITYiCaGag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3503 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed: 1fbf5e30ae8eb725f4e10984f7b0a208f78abbd0 Thanks, Chasel > -----Original Message----- > From: Loo, Tung Lun > Sent: Monday, May 17, 2021 12:04 PM > To: devel@edk2.groups.io > Cc: Loo, Tung Lun ; Ma, Maurice > ; Desimone, Nathaniel L > ; Zeng, Star ; Chiu, > Chasel > Subject: [PATCH v3] IntelFsp2Pkg: YAML script bug fix >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3395 >=20 > This patch fixes the issue observed during BSF file to YAML file conversi= on. It > also addresses the issue during multibyte array data conversion check, fo= r > example the data representation of 0xFFFF instead of 0xFF, 0xFF would be > thrown exception "Array size is not proper" without this patch. >=20 > Cc: Maurice Ma > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Chasel Chiu > Signed-off-by: Loo Tung Lun > --- > IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py | 11 +++++++++-- > IntelFsp2Pkg/Tools/GenCfgOpt.py | 3 ++- > 2 files changed, 11 insertions(+), 3 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py > b/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py > index cad9b60e73..d2ca7145ae 100644 > --- a/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py > +++ b/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py > @@ -46,6 +46,13 @@ def Bytes2Val(Bytes): > return reduce(lambda x, y: (x << 8) | y, Bytes[::-1]) +def Str2Byte= s(Value, > Blen):+ Result =3D bytearray(Value[1:-1], 'utf-8') # Excluding quotes= + if > len(Result) < Blen:+ Result.extend(b'\x00' * (Blen - len(Result)))= + return > Result++ class CFspBsf2Dsc: def __init__(self, bsf_file):@@ -108,7 += 115,8 > @@ class CFspBsf2Dsc: > cfg_item['find'] =3D prefix cfg_item['cn= ame'] =3D 'Signature' > cfg_item['length'] =3D len(finds[0][1])- cfg_item['value']= =3D '0x%X' % > Bytes2Val(finds[0][1].encode('UTF-8'))+ str2byte =3D Str2B= ytes("'" + > finds[0][1] + "'", len(finds[0][1]))+ cfg_item['value'] = =3D '0x%X' % > Bytes2Val(str2byte) cfg_list.append(dict(cfg_item)) = cfg_item =3D > dict(cfg_temp) find_list.pop(0)@@ -291,7 +299,6 @@ class > CFspDsc2Yaml(): > raise Exception('DSC variable creation error !') = else: raise > Exception('Unsupported file "%s" !' % file_name)- > gen_cfg_data.UpdateDefaultValue() self.gen_cfg_data =3D gen_cfg_d= ata > def print_dsc_line(self):diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py > b/IntelFsp2Pkg/Tools/GenCfgOpt.py > index 660824b740..714b2d8b1a 100644 > --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py > +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py > @@ -708,7 +708,8 @@ EndList > for Page in PageList: = Page =3D Page.strip() > Match =3D re.match("(\w+):\"(.+)\"", Page)- > self._CfgPageDict[Match.group(1)] =3D Match.group(2)+ = if > Match !=3D None:+ self._CfgPageDict[Ma= tch.group(1)] =3D > Match.group(2) Match =3D > re.match("(?:^|.+\s+)BLOCK:{NAME:\"(.+)\"\s*,\s*VER:\"(.+)\"\s*}", Remain= ing) > if Match:-- > 2.28.0.windows.1