From patchwork Wed Nov 22 10:07:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 119443 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6489088qgn; Wed, 22 Nov 2017 02:07:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMZW0lm6YMBJqSztDd8QnCDxVC8p0xJI/tcGazayT+FfxWLLLCitaNx5eofxMFK9q3533xUD X-Received: by 10.101.91.193 with SMTP id o1mr6489745pgr.373.1511345264828; Wed, 22 Nov 2017 02:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511345264; cv=none; d=google.com; s=arc-20160816; b=pRCG7u6HfBs8Dhk0/iqRrZ1RnNI6Q+5TDmM18DWU9gQDv0KkczZ9zV2zh6UWhCcbKZ mM4EiJFIZjlQ5XEwiymFVL13wjrvhsrCpL9ds5/pNNzNgxxa84nfxPHqMWNfnyGSfvfo mJhWhV8s6fzFVovD/x3rN6NtDNSxw8Mr3Ai2RwD/nJbf/Eb0U5d7LauJH0XaCW4Eymrj rqZ3zqEXMhmv4KdAFk676IDAd9Rxip4iT5nYL6UfqLrWe7XP2UnlXUaa860vDMVPhKye VjCDStRWTCymV+dtkCC91Qd3Aint3KSeS43Ynww41GBEUmQHiZ9Jy8vngIavgh0JhyWO dCTQ== 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=HOR4I5i+h+HkYmj8XER6PrcRq9kaEZVn9pai2VX/zX0=; b=uEk4PwbzPVTsU86gGkQkoVas6xipPsuMQbUk7ilYVNEWtU0XwDS7vDnN43FrSfxyvK dXyUBL0WXkRHJLhMN34I9FPaLDoXSDC5tc9nbIky/bt99ibf24cfN0alVOPdQ8zhZ+82 JeBLRIGkidJP9yLiQVBteXGZgOpiBmpMP2p5ASSVN/JfGSjU3+y6NpNN6ip7XwbRPVn1 hcyJ0NUZtX7uggvJYCFV19rE/Nr9i3gbqbe3tamdssVDKe+Jaf/zqXybLCpYQyQiM/t1 ienT5DgI3VpZQbDjwCPoBp1gA+pEG8GyR3RvEAQ8iPqOOpZsv/lNJinU/3IKhKn8pVlF ZzSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aJUa5i5X; 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 w4si11765488plp.270.2017.11.22.02.07.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 02:07:44 -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=aJUa5i5X; 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 138AD220C1606; Wed, 22 Nov 2017 02:03:28 -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:c09::241; helo=mail-wm0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (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 A9ADB220C1600 for ; Wed, 22 Nov 2017 02:03:25 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id u83so9120884wmb.5 for ; Wed, 22 Nov 2017 02:07:41 -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=DdXZ+6kZckJQfAdRcbQsOkYqgqw96JlJWibKbpOfG+k=; b=aJUa5i5Xe7kBotYeC0ksDaNSPHBQ8qw0p+qwyIAIzunEuJACJkXpJsRX8s3HGomJYz /1rL21nzfDBSEM3z7N9OT07Uo6+PzV9s02CoGCSg+vnpVeki2ryLpezUuxmJvgwr2de2 c6STOHlHKcgdSxSe22JuCA7MowAWXKpQ5srGA= 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=DdXZ+6kZckJQfAdRcbQsOkYqgqw96JlJWibKbpOfG+k=; b=Yu9ihuoF16wfhtqtedTJums5o5bD9x9+Czr/ApzoDjpJ+rrjBv5aRhAzIvsu6EiEhJ DpnNksbS+ocwnxMGb0sA5598pFQacLaZtbM3z/SKN1fXatT0BsgKND4rEeTp8fzBXHf7 fiFXiR9vzTmjy9AtEhkOhlffwNPnhnWvyplvd4IVXxOBAp63H0Qc8lD7ZAh4QXURgdz/ oPMq+wMW6bgi8Xm1vYG3WqgwuRMwNrGFpp4iNqEaaGN0+GXj68blU7k/9yhoMmZxgMug xPw9LRlw54Za8qAEbx3g53z6kyMinY1rWkGkbZr5de74ZTALXu2eQxsG2s0rDnGJw112 DoSg== X-Gm-Message-State: AJaThX7Ow4PFNsLG12+mETzbdLjUIXpQnaSGr5jKkCUCglHB1FO2nJCg 5Tk9yQLUgzRzYoxfZCJc7FVtLCQa6zg= X-Received: by 10.28.237.14 with SMTP id l14mr4108168wmh.88.1511345259180; Wed, 22 Nov 2017 02:07:39 -0800 (PST) Received: from localhost.localdomain ([154.145.25.106]) by smtp.gmail.com with ESMTPSA id i192sm2761457wmf.46.2017.11.22.02.07.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 02:07:38 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Wed, 22 Nov 2017 10:07:17 +0000 Message-Id: <20171122100731.24525-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH v2 00/14] 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: 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. v2: drop ArmPlatformPkg prereq patch, it is merged now use constructor instead of PEIM depex ordering to ensure ArmVirtQemu's PcdSystemMemorySize PCD is set before being consumed add acks from Laszlo Ard Biesheuvel (14): ArmVirtPkg/PrePi: run all library constructors by hand ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function ArmVirtPkg/PrePi: remove bogus primary core check ArmVirtPkg/PrePi: move DRAM discovery code into PrePi ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib 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: create QemuVirtMemInfoLib version for ArmVirtQemu ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib ArmVirtPkg: remove ArmPlatformLib implementations ArmVirtPkg/ArmVirt.dsc.inc | 1 - ArmVirtPkg/ArmVirtPkg.dec | 3 + ArmVirtPkg/ArmVirtQemu.dsc | 5 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- ArmVirtPkg/ArmVirtXen.dsc | 2 +- ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h | 41 ++++++ 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/{ArmVirtPlatformLib/AARCH64/VirtHelper.S => QemuVirtMemInfoLib/AArch64/PhysAddrTop.S} | 33 +---- ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S | 24 ++++ ArmVirtPkg/Library/{ArmQemuRelocatablePlatformLib/QemuVirtMem.c => QemuVirtMemInfoLib/QemuVirtMemInfoLib.c} | 62 ++++----- ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf | 54 ++++++++ ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf | 58 ++++++++ ArmVirtPkg/Library/{ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c} | 92 +++---------- ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S | 39 ++++++ ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S | 24 ++++ ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c | 63 +++++++++ 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 | 7 - 38 files changed, 562 insertions(+), 1504 deletions(-) create mode 100644 ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.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 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} (58%) create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf rename ArmVirtPkg/Library/{ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c} (52%) 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%) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel