summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg
Commit message (Collapse)AuthorAgeFilesLines
* ArmVirtPkg/ArmVirtKvmTool: wire up configurable timeoutArd Biesheuvel2022-02-251-2/+3
| | | | | | | | | | | | | Use the correct PCD type for PcdPlatformBootTimeOut so it gets wired up to the Timeout EFI variable automatically, which is how the boot manager stores the timeout preference. Note that this changes the default to 5 seconds, which appears to be common across platforms. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg/ArmVirtMemoryInitPeiLib: avoid redundant cache invalidationArd Biesheuvel2022-02-251-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | Alex reports that the cache invalidation performed by ArmVirtMemoryInitPeiLib takes a non-negligible amount of time at boot. This cache invalidation used to be necessary to avoid inconsistencies between the CPU's cached and uncached views of the permanent PEI memory region, given that the PEI phase is where the MMU gets enabled. The only allocations done from permanent PEI memory with the MMU off are pages used for page tables, and since commit 748fea6279ef ("ArmPkg/ArmMmuLib AARCH64: invalidate page tables before populating them"), each of those is invalidated in the caches explicitly, for reasons described in the patch's commit log. All other allocations done in PEI are either from temporary PEI memory, which includes the stack, or from permanent PEI memory but after the MMU has been enabled. This means that the cache invalidation in ArmVirtMemoryInitPeiLib is no longer necessary, and can simply be dropped. Reported-by: Alexander Graf <graf@amazon.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Alexander Graf <graf@amazon.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/Kvmtool: Enable AcpiviewSami Mujawar2022-02-012-2/+8
| | | | | | | | | | | | | Acpiview is a command line tool allowing to display, dump, or check installed ACPI tables. Add a 'ACPIVIEW_ENABLE' switch to enable it on an ArmVirt platform. The switch is set for the ArmVirtKvmTool platform. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/Kvmtool: Enable ACPI supportSami Mujawar2022-02-012-4/+28
| | | | | | | | | | | | | | | A Configuration Manager that uses the Dynamic Tables framework to generate ACPI tables for Kvmtool Guests has been provided. This Configuration Manager uses the FdtHwInfoParser module to parse the Kvmtool Device Tree and generate the required Configuration Manager objects for generating the ACPI tables. Therefore, enable ACPI table generation for Kvmtool. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3742 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/Kvmtool: Add Configuration ManagerSami Mujawar2022-02-013-0/+1244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Configuration Manager to enable ACPI tables for Kvmtool firmware. The Configuration Manager for Kvmtool uses the DT Hardware Information Parser module (FdtHwInfoParser) to parse the DT provided by Kvmtool. The FdtHwInfoParser parses the DT and invokes the callback function HW_INFO_ADD_OBJECT to add the Configuration Manager objects to the Platform Information repository. The information for some Configuration Manager objects may not be available in the DT. Such objects are initialised locally by the Configuration Manager. Support for the following ACPI tables is provided: - DBG2 - DSDT (Empty stub) - FADT - GTDT - MADT - SPCR - SSDT (Cpu Hierarchy) - SSDT (Pcie bus) Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/Kvmtool: Add DSDT ACPI tableSami Mujawar2022-02-011-0/+21
| | | | | | | | | | | | | | | | Most ACPI tables for Kvmtool firmware are dynamically generated. The AML code is also generated at runtime for most components in appropriate SSDTs. Although there may not be much to describe in the DSDT, the DSDT table is mandatory. Therefore, add an empty stub for DSDT. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: Add cspell exceptionsPierre Gondois2022-02-011-1/+5
| | | | | | | | The cpsell tool checks for unknown words in the upstream CI. Add some new words to the list of exceptions. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg/BaseCachingPciExpressLib: Migrate BaseCachingPciExpressLibAbner Chang2022-01-294-1467/+4
| | | | | | | | | | | | | | | Move BaseCachingPciExpressLib library from ArmVirtPkg to under OvmfPkg. RISC-V Virt platform can leverage the same library to access PCI Express registers through PCI Express base address set in PcdPciExpressBaseAddress and cached in a global variable. Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Abner Chang <abner.chang@hpe.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: change qemu default resolution to 1280x800Gerd Hoffmann2022-01-292-4/+4
| | | | | | | | | | | | | | ovmf default display resolution is 800x600. This is rather small for modern guests. qemu used 1024x768 as default for a long time and switched the to 1280x800 recently[1] for the upcoming 7.0 release. This patch brings ovmf in sync with the recent qemu update and likewise switches the default to 1280x800. [1] https://gitlab.com/qemu-project/qemu/-/commit/de72c4b7cdf6ec18bfe9fe714aa96e48db6fd895 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg: Generalize AcpiPlatformDxeSebastien Boeuf2021-12-113-3/+3
| | | | | | | | | | | | Don't make the package Qemu centric so that we can introduce some alternative support for other VMMs not using the fw_cfg mechanism. This patch is purely about renaming existing files with no functional change. Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
* ArmVirtPkg: Apply uncrustify changesMichael Kubacki2021-12-0738-1153/+1446
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ArmVirtPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Change complex DEBUG_CODE() to DEBUG_CODE_BEGIN/END()Michael D Kinney2021-12-071-2/+2
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3767 Update use of DEBUG_CODE(Expression) if Expression is a complex code block with if/while/for/case statements that use {}. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Change OPTIONAL keyword usage styleMichael D Kinney2021-12-071-1/+1
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney2021-12-079-26/+26
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: Update YAML to ignore specific ECC files/errorsMichael D Kinney2021-11-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3749 Update package YAML files to ignore ECC errors that are already present. These issues must be fixed in the future, but should not block source code changes for these known issues. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/FdtAbner Chang2021-10-149-171/+7
| | | | | | | | | | | | | | | | | | | Relocate VirtioFdtDxe to OvmfPkg/Fdt, this driver is leverage by both ARM and RISC-V archs. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
* ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/FdtAbner Chang2021-10-146-476/+4
| | | | | | | | | | | | | | | | | | | | | Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt, this library is leverage by both ARM and RISC-V archs. Also use PcdPciMmio32Translation and PcdPciMmio64Translation PCDs provided by MdePkg instead of ArmPkg. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
* ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkgAbner Chang2021-10-144-684/+2
| | | | | | | | | | | | | | | | | | | | Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and rename it to QemuFwCfgLibMmio, this library is leverage by both ARM and RISC-V archs. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
* ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkgAbner Chang2021-10-149-180/+7
| | | | | | | | | | | | | | | | | | | Relocate HighMemDxe to OvmfPkg/Fdt, this library is leverage by both ARM and RISC-V archs. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com>
* ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkgAbner Chang2021-10-146-209/+16
| | | | | | | | | | | | | | | | | | | | | Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is leverage by both ARM and RISC-V archs. Add OvmfPkg/Fdt maintainers in Maintainers.txt Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com>
* ArmPkg: Use PcdPciIoTranslation PCD from MdePkgAbner Chang2021-10-146-6/+6
| | | | | | | | | | | | | | | | | | PcdPciIoTranslation PCD is relocated to MdePkg and leveraged by both ARM and RISC-V arch. This patch removes the one from ArmPkg and address the corresponding changes required for other modules under ArmVirtPkg. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkgAbner Chang2021-10-1427-649/+23
| | | | | | | | | | | | | | | | | This is one of the series patches to restructure the location of modules under ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to parse FDT nodes. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* ArmVirtPkg: Disable the TPM2 platform hierarchyStefan Berger2021-10-052-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Disable the TPM2 platform hierarchy by directly calling ConfigureTpmPlatformHierarchy(). Per the TCG firmware specification "TCG PC Client Platform Firmware Profile Specification" the TPM 2 platform hierarchy needs to be disabled or a random password set and discarded before the firmware passes control to the next stage bootloader or kernel. Current specs are here: https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClient_PFP_r1p05_v23_pub.pdf Section 11 states: "Platform Firmware MUST protect access to the Platform Hierarchy and prevent access to the platform hierarchy by non-manufacturer- controlled components." Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Reference new TPM classes in the build system for compilationStefan Berger2021-10-055-0/+6
| | | | | | | | | | | | | | | | | We just added the same functionality to the OvmfPkg. However, on x86, we could use the notification mechanism around gEfiDxeSmmReadyToLockProtocolGuid to indirectly invoke ConfigureTpmPlatformHierarchy(). Since ARM does not have an SMM mode, we have to use direct invocation of this function at the same place in PlatformBootManagerBeforeConsole() as it is called on x86. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: add SecureBootVariableLib class resolutionGrzegorz Bernacki2021-08-031-0/+2
| | | | | | | | | | | | | | The edk2 patch SecurityPkg: Create library for setting Secure Boot variables. moves generic functions from SecureBootConfigDxe and places them into SecureBootVariableLib. This patch adds SecureBootVariableLib mapping for ArmVirtPkg platform. Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com> Reviewed-by: Sunny Wang <sunny.wang@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: Remove meaningless commentPhilippe Mathieu-Daude2021-07-294-12/+0
| | | | | | | | | | | | | | The "Shell Embedded Boot Loader" description (added in commit 6f5872b1f401) does not add any value, remove it. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Julien Grall <julien@xen.org> Suggested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: add BlobVerifierLibNull to DSCDov Murik2021-07-292-2/+8
| | | | | | | | | | | | | | | | | | | | | This prepares the ground for calling VerifyBlob() in QemuKernelLoaderFsDxe. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ashish Kalra <ashish.kalra@amd.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
* ArmVirtPkg: support Cloud Hypervisor in edk2Jianyong Wu2021-07-073-1/+624
| | | | | | | | | | | | Cloud Hypervisor is KVM based VMM and is implemented in rust. Just like other VMMs it need UEFI support to let ACPI work. That's why Cloud Hypervisor is introduced here. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Install Acpi tables for Cloud HypervisorJianyong Wu2021-07-073-0/+212
| | | | | | | | | | | | | | | | | | There is no device like Fw-cfg in Qemu in Cloud Hypervisor, so a specific Acpi handler is introduced here. The handler implemented here is in a very simple way: 1. acquire the RSDP from the PCD variable in the top ".dsc"; 2. get the XSDT address from RSDP structure; 3. get the ACPI tables following the XSDT structure and install them one by one; 4. get DSDT address from FADT and install DSDT table. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Add PlatformHasAcpiDtDxe for Cloud HypervisorJianyong Wu2021-07-072-0/+121
| | | | | | | | | | | | | | The ArmVirtPkg\PlatformHasAcpiDtDxe implementation is not common and is specific for Qemu. So add a Cloud Hypervisor specific version that decides whether the firmware should expose an ACPI based or a Device Tree based hardware description to an operating system. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Enable PCIe support for KvmtoolSami Mujawar2021-06-222-3/+43
| | | | | | | | | | PCIe support has been added to the Kvmtool virtual machine manager. Therefore, enable PCIe support for Kvmtool firmware. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
* ArmVirtPkg: Add PCIe host bridge utility lib for ArmVirtPkgSami Mujawar2021-06-222-0/+257
| | | | | | | | | | | | | PCIe support has been added to Kvmtool Virtual Machine Manager. The PCI host bridge utility lib is used to retrieve information about the Root Bridges in a platform. Therefore, add an instance of PciHostBridgeUtilityLib as this is required to enable PCIe support for Kvmtool firmware. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
* ArmVirtPkg: Consume MdeLibs.dsc.inc for RegisterFilterLibDandan Bi2021-03-314-0/+8
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246 MdeLibs.dsc.inc was added for some basic/default library instances provided by MdePkg and RegisterFilterLibNull Library was also added into it as the first version of MdeLibs.dsc.inc. So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull which will be consumed by IoLib and BaseLib. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: Add support for HotPlugJiahui Cen via groups.io2021-01-203-0/+3
| | | | | | | | | | | | | | | It is necessary to add padding for hotplugable PCI Devices like pcie-root-port. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059 Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Message-Id: <20210119011302.10908-12-cenjiahui@huawei.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/FdtPciHostBridgeLib: Add extra pci root buses supportJiahui Cen via groups.io2021-01-201-18/+4
| | | | | | | | | | | | | | | | | | | | | In order to take advantages of extra pci root buses in ArmVirtPkg, it is necessary to scan extra root buses when getting root briges. And now PciHostBridgeUtilityLib already provides a set of utility functions that support for extra pci root buses, like PciHostBridgeUtilityGetRootBridges() / PciHostBridgeUtilityFreeRootBridges(). So let's rebase ArmVirtPkg/FdtPciHostBridgeLib to PciHostBridgeUtilityGetRootBridges() / PciHostBridgeUtilityFreeRootBridges() to extend ArmVirtPkg with extra pci root buses support. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059 Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Message-Id: <20210119011302.10908-11-cenjiahui@huawei.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/FdtPciHostBridgeLib: Refactor init/uninit of root bridgeJiahui Cen via groups.io2021-01-202-64/+61
| | | | | | | | | | | | | | | | Rebase ArmVirtPkg/FdtPciHostBridgeLib to the new PciHostBridgeUtilityInitRootBridge()/PciHostBridgeUtilityUninitRootBridge() utility functions. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059 Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Message-Id: <20210119011302.10908-7-cenjiahui@huawei.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: Refactor with PciHostBridgeUtilityLibJiahui Cen via groups.io2021-01-205-41/+8
| | | | | | | | | | | | | | | | Eliminate currently duplicated code in ArmVirtPkg with the common utility class PciHostBridgeUtilityLib. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059 Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210119011302.10908-3-cenjiahui@huawei.com>
* ArmVirtPkg: disable list length checks in NOOPT and DEBUG buildsLaszlo Ersek2021-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In NOOPT and DEBUG builds, if "PcdMaximumLinkedListLength" is nonzero, then several LIST_ENTRY *node* APIs in BaseLib compare the *full* list length against the PCD. This turns the time complexity of node-level APIs from constant to linear, and that of full-list manipulations from linear to quadratic. (See some example OVMF numbers in the previous patch.) Checking list lengths against an arbitrary maximum -- default value, and current ArmVirtPkg setting: 1,000,000 -- seems useless even in NOOPT and DEBUG builds, while the cost is significant; so set the PCD to 0. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Julien Grall <julien@xen.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3152 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Message-Id: <20210113085453.10168-11-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* ArmVirtPkg: raise PcdShellFileOperationSize to 128KBLaszlo Ersek2021-01-192-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Some UEFI shell commands read and write files in chunks. The chunk size is given by "PcdShellFileOperationSize", whose default in "ShellPkg/ShellPkg.dec" is 4KB (0x1000). The virtio-fs daemon of QEMU advertizes a 128KB maximum buffer size by default, for the FUSE_WRITE operation. By raising PcdShellFileOperationSize 32-fold, the number of FUSE write requests shrinks proportionately, when writing large files. And when a Virtio Filesystem is not used, a 128KB chunk size is still not particularly wasteful. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3125 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Message-Id: <20210113085453.10168-4-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* ArmVirtPkg/.azurepipelines: Enable EDK II CI for stable/* branchesMichael D Kinney2020-12-221-0/+2
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3130 Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ArmVirtPkg: include VirtioFsDxe in the ArmVirtQemu* platformsLaszlo Ersek2020-12-213-3/+6
| | | | | | | | | | | | | Include the VirtioFsDxe driver in the ArmVirtPkg platforms that include Virtio10Dxe. (The virtio-fs device is virtio-1.0-only.) Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3097 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20201216211125.19496-3-lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* ArmVirtPkg/PlatformCI: stick with "ubuntu-18.04" for nowLaszlo Ersek2020-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "vm_image: 'ubuntu-latest'" now refers to Ubuntu Focal (20.04LTS), not Ubuntu Bionic (18.04LTS), according to <https://github.com/actions/virtual-environments/issues/1816>. In Focal, the "qemu" package is a dummy package with no dependencies, and so the actual emulators are not pulled in. Compare: https://packages.ubuntu.com/bionic/qemu https://packages.ubuntu.com/focal/qemu This causes CI runs to fail. It would be best to switch to the "qemu-system" package name, which continues to depend on the emulators: https://packages.ubuntu.com/bionic/qemu-system https://packages.ubuntu.com/focal/qemu-system However, while that package does make the emulators available, the emulators crash. So for now, stick with the previous Ubuntu environment, which continues to be supported, per <https://github.com/actions/virtual-environments/issues/1816>. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20201217204049.26817-2-lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* ArmVirtPkg/ArmVirtQemuKernel.dsc: Enable MD5 while enable iSCSIGao, Zhichao2020-11-171-1/+4
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003 There is a plan to make MD5 disable as default. The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES would be introduced to enable MD5. Make the definition ahead of the change to avoid build error after the MACRO changed. Enable iSCSI. Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Message-Id: <20201112055558.2348-7-zhichao.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/ArmVirtQemu.dsc: Enable MD5 while enable iSCSIGao, Zhichao2020-11-171-1/+5
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003 There is a plan to make MD5 disable as default. The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES would be introduced to enable MD5. Make the definition ahead of the change to avoid build error after the MACRO changed. Enable iSCSI. Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Message-Id: <20201112055558.2348-6-zhichao.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Build-tested-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: Add VariablePolicy engine to ArmVirtPkg platformBret Barkelew2020-11-171-0/+4
| | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: Add kvmtool to package dictionarySami Mujawar2020-10-161-1/+2
| | | | | | | | | | | | | Kvmtool is a virtual machine manager that can be used to launch guest VMs. Support for Kvmtool virtual platform has been added to ArmVirtPkg. Add kvmtool to the ArmVirtPkg dictionary to prevent the CI Spell check plugin from failing. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: Package dependency for MC146818 RTCSami Mujawar2020-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | Kvmtool emulates a MC146818 RTC controller in the MMIO space. To support this the MC146818 RTC driver PcatRealTimeClockRuntimeDxe has been updated to support MMIO accesses. PCDs for RTC Index and Target register base addresses in the MMIO space have been introduced. The KvmtoolRtcFdtClientLib reads the MC146818 RTC MMIO base address region from the Kvmtool device tree and updates the Index and Target register PCDs. As these PCDs are defined in PcAtChipsetPkg.dec, this patch updates the CI script to add this dependency. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: Support for kvmtool virtual platformSami Mujawar2020-10-162-0/+555
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kvmtool is a virtual machine manager that enables hosting KVM guests. Kvmtool emulates certain devices like serial port, RTC, etc. essentially providing a virtual platform. This patch adds support for kvmtool virtual platform. Following is a brief description of the firmware implementation choices: - Serial Port: 16550 UART On some platforms the 16550 UART is interfaced using PCI. Therefore, the 16550 Serial port library is dependent on the PCI library. The 16550 UART driver checks the Device ID represented using the PCD gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo to determine if the UART is behind PCI. If the Device ID is 0xFF then the serial 16550 UART is not behind PCI. On Kvmtool the Serial 16550 UART is not behind PCI, and therefore a combination of BasePciLibPciExpress and BasePciExpressLib is used to satisfy the PCI library dependency. The PcdSerialPciDeviceInfo is also set to 0xFF to indicate that the Serial 16550 UART is not behind PCI. The PCD PcdSerialUseMmio is also set to TRUE to indicate MMIO accesses are required for the UART registers. Additionally two instances of PlatformHookLibs are provided EarlyFdt16550SerialPortHookLib and Fdt16550SerialPortHookLib to patch the PcdSerialRegisterBase so that BaseSerialPortLib16550 and retrieve the base address of the 16550 UART. - Dependency order for Flash FaultTolerantWriteDxe makes use of PCDs (e.g. PcdFlashNvStorageFtwSpareBase64 etc.), which in case of kvmtool will be evaluated based on the CFI flash base address read from the DT. These variables are populated in the NorFlashPlatformLib loaded by ArmVeNorFlashDxe. This results in a dependency issue with FaultTolerantWriteDxe. To resolve this make the NorFlashPlatformLib as a library dependency for FaultTolerantWriteDxe. - RTC Controller A separate patch updates the MC146818 RTC controller driver to support MMIO accesses. A KvmtoolRtcFdtClientLib has been introduced to extract the base addresses of the RTC controller from the platform device tree and map the RTC register space as Runtime Memory. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* ArmVirtPkg: Add Kvmtool Platform Pei LibSami Mujawar2020-10-162-0/+128
| | | | | | | | | | | | | The PlatformPeim() in the PlatformPeiLib is invoked by the PrePiMain() and provides the platform an opportunity to setup the plaform specific HOBs. This PlatfromPeiLib initialises the Kvmtool platform HOBs like the Fdt, 16550BaseAddress, etc. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: 16550 UART Platform hook librarySami Mujawar2020-10-165-0/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BaseSerialPort16550 library invokes the PlatformHookSerialPortInitialize() implemented as part of the PlatformHook library, to perform platform specific initialization required to enable use of the 16550 device. The BaseSerialPort16550 library uses the PcdSerialRegisterBase to obtain the base address of the UART for MMIO operations. Some VMMs like Kvmtool provide the base address of the console serial port in the platform device tree. This patch introduces two instances of the Platform Hook library: 1. EarlyFdt16550SerialPortHookLib - parses the platform device tree to extract the base address of the 16550 UART and update the PCD PcdSerialRegisterBase. 2. Fdt16550SerialPortHookLib - reads the GUID Hob gEarly16550UartBaseAddressGuid (that caches the base address of the 16550 UART discovered during early stages) and updates the PCD PcdSerialRegisterBase. Note: a. The PCD PcdSerialRegisterBase is configured as PatchableInModule. b. A separate patch introduces a PlatformPeiLib that trampolines the 16550 UART base address from the Pcd PcdSerialRegisterBase to the GUID Hob gEarly16550UartBaseAddressGuid. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Acked-by: Laszlo Ersek <lersek@redhat.com>