From nobody Tue May 7 09:05:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1505803422833236.79040843734754; Mon, 18 Sep 2017 23:43:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 16E2321D492FB; Mon, 18 Sep 2017 23:40:37 -0700 (PDT) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0058.outbound.protection.outlook.com [104.47.42.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B796E21CEB0F9 for ; Mon, 18 Sep 2017 23:40:35 -0700 (PDT) Received: from DM5PR03CA0048.namprd03.prod.outlook.com (10.174.189.165) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Tue, 19 Sep 2017 06:43:39 +0000 Received: from BN1AFFO11FD032.protection.gbl (2a01:111:f400:7c10::110) by DM5PR03CA0048.outlook.office365.com (2603:10b6:4:3b::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Tue, 19 Sep 2017 06:43:39 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD032.mail.protection.outlook.com (10.58.52.186) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.35.14 via Frontend Transport; Tue, 19 Sep 2017 06:43:38 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net (uefi-OptiPlex-790.ap.freescale.net [10.232.132.78]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8J6hZa2009426; Mon, 18 Sep 2017 23:43:36 -0700 X-Original-To: edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Meenakshi Aggarwal To: , , Date: Tue, 19 Sep 2017 18:02:09 +0530 Message-ID: <1505824329-32532-1-git-send-email-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.com> References: <1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131502770191267300; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(376002)(39860400002)(346002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(316002)(498600001)(110136005)(50986999)(76176999)(4326008)(8656003)(47776003)(48376002)(54906002)(68736007)(36756003)(2950100002)(50466002)(106466001)(5660300001)(53936002)(85426001)(6666003)(305945005)(105606002)(8676002)(77096006)(189998001)(97736004)(33646002)(5003940100001)(86362001)(2201001)(16586007)(81156014)(81166006)(8936002)(2906002)(104016004)(50226002)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD032; 1:IoUMCnwvQrWsj0W+MAbZUy+N4VcjWy4c0UmA3be9DAIU+l4YwdW3Od9g+plAKITS5i0OifSIzmUJXhEHBuROvQh5jh9PHLAPnv3Q8CkdiXwTYfFLaTR4SKx+whujrOJo MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24b7d6ad-b5ba-40e6-f5e4-08d4ff29c2b1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 3:X6axBoMfc9fmA4N/HcsBDF4ehxWJfFdgRH8kwqd7jML+jwbAp1RZiYfaVmIggrC67NrS0VtSQXSGKlJr9uN/UbpWfiyqXsNeT4IhckhBHs/4gS2LFmWcSXz94Alw8Alh+nhTNkekYYQGalRVq7S9CGAHd7tIoipazWhtJNMWCuSbxWRGn4+mX2m1yJvov1ldJRRv3xC1R8sxLZyoFAMrY1mP8kSRaZR6nTKZWQa0i2LXRe8r/yTSTODuW+tnqVWLHSPNu/PiATe9KLFAjUbWlqHhEeN2cilt82YOcJaiWr5SVZJva+W7ZjMN6IJZssusVS4w31zpAhBVOq1sDAQXCKXvTVYMDHhpMKpHxXapyEo=; 25:WNSh94EtlE+atqaZB/Vk1zuCiyEaUfwChnH8X5bOsOkTAs+jl9sxj1dPREDEHf/YBFu42McgiusTymM7ZyHXuWzxzjcbq/fIHiblyuWNhryLr0T1VYoBd45C/JJ/z3M5nmGrSOaJGrP3JOzhs2RWpjmOEk2rbrtvHKfp/wy7cSVp0Rpdv+Ya9rXR7qpAvPXNwLd04gcZ1yao9xOBRYU/EtV2TjI6XDbRGgDdLxoxROZNEp5NDv8X7CiCi3eMS+CylRdpaldnkyLVNePlBWbRfKF2bObmLIqEeFYz+wPBuNByIl8kikIAsk/4VcqXcJBcgSOpGRnjoyZWDLjCs3FieA== X-MS-TrafficTypeDiagnostic: DM5PR03MB2699: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 31:sIm1ooeKuDt3pg3aIFGz3qL9qKAP0NXIIvZEHdTQPmnrp8SWaOHNbnrVXvfLK/r3Vg6Acyw2xxl5z40OuvmL+2XyMUoPVLdLtK7KbUIS4zz7pZ1IU9AOOjt5rKnIN3+GjOBbb+UPXnOyp4saS7vDfOTXEw1zl5qqmQGn5Szl6fWc3i3K6/5Z01intLdg3szllFTbD1j7wyWaubogSmC83zB9H+9dtG5YHMu4dmbGCFY=; 4:GXN4w94JLxSwh1K9vERApo07c5cDY++rbsd/77rTH6DUWmWjGJ59CGJoIxdoUuByMe4Yrdyjy1zs6lB5/CZ2QyAUIz0bMZvcMMSmEshVBXy8z2v3GEbUKhhs8aeJohkswcXqpA8qhE4HqqWSviV+QEN6wNrm9UU3yrde9AOKiqigE+DhLeSKTgm0TKyyE9J5lzR9D9QnYw3NreUT32wOoGxZMUP2Ve/cGiOotBeTmBQGeVGbrgtrAdypeUexAy+iw48y/TMdi3KehnL/SXFmTWJDPNNb0aOwFuosUO+FRBA= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123556025)(20161123559100)(20161123561025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 04359FAD81 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:sJLmCzseieZTg3/BVwoClEBTKlj6Hvs3+JCPROLrj?= =?us-ascii?Q?tYipKRnaFs7o1uzUTnkjN2HR8CqoJe5uii/ySsJ5/8EJkio5Z+ZuXa2hZni9?= =?us-ascii?Q?2XhAfmJMgXHD2vJ03eNOz7ncHTXmvl0OXEVavhzw+h/9Z1MHzYnVUNLGNPwZ?= =?us-ascii?Q?hyWlniuCY4X7QWtEypdC832dyOvihsJ6MXNPj/8J29DzdKhKIyqp6wDBr7tU?= =?us-ascii?Q?Pp5ArHDLnu0L3Cqcmz3iRds3kAH/GSDPW3lAvurDEXewV79SFYpOC1Imf05c?= =?us-ascii?Q?B9+z+M0mohUcolKPMJa4Eb4a5r2DpmPlVgxMn/VKO57e2aOo2CwtgloU2nGm?= =?us-ascii?Q?yGIVN23aq9Q3ZUGyEJLIzG9UsKeiZNXQOR3u+SrbxBKIa6bSAE9RTjGztOe5?= =?us-ascii?Q?j23jp0R9wEurLDV3mLaMjD5/QqSpQTNM82y9Ga0G3/o7tgdxgrIj/fVKsgHF?= =?us-ascii?Q?Mc+rsQIEpGgWL7MNv+ECNWDcuHckFeuvOdVmMYPz79Cp0XOq0j/4The4aXNL?= =?us-ascii?Q?k5Pmr9ilCERowC3zSebsaa8xzeQv0JjvwWTgvcZJDrcno7fizIC9Q0YPy1YJ?= =?us-ascii?Q?9mBh9i8DOr5uET6oL7jBmbVNF7sHKO1IXFCDP+9G0Cn5Xikayo1WJT/AjwgP?= =?us-ascii?Q?HvyUY78+catM/BGqJPcuM4X0QOYZOUEebyKPqgT14FMUaB+SFDJNwmsBGgRx?= =?us-ascii?Q?1oQMQsph9ifBv2RSLa6Dm+sG0Ssq96CNFhLeYaaSuXv7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PnxMUP3/0eVbtkAqkVebbx3GBTNl6F+LDmVxt/PITOTLm+ULBRj3nJwBGnaxrZGE3bbFaIrlkG1T9x8Jyu52FCInvJN4U2CO6Xw=; 7:WbZpl/CoiB01NZT64Yr9fIeR4lzjFInXxRSFp05z4vMne1CzKE97yqJUUugxJdmqCDOavSJfCYf2oGQXajWr/qbdXatSTGYmDB5JwKIaublXq1vxrk07yWeK+TusZQv97JnlftwZdEX8rwFeLaTDG6UR1KYA8yPToImwGa6L7Xqxx3xzQxYzbaDDa+K3asGij4gMukKLBPvohWVZATKVxKu3203VpjUZwwRGxu4vR0U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 06:43:38.9551 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2699 Subject: [edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" While creating Hob list, ArmPlatformPkg is hiding UEFI memory. whereas this memory can be used by OS. This patch, allows OS to use UEFI code area. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Udit Kumar Signed-off-by: Meenakshi Aggarwal --- ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 69 ---------------------= ---- 1 file changed, 69 deletions(-) diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformP= kg/MemoryInitPei/MemoryInitPeiLib.c index 2feb11f..d03214b 100644 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c @@ -70,11 +70,7 @@ MemoryPeim ( { ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable; EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttributes; - UINT64 ResourceLength; EFI_PEI_HOB_POINTERS NextHob; - EFI_PHYSICAL_ADDRESS FdTop; - EFI_PHYSICAL_ADDRESS SystemMemoryTop; - EFI_PHYSICAL_ADDRESS ResourceTop; BOOLEAN Found; =20 // Get Virtual Memory Map from the Platform Library @@ -121,71 +117,6 @@ MemoryPeim ( ); } =20 - // - // Reserved the memory space occupied by the firmware volume - // - - SystemMemoryTop =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemoryBase)= + (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemorySize); - FdTop =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFdBaseAddress) + (EFI_PHYSI= CAL_ADDRESS)PcdGet32 (PcdFdSize); - - // EDK2 does not have the concept of boot firmware copied into DRAM. To = avoid the DXE - // core to overwrite this area we must mark the region with the attribut= e non-present - if ((PcdGet64 (PcdFdBaseAddress) >=3D PcdGet64 (PcdSystemMemoryBase)) &&= (FdTop <=3D SystemMemoryTop)) { - Found =3D FALSE; - - // Search for System Memory Hob that contains the firmware - NextHob.Raw =3D GetHobList (); - while ((NextHob.Raw =3D GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, = NextHob.Raw)) !=3D NULL) { - if ((NextHob.ResourceDescriptor->ResourceType =3D=3D EFI_RESOURCE_SY= STEM_MEMORY) && - (PcdGet64 (PcdFdBaseAddress) >=3D NextHob.ResourceDescriptor->Ph= ysicalStart) && - (FdTop <=3D NextHob.ResourceDescriptor->PhysicalStart + NextHob.= ResourceDescriptor->ResourceLength)) - { - ResourceAttributes =3D NextHob.ResourceDescriptor->ResourceAttribu= te; - ResourceLength =3D NextHob.ResourceDescriptor->ResourceLength; - ResourceTop =3D NextHob.ResourceDescriptor->PhysicalStart + Resour= ceLength; - - if (PcdGet64 (PcdFdBaseAddress) =3D=3D NextHob.ResourceDescriptor-= >PhysicalStart) { - if (SystemMemoryTop =3D=3D FdTop) { - NextHob.ResourceDescriptor->ResourceAttribute =3D ResourceAttr= ibutes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT; - } else { - // Create the System Memory HOB for the firmware with the non-= present attribute - BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, - ResourceAttributes & ~EFI_RESOURCE= _ATTRIBUTE_PRESENT, - PcdGet64 (PcdFdBaseAddress), - PcdGet32 (PcdFdSize)); - - // Top of the FD is system memory available for UEFI - NextHob.ResourceDescriptor->PhysicalStart +=3D PcdGet32(PcdFdS= ize); - NextHob.ResourceDescriptor->ResourceLength -=3D PcdGet32(PcdFd= Size); - } - } else { - // Create the System Memory HOB for the firmware with the non-pr= esent attribute - BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, - ResourceAttributes & ~EFI_RESOURCE_A= TTRIBUTE_PRESENT, - PcdGet64 (PcdFdBaseAddress), - PcdGet32 (PcdFdSize)); - - // Update the HOB - NextHob.ResourceDescriptor->ResourceLength =3D PcdGet64 (PcdFdBa= seAddress) - NextHob.ResourceDescriptor->PhysicalStart; - - // If there is some memory available on the top of the FD then c= reate a HOB - if (FdTop < NextHob.ResourceDescriptor->PhysicalStart + Resource= Length) { - // Create the System Memory HOB for the remaining region (top = of the FD) - BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, - ResourceAttributes, - FdTop, - ResourceTop - FdTop); - } - } - Found =3D TRUE; - break; - } - NextHob.Raw =3D GET_NEXT_HOB (NextHob); - } - - ASSERT(Found); - } - // Build Memory Allocation Hob InitMmu (MemoryTable); =20 --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel