From nobody Wed Dec 25 04:34:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 1512055526733617.4122991791186; Thu, 30 Nov 2017 07:25:26 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 014342211B438; Thu, 30 Nov 2017 07:20:57 -0800 (PST) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 677912211B42D for ; Thu, 30 Nov 2017 07:20:55 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id 64so13059283wme.3 for ; Thu, 30 Nov 2017 07:25:20 -0800 (PST) Received: from localhost.localdomain ([105.150.171.234]) by smtp.gmail.com with ESMTPSA id 43sm2566328wru.81.2017.11.30.07.25.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 07:25:18 -0800 (PST) X-Original-To: edk2-devel@lists.01.org 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: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A5jmI5y9pF0gmRd5PKK/crUOIfWQw93y9kbUkqiD68A=; b=OpBCdKl1b86K2nSCZ65VkOBBoA6+T0F7L2STuufnes0bd1k2DD1qCQgz6mFbPeiEdM jqRTYCN6nJtYei4Ei0ZytCE6s85Dkt+M1l9v7VnY4NL+S+zyabT4OmYtYeAb+pl1vX81 Clb/IuNDmescHjocF1n1yLexYS71uLzgj/6Lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A5jmI5y9pF0gmRd5PKK/crUOIfWQw93y9kbUkqiD68A=; b=LHMjZOUzbLseE8w+XW3I+Dy8s27cS6vQioGYeQIQytWoYpXa4IQblcvJwv6lzf6GKp tBKl/bZSnAa+n/oUg++dx06HqT6Ni6/0fXSMTTDRsWdg5gR3T1pTcM6x7MEXVYTi5bw0 7m/Cdtibm5eFtYoem6ZYh/YcfWMMB0HEuOpujNG2Uv3gor9k7HfYXozC0J28I/5kX7Pn HXXYdTvtR9nPOBzJ8crNCS0nS16jSb4uq08STGywNCpqy2cg62qxSR1wSjBikx4H5xgl jXAVIww6o12fweaokXKe+9e++Cspzid61/Zw2a+F8pMpSM3kr0dnQT8vaPwykjt8ROuK /Ong== X-Gm-Message-State: AJaThX7J62Vtgwuix15CW4vQrFDbn9SWsQDXi48I+itsHE5LadXBCuxJ +c/uC2wwJiIGGCWsPxTjLeeIgH+IfFI= X-Google-Smtp-Source: AGs4zMZ1qThTk2WvM7VRocKveTaBJY3WaI6vscU5lMYfdfeEIixEoGOM7oUvoj9lWbpLn6vjcudT7w== X-Received: by 10.28.95.7 with SMTP id t7mr2336445wmb.86.1512055519203; Thu, 30 Nov 2017 07:25:19 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Thu, 30 Nov 2017 15:24:51 +0000 Message-Id: <20171130152453.19205-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171130152453.19205-1-ard.biesheuvel@linaro.org> References: <20171130152453.19205-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 5/7] ArmPlatformPkg/MemoryInitPeiLib: don't reserve primary FV in memory 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: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Meenakshi Aggarwal Now that PrePi no longer exposes its internal code via special HOBs, we can remove the special handling of the primary FV, which needed to be reserved so that DXE core could call into the PE/COFF and LZMA libraries in the PrePi module. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Udit Kumar Signed-off-by: Meenakshi Aggarwal [ardb: updated commit log] Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 69 -------------------- 1 file changed, 69 deletions(-) diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformP= kg/MemoryInitPei/MemoryInitPeiLib.c index 2feb11f21d5d..d03214b5df66 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 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel