From patchwork Fri Nov 17 16:08:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 119172 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp702972qgn; Fri, 17 Nov 2017 08:09:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMYWz+G0Or/dX12VtLhTLAUlcAsAy/JMIZFcjffYR6GtjbEw6teamntvyP0tGzpfxPGX032l X-Received: by 10.84.252.23 with SMTP id x23mr5763043pll.54.1510934966203; Fri, 17 Nov 2017 08:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510934966; cv=none; d=google.com; s=arc-20160816; b=t2c9kltF9dIoM37wmwXVBRtVRxMg6wQwRvZXR24J1N2BC+fIUdJIc9yflPSwy3aQli x8TJWWfok1YIouE8sERteY/Yxxc5faqBB2EFfv4X8sFr1oZM4PwFOudKD0bFMA5jqhsH G4M6lMvSRib3vLyCMgBFuUgGk7OqNzLD9jCHPl++gLAWCJpzwA/xQqTo6MHyw/vqc4LK jjKPFArFcQjsYx1PxZ7zJBKoBDuB/DJkUYKJfOqK8GHBWDN3+ZJHfXMToO4aJrqUIakA mcOzYNKHjkrVzhVX2cAugWL4W5+7qI6Q8rZaWHznv3kV9BJ+vEscUnGFYg3dtHq6eUWx 8z3A== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=LwO8ibw8wyDqsckwQ9/fBj+Zx8u3IVx2cyXaqVCfFEo=; b=JG3rJEnc8qxXoyS11OZJBitCSlJ90kMfJoKPo+hFBIaIJv0aiC9g1o0nMmFm8bbTZU xSzmD/YNmYSX/+BVbYsoZ5Xp9GD/akK4rzK3z5HG7Qx6VIaZTrwBszfjTRqs/yHYWJrt Gmh3wXwyAYR/qMFuheBOIbXr1z81Yq9M7fYFhz2gYtH2w/QiFN3IHQNYzKa4J2Yf24Ym 6HBk/r716XtFY5o5UE5/gHCkE45WfklBuuWTmCQgEKMJ39YCvD8aDlqnd3XNx9YQ6Yo0 o4Ly7PpGS6wfKwhdJcAzQhVc0r2LdOEELawQ71M0Q3pc5W8e7Zx3VS6JkR+dG2Z7IxM3 gadg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ULUj8zci; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id 39si2288726plc.68.2017.11.17.08.09.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ULUj8zci; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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 740BC21B00DC1; Fri, 17 Nov 2017 08:05:14 -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:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (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 A92DF2035BB1B for ; Fri, 17 Nov 2017 08:05:12 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id u98so2520653wrb.13 for ; Fri, 17 Nov 2017 08:09:23 -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; bh=GSH09+nzN5twfOGCkuMldV/1vIeQPeb4bZoRb0w7PDc=; b=ULUj8zciMX3bk+N02+Ma94vOdCDZutIf2SCM2NMk9PG8X4lbR+cODNn9D7KWG2EaGH DzHv7KVoInvwjSa1DiIw4+MTdzd1l4PaFKU/YCPAWa97KrSKUlIlRJ0MOmEI5GM40tgS 7kW2dVYuziLoghf83bIxjeRsszq6ZE5TuAB6Q= 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; bh=GSH09+nzN5twfOGCkuMldV/1vIeQPeb4bZoRb0w7PDc=; b=ckln5toKjFRznDgGC6O/jCJSomJSLBNWAqeJi0DTInyWduJB7H5GExeuEWFREa7RtZ K+mWcTgYjcYiRykKi7GXUcGjJKLGpHSEo2D2ukKbHMe01LDA7fY4/PASeDi7TlvFpmio /Lf07pRzDjfKcXFGtqaRgqpnjBan0c0M54gO8ZDfMjKKLyJzkkqw/euJA5oAwyj7OPej pYrWtVzHMd0554JboMXdVVI1EYm+9ZAzIYywxqPEC/HxiEEnR/fbSvqlGKETS+jB9KJX EwwJXN/5+kD4877yJzrP00ava+RfW0ayHa4LhLNcAxz2QjcshvDgDPMs8jUcT1bcnrcK GWrg== X-Gm-Message-State: AJaThX6YQwOzr8AFmWtJ0U9U3mPV6pjXAE/jFmdLG4e60Itrbj/VspYW DX0lVeFxjzbYnXGR76V2BZlfJfTYiDI= X-Received: by 10.223.136.253 with SMTP id g58mr5129421wrg.86.1510934961675; Fri, 17 Nov 2017 08:09:21 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:20 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:08:58 +0000 Message-Id: <20171117160913.17292-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH 00/15] ArmVirtPkg: get rid of ArmPlatformLib 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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" ArmPlatformLib is a mixed bag of platform specific hooks, some of which are called from early startup code, and some of which are called from C code, to get the boot mode, memory layout etc. This library class is tightly coupled to the old ARM implementations that ran some parts of UEFI in the secure world, and booted all cores into SEC. Also, the fact that both PrePi and PrePeiCore use ArmPlatformLib makes it difficult to use PEI phase features such as PPI depexes. It would be better if we could get rid of it completely, or at least not require each platform to implement it in its entirety. So as a first step towards phasing out ArmPlatformLib to the extent possible, let's remove it from ArmVirtPkg. For ArmVirtXen and ArmVirtQemuKernel, we can get rid of it completely. For ArmVirtQemu, we can't, but we can still remove our own implementation by switching to the NULL implementation from ArmPlatformPkg (which does require a minimal tweak in patch #1). Further reductions of the scope of ArmPlatformLib will be reflected in that library without the need for further changes to ArmVirtPkg. Note to Laszlo: given that you care very little about the Xen and QemuKernel flavors, please feel free to focus primarily on patches 9 - 15. https://github.com/ardbiesheuvel/edk2/tree/armvirtpkg-armplatformlib-removal Ard Biesheuvel (15): ArmPlatformPkg/ArmPlatformLibNull: remove bogus PCD dependencies ArmVirtPkg/PrePi: run all library constructors by hand ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function ArmVirtPkg/PrePi: remove bogus primary core check ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib ArmVirtPkg/PrePi: move DRAM discovery code into PrePi ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency ArmVirtPkg/PrePi: remove bogus IntelFrameworkModulePkg.dec dependency ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings ArmVirtPkg: introduce ArmVirtMemInfoLib library class ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation ArmVirtPkg/ArmVirtQemu: add ArmVirtMemInfoLib implementation ArmVirtPkg: implement ArmVirtMemInfo PPI, PEIM and library ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib ArmVirtPkg: remove ArmPlatformLib implementations ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf | 3 - ArmVirtPkg/ArmVirt.dsc.inc | 1 - ArmVirtPkg/ArmVirtPkg.dec | 6 + ArmVirtPkg/ArmVirtQemu.dsc | 7 +- ArmVirtPkg/ArmVirtQemu.fdf | 1 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- ArmVirtPkg/ArmVirtXen.dsc | 2 +- ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h | 39 ++++++ ArmVirtPkg/Include/Ppi/ArmVirtMemInfo.h | 48 +++++++ ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S | 141 -------------------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S | 123 ----------------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatformLib.inf | 64 --------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c | 70 ---------- ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c | 4 +- ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf | 3 +- ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S | 57 -------- ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm | 71 ---------- ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf | 64 --------- ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c | 113 ---------------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S | 140 ------------------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S | 123 ----------------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformLib.inf | 63 --------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c | 89 ------------ ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c | 70 ---------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c | 82 ------------ ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c | 46 +++++++ ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf | 42 ++++++ ArmVirtPkg/Library/{ArmVirtPlatformLib/AARCH64/VirtHelper.S => QemuVirtMemInfoLib/AArch64/PhysAddrTop.S} | 33 +---- ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S | 24 ++++ ArmVirtPkg/Library/{ArmQemuRelocatablePlatformLib/QemuVirtMem.c => QemuVirtMemInfoLib/QemuVirtMemInfoLib.c} | 61 ++++----- ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf | 53 ++++++++ ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S | 39 ++++++ ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S | 24 ++++ ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c | 61 +++++++++ ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf | 41 ++++++ ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 98 +++++++++++--- ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S | 92 ++++++++++--- ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 5 +- ArmVirtPkg/{Library/ArmQemuRelocatablePlatformLib => PrePi}/FdtParser.c | 0 ArmVirtPkg/PrePi/PrePi.c | 43 +----- ArmVirtPkg/PrePi/PrePi.h | 1 - ArmVirtPkg/{Library/ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c} | 109 +++++---------- ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf | 60 +++++++++ 43 files changed, 717 insertions(+), 1501 deletions(-) create mode 100644 ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h create mode 100644 ArmVirtPkg/Include/Ppi/ArmVirtMemInfo.h delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatformLib.inf delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformLib.inf delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c create mode 100644 ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c create mode 100644 ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf rename ArmVirtPkg/Library/{ArmVirtPlatformLib/AARCH64/VirtHelper.S => QemuVirtMemInfoLib/AArch64/PhysAddrTop.S} (58%) create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S rename ArmVirtPkg/Library/{ArmQemuRelocatablePlatformLib/QemuVirtMem.c => QemuVirtMemInfoLib/QemuVirtMemInfoLib.c} (59%) create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf rename ArmVirtPkg/{Library/ArmQemuRelocatablePlatformLib => PrePi}/FdtParser.c (100%) rename ArmVirtPkg/{Library/ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c} (53%) create mode 100644 ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel