From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 73A522277AF23 for ; Mon, 23 Apr 2018 01:44:46 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2018 01:44:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,317,1520924400"; d="scan'208";a="50012204" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 23 Apr 2018 01:44:45 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Apr 2018 01:44:45 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Apr 2018 01:44:45 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.6]) with mapi id 14.03.0319.002; Mon, 23 Apr 2018 16:44:44 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , Sean Brogan Thread-Topic: [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table Thread-Index: AQHT2tGPTs9i3sJ6DUa8pXBli9Y9eaQOCPnw Date: Mon, 23 Apr 2018 08:44:43 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AB79ADE@shsmsx102.ccr.corp.intel.com> References: <1524467142-25868-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1524467142-25868-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDNmMjIyNmYtNWQ5ZS00ZGRhLWE0ZTUtN2YzNzQ1ZGY5ZmQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJPNndCOU44TkFNeU5yV0tVcXk2XC9vRmFWZ2hQa3BJXC9vOG8zSFwvQ0ZqY0lsUHU1SVZYc01LalpWejA2YUV5aExWIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 08:44:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@Intel.com > -----Original Message----- > From: Zeng, Star > Sent: Monday, April 23, 2018 3:06 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen ; > Kinney, Michael D ; Sean Brogan > > Subject: [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESR= T > table >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D933 >=20 > We see UEFI spec is saying to use EfiBootServicesData for ESRT table. >=20 > UEFI 2.7 chapter 23.3: > The ESRT shall be stored in memory of type EfiBootServicesData. >=20 > And we see EsrtDxe is using AllocatePool for ESRT table, but > EsrtFmpDxe is using AllocateRuntimeZeroPool for ESRT table. >=20 > This patch updates code to use EfiBootServicesData for ESRT table > in EsrtFmpDxe. >=20 > Cc: Jiewen Yao > Cc: Michael D Kinney > Cc: Sean Brogan > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > index 3da4a62fb1c4..cc9dd63b53cd 100644 > --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > @@ -190,7 +190,7 @@ CreateEsrtEntry ( > } >=20 > NewSize =3D ((mTable->FwResourceCountMax + GROWTH_STEP) * sizeof > (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE); > - NewTable =3D AllocateRuntimeZeroPool (NewSize); > + NewTable =3D AllocateZeroPool (NewSize); > if (NewTable =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory larger > table for ESRT. \n")); > return EFI_OUT_OF_RESOURCES; > @@ -439,7 +439,7 @@ EsrtFmpEntryPoint ( > // > // Allocate Memory for table > // > - mTable =3D AllocateRuntimeZeroPool ( > + mTable =3D AllocateZeroPool ( > (GROWTH_STEP * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + > sizeof (EFI_SYSTEM_RESOURCE_TABLE) > ); > ASSERT (mTable !=3D NULL); > -- > 2.7.0.windows.1