From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.4005.1659493595134496006 for ; Tue, 02 Aug 2022 19:26:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PSCE82OY; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659493595; x=1691029595; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=YtagXnTNdbSxikoI1qpkB8IW3atRTOJnpECfIaQmJpU=; b=PSCE82OYWOXcXcFIt1XLRyFTseG6kwhkKcOeywCrIlAGTx6cWe1CMToT YVx4yvMdJ00r8J4aOEOpiJebXzeagof+0BIFMYyeBrz8p8bWBhneEDHX8 v2WSOD02/uZPbaTIBZ4mkQmGdlamYi1c8oesZ/IJ9hqFQiaoKyRpV2nvd AQkTzxx9Ri09+Kmh75ho8j6K7C1drlMbHJwTcL5JK4B7rNALfhTpP+bDj CaGvKYw9fba0FI5YqJTHPP4cMhwfrDV0fQ2GRFKVAt1Oi+nXFtWR+lmig yRDewMDiHtnnznwIo+/e67/WqifTna8enxot+F0uIT178zi/say93bIiA Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10427"; a="375864717" X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208";a="375864717" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 19:26:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208";a="744894414" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 02 Aug 2022 19:26:34 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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; Tue, 2 Aug 2022 19:26:33 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 2 Aug 2022 19:26:33 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Tue, 2 Aug 2022 19:26:33 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) 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.2375.28; Tue, 2 Aug 2022 19:26:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZKoHwvJ84tD3MxelIZYOCGUd+45ybuDQkQ0uyH6YccgloP37HqGSSHSKNkLaotI2W/+rZJwDCDRTaNvowtjGEPQ2OL2MJ4+TWgnfYhPn0s8tZvSO7Mco2L+rM6p62ylCQkhvgNOjWgsjl8b6VyX+NSGnM/+nrnHheF3sqxjaiIWQCkhkhLdt7v4nQ8ZlKodlhtWHXPIgVjN9aKN5lYal/Bh/j7rGTSOFc5nRZjs6CrilOo8/k8gy+hhgZMDDxAkgk0zYzAT/HyqDD4S7drVNO0N4agn/hwX05LwDwIaMV4R6PagVTUNYPR5Hz4arGwVYoETE7IrMgNN9VQq7+l2HFg== 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=EgT7H7MMDVnj4n0IUDqRD5+O3mj+Ocpl0wJNmt9WfAE=; b=FuAN6BON6cJECVLU67wtZIJxcHedAx3c4V3NafwqzMa4Ha/Fsg7hGQexvU6xgNP35u/GFZPR53TKQWPSNS30+RU9tYiCuiW3Rg2Fg4rtR389ZrKbubjc7/5AvXt0Bn0Cs1OvDu1Wdv6lvI7lIyFKRr+XvT8pYWOAveTjyk4Rbd/CvlCOnpnmEl1PazJIncUegkYwFUAU/1PGCMSsIYVjY4IB0maSCqUojPV3SW1HhIN7DVBMGaRNGdhGWhAEInmu22Bhq7p+DuwFRxBSGlak6ydxnPoZkV11TFMLUji8MSnlL2GP/ez6BR/MBCwadc2rqY/SZlatZfm8EOIEmY8soQ== 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 PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by BYAPR11MB3349.namprd11.prod.outlook.com (2603:10b6:a03:1c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12; Wed, 3 Aug 2022 02:26:31 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::61e0:6297:8d54:672e]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::61e0:6297:8d54:672e%3]) with mapi id 15.20.5482.006; Wed, 3 Aug 2022 02:26:31 +0000 From: "Min Xu" To: "devel@edk2.groups.io" , Leif Lindholm , Ard Biesheuvel , "Chang, Abner" , "Schaefer, Daniel" CC: Gerd Hoffmann , "Xu, Min M" Subject: Re: [PATCH V2 3/8] EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib Thread-Topic: [PATCH V2 3/8] EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib Thread-Index: AQHYiQm7d4kD/ASyAkGoIEXhEsvJeK2HGFSwgBWVbOA= Date: Wed, 3 Aug 2022 02:26:30 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 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: 5765a452-eed7-4055-68ac-08da74f793b4 x-ms-traffictypediagnostic: BYAPR11MB3349: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: sb0/vdX6/WlYJslWkfMRz4a9Kq6LKxK9auSV6d3b6V/OJiMDEXBEgxzJvr3ZwsPfPW4ICkRk+VSF9Tq8/1dpOhaat1BYaZfv7NzVLRsexmFBZujcFX9a14zxk5ZbjWAURUpi8hHCBkcOzgqbiqRHkZYz/u2EmW9Nq3xDuHAc8uN+kBp+ml75UldJDiWI2o4kyvT4KR6fKNTMX1XPRuoYKlQ9ISbz8Dsw6VWoHIKMNLtCc3UAqNf/2uxGhFuP0zaUte4mQ2AVtLyo3en4EqizoH56ZwpvHCIMtnk9dr4Gm9+TBJXdYgLDUd8ftWVpYtstMCh7qgs7exnn1/RIbLrtDpdCOVguvpZsOe1defVh4/rOfmKKg9yDCv/W16U+mDxuThyftlXRqPGrXFmQAkXhe9vGhJOed8kvXEzUxtDWhP7yhuaE85h6RBD86RouJ3nybRACIVBOrTeLyLmELhjYbdefyRqLPQp13RyZrc1uFhgql7lgyjTUo5D1/Y+O4btYlkFPGN/13nX/aQum4ZK1NkH9tEl7Nwlsk7L/DngO0omHMj3zaM0LA49M9ufEKq6bKwvXNQmx1Dg1mwUPKQFke1CMYqVXyZdhcBRqdy15+Q18WqbaXZcyzsTU5wVkwh72JLsbDm/AYnzKlg3DciY+yFBvDA9ESD0h2yrGfl2N2uvNGTnWY6yp0aL3a5V89gD/Sq1W+x404cXo5RUAY675TaevEuej6GUPRj5GFnRVW51uODLRe3eOuUHeTqEdTDB7WGuyQILjzQoCyqVcrfYkogShrEY+GqLTzxxH0uYtwoZ5U2v+wKard2TG47sNADrv x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5064.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(6029001)(39860400002)(366004)(346002)(396003)(136003)(376002)(107886003)(64756008)(66476007)(66446008)(8676002)(9686003)(66556008)(4326008)(86362001)(5660300002)(38070700005)(6506007)(66946007)(76116006)(478600001)(53546011)(82960400001)(186003)(7696005)(2906002)(54906003)(110136005)(316002)(83380400001)(122000001)(52536014)(38100700002)(26005)(55016003)(8936002)(71200400001)(33656002)(41300700001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?W4S+CF/lP2l9+qpNckHFBJFvz6kh35uEsAGhYBsXuGMDsrdRlt/PxXQXzLQz?= =?us-ascii?Q?J40mpyG8Ro3ASf9ZTjdDt1vke1yQlKaC2Y+VQSIOYuTCMtzgT3NzK26YEaMi?= =?us-ascii?Q?tOGaaUBeuWA9Pc6Hmqw+LttjFJYmP4kcTOlF+NZgeiRR35jXdiAXPIYgm1Ek?= =?us-ascii?Q?dbX2Jzug1h+N6HUCzndMpF6fxBfVuCGOCH0H/gZWKDWYMXDn8wVvNWmI/T1+?= =?us-ascii?Q?5L1Y3PIgmYsd+fb4XVmxpB3eqLCCyEYehiS/v1K5ZjxV7cbzDM/+mQj9iI0M?= =?us-ascii?Q?+bM4NpsPc8tht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?us-ascii?Q?3SHHKi/64CFR1OVUptxsKscHadjxF2Z7z0nmDvF5bVIp0iiqd8ZCaH1A3KGd?= =?us-ascii?Q?gnmpyopByf407Yqb2tx12L/DEUGtef2NSj3h0MSRuByJHdf7axN3X8E+DHi4?= =?us-ascii?Q?mHMDt8EOMOPBy25FXSXBzbeY+B7lj7bZh9f3yRs+tG1F82bSl8zmszbYkm/7?= =?us-ascii?Q?/O6B3nlRXwo7gDjGN6LRogbTlc/8BN5oDRbQRbsHIhui+37+k8eO5mm0ujT9?= =?us-ascii?Q?pef9MRPRcdW6zZHATgcqHPSG0dTk170Qzb+Ur8hozsWaJoOC+pZpQxu7LaJ7?= =?us-ascii?Q?EadknPm9j1353nAcOskGR0JnVodVxyEw2dq6IcHhgUIWo8EiEu4PHequ5GX7?= =?us-ascii?Q?OA/kkYTxS2Oiykl0MBYFFVlInpDLWGPdFgWpyXLj?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5765a452-eed7-4055-68ac-08da74f793b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Aug 2022 02:26:30.9527 (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: 6QyYxZS634/tM0HmNWsfmnmr0NYn6h6sVwpfN5TD//USFi3e9AlzpVL2b7S+cmBWu1FJfg7tdzBghnHl26mkJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3349 Return-Path: min.m.xu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Leif/Ard/Abner/Daniel Since you're maintainers/reviewers of EmbeddedPkg. Do you have any comments= to this patch? The same reminder mail has been sent out two weeks ago but no response is r= eceived. Or anyone else can comment on this patch? Thanks much! Min > -----Original Message----- > From: Xu, Min M > Sent: Wednesday, July 20, 2022 4:50 PM > To: devel@edk2.groups.io; Leif Lindholm ; Ard Biesheuv= el > ; Chang, Abner ; > Schaefer, Daniel > Cc: Gerd Hoffmann ; Xu, Min M > Subject: RE: [PATCH V2 3/8] EmbeddedPkg: Add AllocateRuntimePages in > PrePiMemoryAllocationLib >=20 > Hi, Leif/Ard/Abner/Daniel > Since you're maintainers/reviewers of EmbeddedPkg. Do you have any > comments to this patch? >=20 > Thanks > Min >=20 > > -----Original Message----- > > From: Xu, Min M > > Sent: Sunday, June 26, 2022 11:06 AM > > To: devel@edk2.groups.io > > Cc: Xu, Min M ; Leif Lindholm > > ; Ard Biesheuvel > > ; Chang, Abner ; > > Schaefer, Daniel ; Gerd Hoffmann > > > > Subject: [PATCH V2 3/8] EmbeddedPkg: Add AllocateRuntimePages in > > PrePiMemoryAllocationLib > > > > From: Min M Xu > > > > AllocateRuntimePages is used to allocate one or more 4KB pages of type > > EfiRuntimeServicesData. > > > > Cc: Leif Lindholm > > Cc: Ard Biesheuvel > > Cc: Abner Chang > > Cc: Daniel Schaefer > > Cc: Gerd Hoffmann > > Signed-off-by: Min Xu > > --- > > EmbeddedPkg/Include/Library/PrePiLib.h | 19 ++++++ > > .../MemoryAllocationLib.c | 64 ++++++++++++++----- > > 2 files changed, 67 insertions(+), 16 deletions(-) > > > > diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h > > b/EmbeddedPkg/Include/Library/PrePiLib.h > > index 7b2cea296f1c..3741b08c4478 100644 > > --- a/EmbeddedPkg/Include/Library/PrePiLib.h > > +++ b/EmbeddedPkg/Include/Library/PrePiLib.h > > @@ -665,6 +665,25 @@ AllocatePages ( > > IN UINTN Pages > > ); > > > > +/** > > + Allocates one or more 4KB pages of type EfiRuntimeServicesData. > > + > > + Allocates the number of 4KB pages of type EfiRuntimeServicesData > > + and returns a pointer to the allocated buffer. The buffer returned > > + is aligned on a 4KB boundary. If Pages is 0, then NULL is > > + returned. If there is not enough memory remaining to satisfy the > > + request, then NULL is > > returned. > > + > > + @param Pages The number of 4 KB pages to allocate. > > + > > + @return A pointer to the allocated buffer or NULL if allocation fail= s. > > + > > +**/ > > +VOID * > > +EFIAPI > > +AllocateRuntimePages ( > > + IN UINTN Pages > > + ); > > + > > /** > > Allocates a buffer of type EfiBootServicesData. > > > > diff --git > > a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c > > b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c > > index 78f8da5e9527..9d7b34ad28fa 100644 > > --- > > a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c > > +++ > > b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c > > @@ -14,23 +14,11 @@ > > #include > > #include > > > > -/** > > - Allocates one or more 4KB pages of type EfiBootServicesData. > > - > > - Allocates the number of 4KB pages of MemoryType and returns a > > pointer to the > > - allocated buffer. The buffer returned is aligned on a 4KB > > boundary. If Pages is 0, then NULL > > - is returned. If there is not enough memory remaining to satisfy > > the request, then NULL is > > - returned. > > - > > - @param Pages The number of 4 KB pages to allocate. > > - > > - @return A pointer to the allocated buffer or NULL if allocation fail= s. > > - > > -**/ > > VOID * > > EFIAPI > > -AllocatePages ( > > - IN UINTN Pages > > +InternalAllocatePages ( > > + IN UINTN Pages, > > + IN EFI_MEMORY_TYPE MemoryType > > ) > > { > > EFI_PEI_HOB_POINTERS Hob; > > @@ -65,12 +53,56 @@ AllocatePages ( > > BuildMemoryAllocationHob ( > > Hob.HandoffInformationTable->EfiFreeMemoryTop, > > Pages * EFI_PAGE_SIZE, > > - EfiBootServicesData > > + MemoryType > > ); > > return (VOID *)(UINTN)Hob.HandoffInformationTable- > > >EfiFreeMemoryTop; > > } > > } > > > > +/** > > + Allocates one or more 4KB pages of type EfiBootServicesData. > > + > > + Allocates the number of 4KB pages of MemoryType and returns a > > + pointer to the allocated buffer. The buffer returned is aligned on > > + a 4KB boundary. If Pages is 0, then NULL is returned. If there is > > + not enough memory remaining to satisfy the request, then NULL is > returned. > > + > > + @param Pages The number of 4 KB pages to allocate. > > + > > + @return A pointer to the allocated buffer or NULL if allocation fail= s. > > + > > +**/ > > +VOID * > > +EFIAPI > > +AllocatePages ( > > + IN UINTN Pages > > + ) > > +{ > > + return InternalAllocatePages (Pages, EfiBootServicesData); } > > + > > +/** > > + Allocates one or more 4KB pages of type EfiRuntimeServicesData. > > + > > + Allocates the number of 4KB pages of type EfiRuntimeServicesData > > + and returns a pointer to the allocated buffer. The buffer returned > > + is aligned on a 4KB boundary. If Pages is 0, then NULL is > > + returned. If there is not enough memory remaining to satisfy the > > + request, then NULL is > > returned. > > + > > + @param Pages The number of 4 KB pages to allocate. > > + > > + @return A pointer to the allocated buffer or NULL if allocation fail= s. > > + > > +**/ > > +VOID * > > +EFIAPI > > +AllocateRuntimePages ( > > + IN UINTN Pages > > + ) > > +{ > > + return InternalAllocatePages (Pages, EfiRuntimeServicesData); } > > + > > /** > > Allocates one or more 4KB pages of type EfiBootServicesData at a > > specified alignment. > > > > -- > > 2.29.2.windows.2