From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.45]) by mx.groups.io with SMTP id smtpd.web12.13823.1584628650513074126 for ; Thu, 19 Mar 2020 07:37:30 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=ZfkQNO3C; spf=pass (domain: oss.nxp.com, ip: 40.107.5.45, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c3FOCuqih5bA7QtPQ3IPkQDpr352BqSbIjlHd4BQHPcIgqKaCQzEEBn6yfMp4bubdCkQMlcHwET9u4RLlrTlKCRCzm7SbOSNuK5UNKjVaL9d8h1/hP8cJ4C4QL+ZpeDW1CLr2oW87s8m2k3hAmWfp4N6nuRP5AQrZQfKxUI582O11eqi9lCWVxPGvhtF5VafdYUol1IQbNyYHa/nP87GIxFI0TLFaQqmSmuWFklEJBt1rGQMN07iozz5QMckvMIeA0vvuO0Y1+5TAp3tobUvICPxhikECj24cq5yrZlqm7tf0vOFlMi16+2kvy0xpqhWKGvj08AOhPmM34u+nDPtLg== 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=e7aDhMzWqtmfIBuxtgFoku2Po71RSZkzKhLsqNa7S6Q=; b=jFBkhtwPP+giNeLwQ3vLijig0vwbt6STsLNWDNf5kQx5RYvPOvbv6Q91nSWnyvtYYORD9B6aRIrnXK9db7P4V8U74Ux/+Y4phAdxOudjW/Jh/ihG8LZZ7prw9Eu6nnGOVXoMr10VjRm/LUju6pPxl/PBsM1KQ189MztgiTUX6XmcpEhObuiZ0rgh4oXl++Tul+ZjQFj3CDbY4wvcyAPlc+6KuHc0vnn6BUuY2SgyjfzZpCGOOF+NZF9yLlidSMO502yQ8ZQiMwUh9cmKpfqmQRsnl/tOV/my9M/dlDBtf3uTQklCNKjxKhGQp5BVyZtTh6Dw5rhk37kmiaNF9b4y+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e7aDhMzWqtmfIBuxtgFoku2Po71RSZkzKhLsqNa7S6Q=; b=ZfkQNO3CBlT4wuChM8/CqLAAAymsvBrUXX6eHde8PN/9UvjEVE8+THg597nn2SMn1fcVHIjDd6plpXqwAG4K9DxOpDl8aQdwSo7zpF3ICmNiHH912kqhiYt4zZKkGxXR4SOY1esh0NE+TayYGVr4GPc+mAPZ88ADPkvTkZV42Y4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@oss.nxp.com; Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:28 +0000 Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:28 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [PATCH v2 23/28] NXP/LS1043aRdbPkg/ArmPlatformLib: Use Allocate pool Date: Fri, 20 Mar 2020 20:05:38 +0530 Message-ID: <20200320143543.18615-24-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) Return-Path: pankaj.bansal@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:25 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6966d045-0a52-45c2-79e3-08d7cc130c62 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-Forefront-PRVS: 0347410860 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(136003)(366004)(346002)(396003)(39860400002)(199004)(2906002)(26005)(186003)(16526019)(6666004)(478600001)(81166006)(86362001)(44832011)(8676002)(5660300002)(81156014)(6486002)(66476007)(66946007)(316002)(1076003)(6512007)(66556008)(6506007)(956004)(8936002)(2616005)(52116002)(110136005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2269;H:VI1PR0401MB2496.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SWZAPe3QNd1L6sgIXeem6IlbrEQQDPEYmW2GO3KdQN+aIR+8iHlB+SDOTg1k/L+mWqomiN/ZJg2gsOzKKgeen2Z8ui9qSuNzZiaoW5BfvD91FFGbZAsR2+Egp6o18cSGpBhzhlnh1WJDlKE9v7KeZ8c6Fi52mTRJ3OsADf+EzFEaQIThGO6saH8+4+tvVck4Zp/w9bFscjHt8lJaijHq06+nkxTTC43foSBSna5HqR41knQ45gHY4zQlbuoHO/nvPmJKhgknLZRqZZQ6mAcRDLsnzwjvcBb3Kr6Yy8lmjNiHiMot35I/bUjFTw9m8XT08wvmwMpqsKpIS3bLQSNxFbavaC6EWbAeIkHSwBLSGsG6Lld+G14Jm1ilBOwdLgAJlj8MpNh2Zm5X5rriXIAW3J+DErm0kL/mBpN8O2HHLjUj3XtbzT7YhB4t4mrGemOu X-MS-Exchange-AntiSpam-MessageData: HWULQDxDoRgkkkuYn4jb0T+rlsp0GPR9eHSqvUpFP1cGs44B1jWguB2Ehvtto1Z4LJRPbTOu3NgBdLlstIskotOySRpu+7C9mvVvyVAGpXngOVjnf+erZylqUvxFpqPH/V0/w+JGDfHfKnZzmJWwrQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6966d045-0a52-45c2-79e3-08d7cc130c62 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:28.3198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pOVyyxp1B+P0nXh8ZNgO8oUq8VV9fDM2Mde5Uh2qeXpesiRX+YBXSM71PnRuQe1JHBCouQLkFuSUywGvEFUGqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal Allocate Pages may allocate more memory than required for VirtualMemoryTable. There is no special requirement that VirtualMemoryTable size should be page size aligned. Therefore, replace AllocatePages with AllocatePool. Signed-off-by: Pankaj Bansal --- .../LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf | 1 + .../LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.i= nf index 1faf99b99c54..c64032f32772 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -25,6 +25,7 @@ [Packages] =20 [LibraryClasses] ArmLib + DebugLib SocLib =20 [Sources.common] diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ibMem.c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibM= em.c index f5fa308551aa..f8dd642e3cff 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c @@ -43,10 +43,11 @@ ArmPlatformGetVirtualMemoryMap ( =20 ASSERT (VirtualMemoryMap !=3D NULL); =20 - VirtualMemoryTable =3D (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages ( - EFI_SIZE_TO_PAGES (sizeof (ARM_MEMORY_REGION_DESCRIPTOR) * MAX_V= IRTUAL_MEMORY_MAP_DESCRIPTORS)); + VirtualMemoryTable =3D AllocatePool (sizeof (ARM_MEMORY_REGION_DESCRIPTO= R) * + MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS); =20 if (VirtualMemoryTable =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTION_= _)); return; } =20 --=20 2.17.1