From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web09.3292.1641878731806282898 for ; Mon, 10 Jan 2022 21:25:32 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Ts4S/3Cb; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: bob.c.feng@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641878731; x=1673414731; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Xwgg6roMunXvlppj6Fl9nEgFmgnLmZKYboKLDYV2StY=; b=Ts4S/3Cbx3rGjFzT2RFeCGv3EmhqUtwS/SiCNPu9ZyePZIP50j9Wn/CF gZZe2M188NERg7Xw8JxPMUP/MXvddBf7xF6vxuTUbJtDKFSZENCLZBzKD QXOJtrTPN6KtjB0P0+JJTU3AMhGvoufQEPZA62tRWsRcbBshTuFACWHh2 TcRvvqmznOCFJjcANo69PHhkxq9wTkt6F1XIfg09m+M7d2EVyXtPxpJel 5Q55F/cmZayAACU5/MPsKHrEUxror7o2CAYb0UkmsgWJhVOUtDTUknvir moxvE/ny32P5Q/cLtSn+hxXNET8ZGdKPP+qI/q5sVohPmmsLtjP65Mh/Y g==; X-IronPort-AV: E=McAfee;i="6200,9189,10223"; a="306758348" X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="306758348" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2022 21:25:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="622940380" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga004.jf.intel.com with ESMTP; 10 Jan 2022 21:25:30 -0800 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.2308.20; Mon, 10 Jan 2022 21:25:30 -0800 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.2308.20 via Frontend Transport; Mon, 10 Jan 2022 21:25:30 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) 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.20; Mon, 10 Jan 2022 21:25:30 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hGXZ+RE97T3atrCkZTKOSrZ5u+9YLhOzCGcw42qEsu1jO84kneUCUezVt8Cke+dROWwQts2TRCnnnYVxh+nCWgLBlzndbK1L1Q4VRrHRmQPKOLR0XPt7+IFvpOuqfSgsjf9gVFuIlqI1EDh4fDSooMk3B9B1h7M0XxEwa6VW1JozEHgbSPbGK0v16byE7/tz1znZ79G7krh0OCfdMHu/G9jKj21qfGZi0rsC7BKtq/99+3T6HN+vSxixRp5WTrPmUGD1hmlrYpzk6fl6rvzaRfWyqtm4AEl2vI9the8J0rhYRjxAsB3UiVWJrRPxhNjUbOrZelV7hQsBh4UyczPQGw== 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=sbwXDjW0dgJBd4mQWNyvx7K4Hf36Dq6smafQ7R1EbUI=; b=DzdBA4++NTsTk5bEzAH4wkKN/6X04XAAZe/2zAMEZdcDWCzbM7Kwb8Y8lNnQ1bVgyhUd88BiouT7BP+yN2EH+BrfviJuwDFW755XZtG7ALkS8RhxJM6RNxL9qk5UftyrxP3y8gxjvD2Qj7yZPOkFgx9EbAvwL9l9dEoHCBhLsG1DshORSuVLFJk87GHS9hENDRTiHsiQIsfBJYwpad4/KdKxoFsosQfzhoLG9khlG+nGFxtjMb3pNZeJunFMYUPtX3PTQbUmy0hPs3Fhs7vpZ746XYZQQVR0kqIhJ7XD3FygAv32BuwCwvY/DFGeKZ5dlJgMfCuTF/5tMYPRQ6R08g== 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 PH7PR11MB5863.namprd11.prod.outlook.com (2603:10b6:510:135::11) by PH0PR11MB5048.namprd11.prod.outlook.com (2603:10b6:510:3d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Tue, 11 Jan 2022 05:25:28 +0000 Received: from PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::3593:10ef:94ba:830]) by PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::3593:10ef:94ba:830%7]) with mapi id 15.20.4867.011; Tue, 11 Jan 2022 05:25:28 +0000 From: "Bob Feng" To: "Chen, Lin Z" , "Gao, Liming" , "Chen, Christine" , "devel@edk2.groups.io" CC: "Li, Zhuangzhi" , "Zhang, Di" Subject: Re: [PATCH] BaseTools: Fix wrong variable header size Thread-Topic: [PATCH] BaseTools: Fix wrong variable header size Thread-Index: AQHYBqeNs44JpSZ8N0OM///HiyI6LqxdSfiw Date: Tue, 11 Jan 2022 05:25:28 +0000 Message-ID: References: <5e26f08910b67c693d37fd843fd32e429c6d2401.1641876123.git.lin.z.chen@intel.com> In-Reply-To: <5e26f08910b67c693d37fd843fd32e429c6d2401.1641876123.git.lin.z.chen@intel.com> Accept-Language: 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: e7cddcb8-f00e-402e-d188-08d9d4c2c75a x-ms-traffictypediagnostic: PH0PR11MB5048:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:168; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KxkHx7QnBM+/gFJD7Wsq0hdfF8wt/HMh+Gbl2QGDqsGWEhpscPKDN1rEZ1RZY+NpIDYxNIY7m3lvpPECUnKkGT9NO3WLMY3rVi2/a96Meunqrja1q/Vybl1bUJeVQjqhJb0th3WlHmYgHsQ+XBZTXGwWWL76wWaerXJDglhMpA6WnmkDC8jZxpKzABeA7sjSTA7NQAtEehwyEle9IPvAmx/+Szqel82eoqY+eBdQW3Fhzkw4oOJ0k73idD70h/V8psfpX0fSBNCncfZz/K40OzIE7H89S1XAkgF63azCbiSqmHg8pI7bggfXgamaMP1wbDd80qw+hWvHQM8bng86UW4RXoVf08fJTX1jJetRk3L/Gd0lK/CHvpc1a1jfhdfV97JxdauTei1RB+1kwHDgRc5mlP+Qqbps8aeOEe0yi6fdVxyXI/AUnNqe1vRE6wT8IFkA7RC8taccV1f8uZ9sEsc+e3mKBcDa62L0Wp2wc8Eps4kiULlN3322ZUcIfw3RfgvzoyHk+W6cKH1AkVuoVFp0IydfMLAQuFq2wyaKL+rBp2ZCUuWMDDwhk0y7IugrMLeRfbrqaNx6QNc02jSZ1w7Hs7lZ0o/1LcMGNdzZu3cEK3trPFpKWNjjkLNu8MjlDs+colQC9i94+mLdvW3qgv0CvskFg1o98Ng8Yzrg6VBznFBm5RJTLhMUpSyCOrOgUDteoy1dgyXDfIPF8wmULQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB5863.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(52536014)(83380400001)(33656002)(38100700002)(38070700005)(55016003)(5660300002)(2906002)(26005)(82960400001)(9686003)(8936002)(54906003)(107886003)(7696005)(86362001)(110136005)(8676002)(71200400001)(508600001)(186003)(66556008)(66946007)(64756008)(66476007)(66446008)(53546011)(6506007)(76116006)(4326008)(122000001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JrzGEv1KKrcdrHQhnC2nyF7jluoHO1VL3+tI0T3rGd1Ty+17BIBgauY44iUa?= =?us-ascii?Q?i7fo3D40aL/pSh5CYnjnBMKII5yQro1HkOb6kmm2SGBk1/Q2naFKek0DI5FU?= =?us-ascii?Q?iCXiTx0CZY+Z9tZuQJcrhuwIM29hMODUCw9keAnjHXSIQjZxIrUz90jNNDz5?= =?us-ascii?Q?rkna7QXAQYHqt3doqiwk5J5Gbm/EhN2ISIfU+WLDa/0LnN6gWEv3y5gwLTKs?= =?us-ascii?Q?F2J3mdL5waz8O/qjREL9RC55qV6BadRpcBENADl3yGzN6Ru5/q0AiXAloiD7?= =?us-ascii?Q?GRrJf7Z94mVIzTSowtDmORiyu41CFP+Id9p7Rz+8b6qFd29fFzrkl69LHTNs?= =?us-ascii?Q?Ed5k0qw/1ELr2Zv619QzJ8yKvUBBYqrHLxgbrGgQYKSEEwXTItWNKmE0Ocsh?= =?us-ascii?Q?fueuHGT6cAhVkvzudl/kglE/NPxdqCio4iS6MVGg8OqfVTRkCyvH4RjMtipW?= =?us-ascii?Q?PAg/TCcreKoRilMPakgXB5xP6/0PqdcCXWhYrgQNAjyWxNmggK9v9LPggPVi?= =?us-ascii?Q?KkR3PHUYQWeXFA/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n?= =?us-ascii?Q?DA/yUKK5n8emHI/iS1iguLpOZFXq/VtsLfmFuumkc+QcfTFFu82PKfIKaazY?= =?us-ascii?Q?lDyUpZjM1BqXFAyQkL1ITUBNt6115qEWhu8uBBPEdEMMuOTZe305zZtANAQ9?= =?us-ascii?Q?DxPe9t4aKaoPhqqf8F+kTTTUYFKIshEnMPfjkRHLkrHbjmwXPLmgA4oYNKE9?= =?us-ascii?Q?cR9NrZi9Dcg0Z57VK1jYBdE=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5863.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7cddcb8-f00e-402e-d188-08d9d4c2c75a X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2022 05:25:28.1591 (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: cCNMFXhRkUEi8LSxx4bULTha4VblaIFI/uza9jZ+0X7yni55iXUgZQKN1wEB5OAdcDdKdb5NBWiRlTO9ltzS9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5048 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is good to me. Reviewed-by: Bob Feng -----Original Message----- From: Chen, Lin Z =20 Sent: Tuesday, January 11, 2022 12:58 PM To: Feng, Bob C ; Gao, Liming ; Chen, Christine ; devel@edk2.groups.io Cc: Li, Zhuangzhi ; Zhang, Di ;= Chen, Lin Z ; Chen Subject: [PATCH] BaseTools: Fix wrong variable header size There are two type variable header and their size are different, need to us= e matched size when calculating offset info, otherwise it'll destroy other = variables content when patching. Signed-off-by: Chen, Lin Z --- BaseTools/Source/Python/AutoGen/GenVar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index 3f3dc69e90..f2ad54ba63 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -20,6 +20,7 @@ import Common.GlobalData as GlobalData var_info =3D collections.namedtuple("uefi_var", "pcdindex,pcdname,defaults= toragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default= _value, default_value, data_type,PcdDscLine,StructurePcd") NvStorageHeaderS= ize =3D 28 VariableHeaderSize =3D 32+AuthenticatedVariableHeaderSize =3D 60= class VariableMgr(object): def __init__(self, DefaultStoreMap, SkuIdM= ap):@@ -171,7 +172,10 @@ class VariableMgr(object): DataBuffer =3D VariableMgr.AlignData(var_name_buffer + default= _data) data_size =3D len(DataBuffer)- offset +=3D V= ariableHeaderSize + len(default_info.var_name.split(","))+ if Gl= obalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE= _STORE,"FALSE").upper() =3D=3D "TRUE":+ offset +=3D Authenti= catedVariableHeaderSize + len(default_info.var_name.split(","))+ = else:+ offset +=3D VariableHeaderSize + len(default_info.va= r_name.split(",")) var_data_offset[default_info.pcdindex] =3D o= ffset offset +=3D data_size - len(default_info.var_name.split("= ,")) if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_= AUTHENTICATED_VARIABLE_STORE,"FALSE").upper() =3D=3D "TRUE":--=20 2.26.2.windows.1