summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg
Commit message (Collapse)AuthorAgeFilesLines
...
* ArmVirtPkg: Remove RealView Debugger lines from ArmVirtPkg.dsc.incRebecca Cran2023-01-301-7/+0
| | | | | | | | | | Since RvdPeCoffExtraActionLib has been deleted, remove lines referencing it and the RealView Debugger from ArmVirtPkg.dsc.inc. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Bob Feng <bob.c.feng@intel.com>
* ArmVirtPkg/PlatformCI: Perform build test of ArmVirtKvmToolArd Biesheuvel2023-01-262-0/+57
| | | | | | Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
* ArmVirtPkg/PlatformCI: Add CI coverage for ArmVirtQemuKernelArd Biesheuvel2023-01-264-2/+83
| | | | | | | | | | | | | | ArmVirtQemuKernel.dsc describes a firmware build that is loadable at arbitrary address and can be invoked using the Linux/arm64 kernel boot protocol. The early code deviates significantly from ArmVirtQemu, and so it makes sense to cover this platform in CI even if it is not widely used. This ensures that the relocatable PrePi and other components in EmbeddedPkg don't regress on ARM as they are being updated for use on TDVF. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
* ArmVirtPkg/PlatformCI: Enable optional features on Qemu AARCH64 buildsArd Biesheuvel2023-01-261-3/+3
| | | | | | | | | To increase the CI coverage, enable secure boot, TPM2 support and HTTPS boot on ArmVirtQemu builds used in CI. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
* ArmVirtPkg/PlatformCI: factor out reusable PlatformBuildLib.pyArd Biesheuvel2023-01-263-23/+39
| | | | | | | | | | | | In order to reduce the amount of code duplication, refactor the PlatformBuild.py script that builds ArmVirtQemu.dsc into a reusable PlatformBuildLib.py containing most of the bits and pieces, and a small QemuBuild.py which is specific to the DSC in question. Suggested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
* ArmVirtPkg/ArmVirtQemu: enlarge initial flash mappingArd Biesheuvel2023-01-261-1/+3
| | | | | | | | | | | The initial ID map used by ArmVirtQemu only covers 2 MiB of NOR flash, while the NOOPT build can be up to 3 MiB in size, resulting in a crash if the unmapped 1 MiB is accessed before the real page tables are up. So increate the initial flash mapping to 4 MiB. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* ArmVirtPkg/PrePi: Ensure timely execution of library constructorsArd Biesheuvel2023-01-261-3/+3
| | | | | | | | | | | | | PrePi has a bare metal entry point, and so it is in charge of calling the library constructors once the C runtime has been initialized sufficiently. However, we are now relying on a HOB to have been constructed by the time the MMU code runs, and so the constructors should be run before that. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* ArmVirtPkg: CI: use ubuntu-22.04 vm_image (Linux only)Oliver Steffen2023-01-171-1/+1
| | | | | | | | | | | | Switch over to ubuntu-22.04 as the vm_image for Linux CI jobs. The previously used ubuntu-18.04 which is not available anymore since Dec 1st 2022. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* ArmVirtPkg: CI: Use Fedora 35 container (Linux only)Oliver Steffen2023-01-171-5/+3
| | | | | | | | | | | | | | | | | Run the Linux jobs of the ArmVirtPkg platform CI inside a container, in the same way the general CI does now. Make use of the default image specified in the defaults.yml template. Do not run apt-get in CI jobs to install qemu and gcc dependencies. Assume the container image provides these. Use Python from the container image, do not download at runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* ArmVirtPkg: CI: use Python version from defaults templateOliver Steffen2023-01-171-0/+4
| | | | | | | | | | | | | | | | Use the default Python version from the defaults template (.azurepipelines/templates/defaults.yml) in the Windows and Linux CI jobs. Previous changes to the CI job templates make it necessary to specify a version number, if Python shall be pulled at CI runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* ArmVirt: don't use unaligned CopyMem () on NOR flashGerd Hoffmann2023-01-163-3/+15
| | | | | | | | | | | | | | | | | Commit 789a72328553 reclassified the NOR flash region as EFI_MEMORY_WC in the OS visible EFI memory map, and dropped the explicit aligned CopyMem() implementation, in the assumption that EFI_MEMORY_WC will be honored by the OS, and that the region will be mapped in a way that tolerates misaligned accesseses. However, Linux today uses device attributes for all EFI MMIO regions, in spite of the memory type attributes, and so using misaligned accesses is never safe. So instead, switch to the generic CopyMem() implementation entirely, just like we already did for VariableRuntimeDxe. Fixes: 789a72328553 ("OvmfPkg/VirtNorFlashDxe: use EFI_MEMORY_WC and drop AlignedCopyMem()") Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: Avoid early ID map on ThunderXArd Biesheuvel2023-01-102-0/+20
| | | | | | | | | | | | | | | | | | | | | The early ID map used by ArmVirtQemu uses ASID scoped non-global mappings, as this allows us to switch to the permanent ID map seamlessly without the need for explicit TLB maintenance. However, this triggers a known erratum on ThunderX, which does not tolerate non-global mappings that are executable at EL1, as this appears to result in I-cache corruption. (Linux disables the KPTI based Meltdown mitigation on ThunderX for the same reason) So work around this, by detecting the CPU implementor and part number, and proceeding without the early ID map if a ThunderX CPU is detected. Note that this requires the C code to be built with strict alignment again, as we may end up executing it with the MMU and caches off. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: dann frazier <dann.frazier@canonical.com>
* ArmVirtPkg/ArmPlatformLibQemu: Ensure that VFP is on before running C codeArd Biesheuvel2023-01-101-7/+5
| | | | | | | | | | | | Now that we build the early code without strict alignment and without suppressing the use of SIMD registers, ensure that the VFP unit is on before entering C code. While at it, simplyify the mov_i macro, which is only used for 32-bit quantities. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: dann frazier <dann.frazier@canonical.com>
* ArmVirtPkg: Remove CcProbeLib from ArmVirtQemu.dscMin M Xu2022-12-221-1/+0
| | | | | | | | | | | Since CcProbeLib is not used in AcpiPlatformDxe, CcProbeLib can be removed from ArmVirtQemu.dsc. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
* ArmVirtPkg: Add reference to new build instructionsMichael Kubacki2022-12-161-0/+3
| | | | | | | | | | | | | | | | Adds a reference to the new build instructions on the TianoCore wiki that currently describe building with containers and Stuart. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
* OvmfPkg/AcpiPlatformDxe: Differentiate TDX case for Cloud HypervisorSebastien Boeuf2022-12-161-0/+1
| | | | | | | | | | | | Rely on CcProbe() to identify when running on TDX so that ACPI tables can be retrieved differently for Cloud Hypervisor. Instead of relying on the PVH structure to find the RSDP pointer, the tables are individually passed through the HOB. Signed-off-by: Jiaqi Gao <jiaqi.gao@intel.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Reviewed-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* ArmVirtPkg: Kvmtool: Add RNG support using Arm TRNG interfaceSami Mujawar2022-11-062-0/+15
| | | | | | | | | | | | | | Bugzilla: 3668 (https://bugzilla.tianocore.org/show_bug.cgi?id=3668) The EFI_RNG_PROTOCOL published by RngDxe has been updated to implement the EFI_RNG_ALGORITHM_RAW using the Arm TRNG interface to provide access to entropy. Therefore, enable EFI_RNG_PROTOCOL for the Kvmtool guest/virtual firmware. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtKvmTool: Migrate to OVMF's VirtNorFlashDxeArd Biesheuvel2022-10-274-15/+15
| | | | | | | | Migrate to the virt specific NOR flash driver as the ArmPlatformPkg is going away. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
* ArmVirtPkg/ArmVirtQemu: migrate to OVMF's VirtNorFlashDxeArd Biesheuvel2022-10-275-13/+13
| | | | | | | | Switch to the virt specific NorFlashDxe driver implementation that was added recently. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
* ArmVirtPkg/ArmVirtQemu: Clear XIP flags instead of overriding themArd Biesheuvel2022-10-261-1/+1
| | | | | | | | | | | | Clang does not support undoing the effects of -mstrict-align by passing the -mno-strict-align counterpart, so appending the latter to the compiler's XIPFLAGS does not work. Instead, clear the flags entirely. This also removes -mgeneral-regs-only, but this is fine - we can tolerate SIMD codegen in PEIMs or BASE libraries as they run with the MMU and caches enabled. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: omit PCD PEIM unless TPM support is enabledArd Biesheuvel2022-10-262-6/+18
| | | | | | | | | The TPM discovery code relies on a dynamic PCD to communicate the TPM base address to other components. But no other code relies on dynamic PCDs in the PEI phase so let's drop the PCD PEIM when TPM support is not enabled. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/QemuVirtMemInfoLib: use HOB not PCD to record the memory sizeArd Biesheuvel2022-10-268-25/+75
| | | | | | | | | | | Due to the way we inherited the formerly fixed PCDs to describe the system memory base and size from ArmPlatformPkg, we ended up with a MemoryInit PEIM that relies on dynamic PCDs to communicate the size of system memory between the constructor of one of its library dependencies and the core module. This is unnecessary, and forces us to incorporate the PCD PEIM as well, for no good reason. So instead, let's use a HOB. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: avoid shadowing PEIMs unless necessaryArd Biesheuvel2022-10-261-0/+3
| | | | | | | | | Some PEIMs register for shadow execution explicitly, but others exist that don't care and can happily execute in place. Since the emulated NOR flash is just RAM, shadowing has no performance benefits so let's only do this if needed. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: Drop unused variable PEIMArd Biesheuvel2022-10-262-3/+0
| | | | | | | The variable PEIM is included in the build but its runtime prerequisites are absent so it is never dispatched. Just drop it. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: enable initial ID map at early bootArd Biesheuvel2022-10-262-4/+15
| | | | | | | | | | | | | | | | Now that we have all the pieces in place, switch the AArch64 version of ArmVirtQemu to a mode where the first thing it does out of reset is enable a preliminary ID map that covers the NOR flash and sufficient DRAM to create the UEFI page tables as usual. The advantage of this is that no manipulation of memory occurs any longer before the MMU is enabled, which removes the need for explicit coherency management, which is cumbersome and bad for performance. It also means we no longer need to build all components that may execute with the MMU off (including BASE libraries) with strict alignment. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: use first 128 MiB as permanent PEI memoryArd Biesheuvel2022-10-262-0/+163
| | | | | | | | | | | | In order to allow booting with the MMU and caches enabled really early, we need to ensure that the code that populates the page tables can access those page tables with the statically defined ID map active. So let's put the permanent PEI RAM in the first 128 MiB of memory, which we will cover with this initial ID map (as it is the minimum supported DRAM size for ArmVirtQemu). Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: implement ArmPlatformLib with static ID mapArd Biesheuvel2022-10-264-0/+276
| | | | | | | | | | | | | | To substantially reduce the amount of processing that takes place with the MMU and caches off, implement a version of ArmPlatformLib specific for QEMU/mach-virt in AArch64 mode that carries a statically allocated and populated ID map that covers the NOR flash and device region, and 128 MiB of DRAM at the base of memory (0x4000_0000). Note that 128 MiB has always been the minimum amount of DRAM we support for this configuration, and the existing code already ASSERT()s in DEBUG mode when booting with less. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/ArmVirtQemu: wire up timeout PCD to Timeout variableArd Biesheuvel2022-10-261-0/+2
| | | | | | | | Use the appropriate PCD definition in the ArmVirtQemu DSC so that the boot timeout is taken from the Timeout variable automatically, which is what Linux tools such as efibootmgr expect. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: make EFI_LOADER_DATA non-executableArd Biesheuvel2022-10-261-1/+1
| | | | | | | | | | | | | When the memory protections were implemented and enabled on ArmVirtQemu 5+ years ago, we had to work around the fact that GRUB at the time expected EFI_LOADER_DATA to be executable, as that is the memory type it allocates when loading its modules. This has been fixed in GRUB in August 2017, so by now, we should be able to tighten this, and remove execute permissions from EFI_LOADER_DATA allocations. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: do not enable iSCSI driver by defaultArd Biesheuvel2022-10-242-2/+2
| | | | | | | | | | | | | The iSCSI driver slows down the boot on a pristine variable store flash image, as it creates a couple of large EFI non-volatile variables to preserve state between boots. Since iSCSI boot for VMs is kind of niche anyway, let's default to disabled. If someone needs it in their build, they can use the -D build command option to re-enable it on the fly. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
* ArmVirtPkg: remove EbcDxe from all platformsArd Biesheuvel2022-10-244-20/+0
| | | | | | | | The EBC interpreter is rarely, if ever, used on ARM, and is especially pointless on virtual machines. So let's drop it from the builds. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
* ArmPkg, ArmVirtPkg: put SpellCheck in AuditOnly modeArd Biesheuvel2022-09-101-1/+1
| | | | | | | | | | Don't allow spelling errors to break the CI build and inadvertently reject pull requests - spelling is important but not that important. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Rebecca Cran <rebecca@quicinc.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* CloudHv/arm: switch PeiMemLib to its ownJianyong Wu2022-09-061-1/+1
| | | | | | | | As Cloud Hypervisor has its own PeiMemLib, change it in dsc file accordingly. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
* CloudHv/arm: add PeiMemInfoLibJianyong Wu2022-09-063-0/+332
| | | | | | | | | | | | | | | Memory layout in CLoud Hypervisor for arm is changed and is different with Qemu, thus we should build its own PeiMemInfoLib. The main change in the memory layout is that normal ram may not contiguous under 4G. The top 64M under 4G is reserved for 32bit device. What this patch does: 1. get all of the memory node from DT; 2. Init page table for each memory node; 3. Add all of the memory nodes to Hob; Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
* ArmVirtPkg: Remove duplicated wordsPierre Gondois2022-09-051-1/+1
| | | | | | | | In an effort to clean the documentation of the above package, remove duplicated words. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.muajwar@arm.com>
* ArmVirtPkg: Fix KVM Guest FirmwareEdward Pickup2022-08-021-1/+1
| | | | | | | | | Fix build of KVM Guest Firmware, broken by commit 4c55f6394faf ("MdePkg: IORT header update for IORT Rev E.d spec") Signed-off-by: Edward Pickup <edward.pickup@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: Pipeline: Resolving newly introduced dependencyKun Qin2022-07-091-0/+1
| | | | | | | | | | | | | | | The new changes in SecureBootVariableLib brought in a new dependency of PlatformPKProtectionLib. This change added the new library instance from SecurityPkg to resolve ArmVirtPkg builds. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kun Qin <kuqin12@gmail.com>
* ArmVirtPkg: Include DxeHardwareInfoLib library class in dscNicolas Ojeda Leon2022-06-242-1/+1
| | | | | | | | | | | Include DxeHardwareInfoLib class in the common ArmVirt.dsc.inc so that ArmVirt* platforms use it during build given that PciHostBridgeUtilityLib depends on it. Cc: Alexander Graf <graf@amazon.de> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Nicolas Ojeda Leon <ncoleon@amazon.com>
* Ovmf/HardwareInfoLib: Add Dxe lib to dynamically parse heterogenous dataNicolas Ojeda Leon2022-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the Hardware Info library, create the DxeHardwareInfoLib which implements the whole API capable of parsing heterogeneous hardware information. The list-like API grants callers a flexible and common pattern to retrieve the data. Moreover, the initial source is a BLOB which generalizes the host-to-guest transmission mechanism. The Hardware Info library main objective is to provide a way to describe non-discoverable hardware so that the host can share the available resources with the guest in Ovmf platforms. This change features and embraces the main idea behind the library by providing an API that parses a BLOB into a linked list to retrieve hardware data from any source. Additionally, list-like APIs are provided so that the hardware info list can be traversed conveniently. Similarly, the capability is provided to filter results by specific hardware types. However, heterogeneous elements can be added to the list, increasing the flexibility. This way, a single source, for example a fw-cfg file, can be used to describe several instances of multiple types of hardware. This part of the Hardware Info library makes use of dynamic memory and is intended for stages in which memory services are available. A motivation example is the PciHostBridgeLib. This library, part of the PCI driver populates the list of PCI root bridges during DXE stage for future steps to discover the resources under them. The hardware info library can be used to obtain the detailed description of available host bridges, for instance in the form of a fw-cfg file, and parse that information into a dynmaic list that allows, first to verify consistency of the data, and second discover the resources availabe for each root bridge. Cc: Alexander Graf <graf@amazon.de> Cc: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Nicolas Ojeda Leon <ncoleon@amazon.com>
* Ovmf/HardwareInfoLib: Create Pei lib to parse directly from fw-cfgNicolas Ojeda Leon2022-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define the HardwareInfoLib API and create the PeiHardwareInfoLib which implements it, specifically for Pei usage, supporting only static accesses to parse data directly from a fw-cfg file. All list-like APIs are implemented as unsupported and only a fw-cfg wrapper to read hardware info elements is provided. The Hardware Info library is intended to describe non-discoverable hardware information and share that from the host to the guest in Ovmf platforms. The QEMU fw-cfg extension for this library provides a first variation to parse hardware info by reading it directly from a fw-cfg file. This library offers a wrapper function to the plain QmeuFwCfgReadBytes which, specifically, parses header-data pairs out of the binary values in the file. For this purpose, the approach is incremental, reading the file block by block and outputting the values only for a specific known hardware type (e.g. PCI host bridges). One element is returned in each call until the end of the file is reached. Considering fw-cfg as the first means to transport hardware info from the host to the guest, this wrapping library offers the possibility to statically, and in steps, read a specific type of hardware info elements out of the file. This method reads one hardware element of a specific type at a time, without the need to pre-allocate memory and read the whole file or dynamically allocate memory for each new element found. As a usage example, the static approach followed by this library enables early UEFI stages to use and read hardware information supplied by the host. For instance, in early times of the PEI stage, hardware information can be parsed out from a fw-cfg file prescinding from memory services, that may not yet be available, and avoiding dynamic memory allocations. Cc: Alexander Graf <graf@amazon.de> Cc: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Nicolas Ojeda Leon <ncoleon@amazon.com>
* ArmVirtPkg/ArmVirt.dsc.inc: Add VariableFlashInfoLibMichael Kubacki2022-05-191-0/+1
| | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479 Adds an instance of VariableFlashInfoLib to the platform build as it is a new library class introduced in MdeModulePkg. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Julien Grall <julien@xen.org> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Remove RVCT supportRebecca Cran2022-05-131-4/+0
| | | | | | | | RVCT is obsolete and no longer used. Remove support for it. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg: clear PcdConOut{Row,Column}Gerd Hoffmann2022-04-222-0/+4
| | | | | | | | | ConSplitterDxe will pick the highest available resolution then, thereby making better use of the available display space. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* 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>