From patchwork Fri Nov 23 12:14:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 151857 Delivered-To: patch@linaro.org Received: by 2002:aa7:da0f:0:0:0:0:0 with SMTP id r15csp2050999eds; Fri, 23 Nov 2018 04:15:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/U4Euh0B7ehNcP6j38gTAH4qLtvvdtbHbQ9fp5R/l9atAC/aw6bpM9SMJmOCZ3oXZM5zAP8 X-Received: by 2002:a63:24c2:: with SMTP id k185mr13474621pgk.406.1542975300503; Fri, 23 Nov 2018 04:15:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542975300; cv=none; d=google.com; s=arc-20160816; b=mMT5TTu7AJQmygCENl+Ws8PpYWkzrC+p7RzB/i7jat70wKHzEu6QdRZ3VbEY/sFRAQ F4L5aHJsABJkyBtUBqw7TPJYSLQ5fQRq3s0zSg96Usae8Jb+lZlHNTITfTzwgimMvadx YhXTTo6Ql4hYT8EdpgpRb3KQovuzoj/wDWNJExJ5dzasH8VNuR6ef+oBBxMhHys9gP2H 63wFq1sir5EwMlZNu1xHs40DHbchjdlkg6K7j5cHnc5P4j779JLquYy6scFIO/O7G4fg oRyp64WtLknhh4DBdbsbqoqBv5MjIqB0/jsIIPzd4foe3NQrnVym1pXwn7fW8eYYqowS +4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=Ecse3g7/Vjdt+P9VPMD/0hT34RpQbZB8R4+4KLhoK/E=; b=mM8Ina0Pc3MyDy/uwI8P7j1dhLzGnL/P0QR6T2hbHWX7Ryi7ePdbvgxcj6JmXRL5P1 +CAiXm3oUUKKF4QJggwhPuZac8xtHrMbrQGVWw7bLwK1KWp8ZVO6QSQDXJB0iBgJDsm9 xR96GCLStjph4NUhsf8xcEvLAwympIvkdirqZqmZccRJxeoX7q1cFfUtq4MNZXZv6xvz elnOmgNsq94c0Xb1Q4OW4i9RUQguo7DFt88IRp/5irhfCkFWt0UZ9VHNkbxtYKAOWIxF HJm84WhN5nH3UDdoWEfdjORdX9RZirEG0D565mQTcb6yYqTtCfHrvHRE2CqiKXJajvQA B23Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Of8btlsC; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id 9si50605593pgm.112.2018.11.23.04.15.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 04:15:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Of8btlsC; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AB85B21194D28; Fri, 23 Nov 2018 04:14:54 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::441; helo=mail-wr1-x441.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (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 80EA12194D387 for ; Fri, 23 Nov 2018 04:14:51 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id c14so6511868wrr.0 for ; Fri, 23 Nov 2018 04:14:51 -0800 (PST) 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=1A7tDWivKr1et7g8yBGgA5/Ar+Kjtyc+Vx0UG8BNon0=; b=Of8btlsCA5CvSBn1IzYDLYNOSv7eyufEnn5omZ9ZqOMXI9zMEM2o3S4gP6kKzW5wm7 MpJXKkbWeFxPIpFBRce1JRlV4FAfrewoCPeDIsFTNsKLLugxjf8StCNaguUAHDwpLpsj LtZT+uHu6km7gm6Oo11lNV9QSOfTk+fI44TNA= 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=1A7tDWivKr1et7g8yBGgA5/Ar+Kjtyc+Vx0UG8BNon0=; b=N3gyacaGwZ84AXsYiwy+lnthWELSbUp2369b8755WpjbfPWLqwEOhLukLOsPAEM9Qe bMlECarVO/t5i6sD38URCvCnkNv7WO8yFaraSKlxU6KUvoE+HiNwDo4Y1EdkdIzDUbdu RGvo/DGyvUbTcwi2YWaC551Ji7rJ9zMT6KZUc6dVnMSX+6bDrk3SusO1hu0HkXIMrlu1 zyQZxuVuutc1ibDBJTxtxjT9zZB/8ik4ScvVePdDZE8Lm3mL7bdVuuuD+1aUNX4Nrty/ 6lxfmgjr7++ds/9Oc+0FUUs1F0d0sygYrMneJl5D9IQee7oirkczi2GQ5Iy3DYWuODun 5bgw== X-Gm-Message-State: AA+aEWZCEMEtmAq2DYt5XhhduPjUyz8uN+6G1FjF91yH9QUGOBDE/F8I 1NvA3gqG0oG/HXBprqwQfQ6fzj0QBiWtLw== X-Received: by 2002:adf:e846:: with SMTP id d6mr14166016wrn.72.1542975289774; Fri, 23 Nov 2018 04:14:49 -0800 (PST) Received: from mba13.wifi.ns.nl (33.153.69.91.rev.sfr.net. [91.69.153.33]) by smtp.gmail.com with ESMTPSA id x79sm16469106wmd.42.2018.11.23.04.14.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 04:14:49 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 23 Nov 2018 13:14:30 +0100 Message-Id: <20181123121431.22353-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123121431.22353-1-ard.biesheuvel@linaro.org> References: <20181123121431.22353-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 4/5] ArmVirtPkg: disregard PcdPrePiCpuMemorySize PCD when sizing the GCD space X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jones , Laszlo Ersek , Eric Auger MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Move the call to BuildCpuHob () into ArmVirtMemoryInitPeiLib (which is shared between all the ArmVirtPkg targets), and drop the inclusion of CpuPei.inf [which calls it on ArmVirtQemu] and the BuildCpuHob () call from ArmVirtPrePiUniCoreRelocatable [for the other targets]. This makes the size of the GCD address space and page table mappings depend only on the size of the physical address space as exposed by the CPU system registers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtQemu.dsc | 1 - ArmVirtPkg/ArmVirtQemu.fdf | 1 - ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c | 3 +++ ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf | 1 + ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c | 5 +---- ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf | 1 - ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf | 1 - ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 --- ArmVirtPkg/PrePi/PrePi.c | 3 --- 9 files changed, 5 insertions(+), 14 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 885c6b14b844..cb59c790afcc 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -226,7 +226,6 @@ } ArmPlatformPkg/PlatformPei/PlatformPeim.inf ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf - ArmPkg/Drivers/CpuPei/CpuPei.inf MdeModulePkg/Universal/Variable/Pei/VariablePei.inf diff --git a/ArmVirtPkg/ArmVirtQemu.fdf b/ArmVirtPkg/ArmVirtQemu.fdf index c6a22dc018f3..12bc570c4cb3 100644 --- a/ArmVirtPkg/ArmVirtQemu.fdf +++ b/ArmVirtPkg/ArmVirtQemu.fdf @@ -106,7 +106,6 @@ READ_LOCK_STATUS = TRUE INF MdeModulePkg/Core/Pei/PeiMain.inf INF ArmPlatformPkg/PlatformPei/PlatformPeim.inf INF ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf - INF ArmPkg/Drivers/CpuPei/CpuPei.inf INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf diff --git a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c index 3f0e9b3a0579..3d86d31ab50e 100644 --- a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c +++ b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c @@ -116,5 +116,8 @@ MemoryPeim ( BuildMemoryTypeInformationHob (); } + // Publish the CPU memory and io spaces sizes + BuildCpuHob (ArmGetPhysicalAddressBits (), FixedPcdGet8 (PcdPrePiCpuIoSize)); + return EFI_SUCCESS; } diff --git a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf index 54879d590a8a..d0e39df84b20 100644 --- a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf +++ b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf @@ -59,6 +59,7 @@ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData + gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize [Pcd] gArmTokenSpaceGuid.PcdSystemMemoryBase diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c index 4eca9b895354..ded87d604f4f 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c @@ -46,7 +46,6 @@ ArmVirtGetMemoryMap ( ) { ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; - UINT64 TopOfMemory; ASSERT (VirtualMemoryMap != NULL); @@ -80,11 +79,9 @@ ArmVirtGetMemoryMap ( VirtualMemoryTable[1].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; // Peripheral space after DRAM - TopOfMemory = MIN (1ULL << FixedPcdGet8 (PcdPrePiCpuMemorySize), - TopOfAddressSpace); VirtualMemoryTable[2].PhysicalBase = VirtualMemoryTable[0].Length + VirtualMemoryTable[1].Length; VirtualMemoryTable[2].VirtualBase = VirtualMemoryTable[2].PhysicalBase; - VirtualMemoryTable[2].Length = TopOfMemory - + VirtualMemoryTable[2].Length = TopOfAddressSpace - VirtualMemoryTable[2].PhysicalBase; VirtualMemoryTable[2].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf index f2c461e3b55a..5c5b841051ad 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf @@ -45,4 +45,3 @@ [FixedPcd] gArmTokenSpaceGuid.PcdFdSize - gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf index f54fb51ee1d4..d12089760b22 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf @@ -49,4 +49,3 @@ [FixedPcd] gArmTokenSpaceGuid.PcdFdSize gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress - gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index 1587bd92f206..e04bd1b7c497 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -85,9 +85,6 @@ gArmPlatformTokenSpaceGuid.PcdCoreCount - gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize - gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index f6abe2f2016b..ecaaac1545c4 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -79,9 +79,6 @@ PrePiMain ( StacksSize = PcdGet32 (PcdCPUCorePrimaryStackSize); BuildStackHob (StacksBase, StacksSize); - //TODO: Call CpuPei as a library - BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize)); - // Set the Boot Mode SetBootMode (BOOT_WITH_FULL_CONFIGURATION);