summaryrefslogtreecommitdiff
path: root/ArmVirtPkg
AgeCommit message (Collapse)Author
2016-04-06ArmVirtPkg: include Virtio10Dxe from OvmfPkgLaszlo Ersek
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-04-01ArmVirtPkg: disable PcdHiiOsRuntimeSupportLaszlo Ersek
Edk2 commit 8a45f80edad4 ("MdeModulePkg: Make HII configuration settings available to OS runtime") implements the optional UEFI feature described in "31.2.11.1 OS Runtime Utilization" in UEFI v2.6. While this feature might show benefits down the road even in QEMU virtual machines, at the moment it only presents drawbacks: - it increases the EfiRuntimeServicesData footprint, - it triggers HII compatibility problems between edk2 and external drivers unconditionally, even if the end-user is not interested in HII and/or in configuring said drivers (see <https://www.redhat.com/archives/vfio-users/2016-March/msg00153.html> and <http://thread.gmane.org/gmane.comp.bios.edk2.devel/9894> for an example). While the feature was being introduced, popular demand for a controlling Feature PCD rose (see <http://thread.gmane.org/gmane.comp.bios.edk2.devel/7626>), which is why we can set it now to FALSE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-03-31ArmVirtPkg/ArmVirtQemu: gate FDT config table install with build optionArd Biesheuvel
This introduces the .DSC define 'PURE_ACPI_BOOT_ENABLE', defaulting to FALSE, which controls the value of the feature PCD 'PcdPureAcpiBoot'. This allows an ArmVirtQemu image to be built that restricts the OS to booting in ACPI mode. This feature is only added to ArmVirtQemu, and not to ArmVirtQemuKernel, the reason being that the latter is mostly intended for development work, where the burden of adding 'acpi=force' if you need it is much more tolerable than when trying to boot an installer on a production KVM guest instance. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-03-31ArmVirtPkg/VirtFdtDxe: make installation of FDT as config table optionalArd Biesheuvel
The arm64 kernel is hardwired to prefer DT over ACPI, unless 'acpi=force' is passed on the kernel command line. The only other way to force the kernel to use ACPI is not to pass an FDT to it in the first place. So introduce a PCD that inhibits the installation of the QEMU supplied FDT as a configuration table. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-03-23ArmVirtPkg: PlatformIntelBdsLib: signal gRootBridgesConnectedEventGroupGuidLaszlo Ersek
The explanation is in the patch titled OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid At this point, this signal doesn't do anything yet. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-23ArmVirtPkg/PlatformIntelBdsLib: rebase to EfiEventGroupSignalLaszlo Ersek
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Quickly-acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-03-17ArmVirtPkg/ArmVirtQemu: move to ARM version of CpuExceptionHandlerLibArd Biesheuvel
Change our resolution for the previously unused CpuExceptionHandlerLib from the null implementation to the newly added implementation specific to AARCH64 and ARM. This is needed since our CpuDxe will start using it in a subsequent patch. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
2016-03-11ArmVirtPkg/VirtFdtDxe: set /chosen/linux,pci-probe-only to 1 in DTBArd Biesheuvel
Unlike Linux on x86, which typically honors the PCI configuration performed by the firmware, Linux on ARM assumes that the PCI subsystem needs to be configured from scratch. This is not entirely unreasonable given the historical background of embedded systems using very basic bootloaders, but is no longer tenable with Linux on arm64 moving to UEFI and ACPI in the server space. For this reason, PCI support in the arm64 kernel running under ACPI is likely to move to the x86 model of honoring the PCI configuration done by the firmware. So let's align with that in our DT based configuration as well, and set the /chosen/linux,pci-probe-only property to 1 in the Device Tree before we hand it to the OS. In case we are exposing an emulated VGA PCI device to the guest, which may subsequently get exposed via the Graphics Output protocol and driven as an efifb by the OS, this ensures the PCI resource allocations for the framebuffer are not overridden, since that would cause the framebuffer to stop working. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-03-02ArmVirtPkg: sync log level comments to DebugLib.hLaszlo Ersek
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-02-26ArmVirtPkg: Add FileExplorerLib.inf to the QEMU dsc filesDandan Bi
Because SecureBootConfigDxe use FileExplorerLib now, but FileExplorerLib is not in the dsc files of the package that use SecureBootConfigDxe. Now add it to pass build. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-02-24ArmVirtPkg: ArmVirtQemu: add driver for Virtio-RNG deviceArd Biesheuvel
This adds the new Virtio-RNG DXE module to the default build of ArmVirtQemu. Note that QEMU needs to be invoked with the 'device virtio-rng-pci' option in order for this device to be exposed to the guest. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-02-24ArmVirtPkg/ArmVirtQemu: limit ACPI support to v5.0 and higherArd Biesheuvel
The ACPI spec predates the AARCH64 architecture by 5 versions, so there is no point in supporting anything below v5.0. So set the PCD that controls the ACPI table generation to the appropriate value. Note that the current consumers of this PCD only check whether bit 1 is set or not (i.e., ACPI v1.0b), but this may change in the future, so let's choose a meaningful value right away. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-02-22ArmVirtPkg: ArmVirtQemu: make ACPI support AARCH64 onlyArd Biesheuvel
No ARM support for ACPI is planned under any OS we intend to run under ArmVirtQemu-ARM, so remove the drivers from the ARM build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-02-18ArmVirtPkg: ArmVirtQemu: expose only 64-bit entry point for v3.0+ SMBIOSArd Biesheuvel
The legacy 32-bit SMBIOS entry point has little use on AARCH64 systems, since many such systems have no 32-bit addressable physical RAM, and so OSes that implement SMBIOS will have to be able to deal with the 64-bit entry point anyway. Given that the OS will map main memory in 1 GB chunks if it can, and that punching a page sized hole (e.g., for SMBIOS data) into it will result in the whole 1 GB chunk being mapped using 2 MB and 4 KB blocks instead, it is important to group memory reservations from the OS as much as we can, and allocating below 4 GB for no good reason interferes with that. This is especially important under virtualization, considering that each *level* of lookup at stage 1 (the guest virtual page table) will result in a full page table walk at stage 2 (the guest PA to host PA mapping). So expose only the 64-bit entry point when the SMBIOS tables adhere to version 3.0 or later. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-02-05ArmVirtPkg: implement ArmVirtQemuKernelArd Biesheuvel
This implements a version of ArmVirtQemu that does not execute in place from emulated NOR flash, but implements the Linux kernel boot protocol, and executes from DRAM instead. This allows UEFI to be loaded as a payload by a previous bootloader stage such as ARM Trusted Firmware/OP-TEE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
2016-02-05ArmVirtPkg: introduce new ArmQemuRelocatablePlatformLibArd Biesheuvel
This introduces ArmQemuRelocatablePlatformLib, which started out as a straight copy of ArmXenRelocatablePlatformLib, but has been modified so that ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf can be used with QEMU as well as with Xen. It retains the self relocation and FDT parsing for the system memory, but uses the QEMU MMU layout. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
2016-02-05ArmVirtPkg/EarlyFdtPL011: allow patchable PCD for initial DT base addressArd Biesheuvel
Allow the use of a patchable PCD for the initial DT base address recorded in gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress, so that the module can be reused by a relocatable version of ArmVirtQemu. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2015-12-17ArmVirtPkg/ArmVirtXen: add ARM supportArd Biesheuvel
This adds ARM support to the ArmVirtXen platform. As is the case for AARCH64, the ARM port adheres to the ARM Linux boot protocol, i.e., it expects the address of a DTB describing the platform to be passed in r2, and relocates itself at runtime to the actual load time memory offset. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19333 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17ArmVirtPkg/ArmXenRelocatablePlatformLib: add ARM supportArd Biesheuvel
This is a port of the AARCH64 low level init routines to ARM. This mainly covers the platform boot code that extracts the system base and size from the DTB, copies it and updates the FD and FV base addresses according to the load time offset. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19332 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17ArmVirtPkg/PrePiRelocatable: add ARM supportArd Biesheuvel
This adds support to the self relocating PrePi instance that is built as a PIE ET_DYN executable. It primarily involves porting the relocation routine to use ELF32 REL entries instead of ELF64 RELA entries which is what AArch64 uses. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19331 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17ArmVirtPkg/XenRelocatablePlatformLib: rewrite DTB memory node retrieval in CArd Biesheuvel
Parsing the DTB early on using a handcoded assembly routine is a pointless waste of brain cycles, since the UEFI firmware always executes from RAM under Xen. So instead, set up a temporary stack in the memory region at the beginning of the image, and use the libfdt C library. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19330 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-14ArmVirtPkg RVCT: build DXE_RUNTIME_DRIVER modules with 4 KB alignmentArd Biesheuvel
This adds the RVCT armlink command line switches to build modules of type DXE_RUNTIME_DRIVER with 4 KB PE/COFF section alignment, allowing the OS to apply stricter permissions to the .text and .data sections. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19237 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-04ArmVirtPkg: HighMemDxe: add memory space for the high memory nodesShannon Zhao
Here we add the memory space for the high memory nodes except the lowest one in FDT. So these spaces will show up in the UEFI memory map. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: rewrap at 79 chars, use NULL, print Status] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19124 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-04ArmVirtPkg: ArmVirtPlatformLib: find the lowest memory nodeShannon Zhao
While QEMU NUMA support on ARM will introduce more than one /memory node in the device tree, it needs to find the lowest one and set PcdSystemMemorySize with the actual size of this memory node. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19123 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-03ArmVirtPkg: use explicit KERNEL_BLOB_TYPE castArd Biesheuvel
The ARM RVCT compiler does not allow implicit casts between enumerated types and integer types. In this particular case, the STUB_FILE::Position member is overloaded as a KERNEL_BLOB_TYPE identifier, so it does not hurt to make that cast explicit. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19108 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30ArmVirtPkg: add secure boot support to 32-bit ARM targetsArd Biesheuvel
Building the 32-bit ARM targets with secure boot enabled requires a library resolution for the ArmSoftfloatLib dependency of OpenSslLib. So provide one. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19032 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-27ArmVirtPkg/PrePi: remove global variable allocation from lowlevel initArd Biesheuvel
Now that we dropped all ArmPlatformGlobalVariableLib dependencies, there is no longer a need to allocate and clear out the global variable region in the PrePi init code. So remove it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18991 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-27ArmVirtPkg: drop ArmPlatformGlobalVariableLib dependencyArd Biesheuvel
Now that all PeiServicesTablePointerLib and PrePiHobListPointerLib library dependencies in both ArmVirtQemu and ArmVirtXen are satisfied by implementations that do not depend on ArmPlatformGlobalVariableLib, we can remove all mention of it from the various .dsc files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18986 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-27ArmVirtPkg/ArmVirtQemu: move to ArmPkg version of PeiServicesTablePointerLibArd Biesheuvel
As pointed out by Eugene, the ArmPlatformPkg implementation of PeiServicesTablePointerLib violates the PI sec, since it uses ArmPlatformGlobalVariableLib to store the PEI services table pointer rather than the thread ID cpu registers as the spec requires. So instead, move to the ArmPkg version of this library, which does adhere to the PI spec. Reported-by: Eugene Cohen <eugene@hp.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18985 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-26ArmVirtPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkgStar Zeng
Beyond just changing the directly related lines in the FDF and DSC files, we have to adapt the EarlyFdtPL011SerialPortLib and FdtPL011SerialPortLib instances as well, in the same patch. This is because the EmbeddedPkg driver expects the SerialPortSetAttributes(), SerialPortSetControl() and SerialPortGetControl() functions from SerialPortExtLib, while the MdeModulePkg driver expects them from SerialPortLib itself. We cannot implement these functions in ArmVirtPkg's SerialPortLib instances *before* flipping the driver, because it would cause double function definitions in the EmbeddedPkg driver. We also can't implement the functions *after* flipping the driver, because it would cause unresolved function references in the MdeModulePkg driver. Therefore we have to implement the functions simultaneously with the driver replacement. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18973 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-24ArmVirtPkg/ArmVirtPlatformLib: reduce ID map size to GCD region sizeArd Biesheuvel
The ID mapping routines on virtual platforms simply map the entire hardware supported physical address space as device memory, and then punch some holes for regions that need to be mapped cacheable. On virtual platforms hosted on CPUs that support a large physical address range, this may result in a lot of overhead, i.e., 4 KB of page tables for each 512 GB of address space, which quickly adds up (i.e., 2 MB for the architectural maximum of 48 bits). Since there may be a platform specific limit to the size of the (I)PA space that is not reflected by CPU id registers, restrict the range of the ID mapping to gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize bits. This makes sense by itself, since we cannot manipulate mappings above that limit anwyay (because they are not covered by GCD), and it allows the PCD be set to a lower value by platforms whose (I)PA space is smaller than the hardware supported maximum. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Wei Huang <wei@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18929 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-24ArmVirtPkg/ArmVirtQemu: limit the (I)PA space to 40 bitsArd Biesheuvel
KVM uses a fixed size of 40 bits for its intermediate physical address space, so there is no need to support anything beyond that even if the host hardware does. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Wei Huang <wei@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18928 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-18ArmVirtPkg/ArmVirtPlatformLib: map executable NOR region as normal memoryArd Biesheuvel
The ARM architecture version 7 and later mandates that device mappings have the XN (non-executable) bit set, to prevent speculative instruction fetches from read-sensitive regions. This implies that we should not map regions as device if we want to execute from them, so the NOR region that contains our FD image should be mapped as normal memory instead. The MMU code deals correctly with overlapping ARM_MEMORY_REGION_DESCRIPTOR entries, and later entries in the array take precedence over earlier ones. So simply add an entry to the end of the array that overrides the mapping attributes of the FD image, wherever it resides. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18889 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-09ArmVirtPkg/PrePi: do not invalidate the entire data cache at startupArd Biesheuvel
Drop the call to ArmInvalidateDataCache () from the PrePi startup sequence. This kind of data cache maintenance should not be performed when running under virtualization. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18757 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16ArmVirtPkg: include BaseStackCheckLib also for AARCH64Mark Rutland
Some AArch64 toolchains also invoke the software stack checker functions on certain code - so include BaseStackCheckLib for AARCH64 as well as for ARM. Since this was the only difference between [LibraryClasses.ARM] and [LibraryClasses.AARCH64], merge the two into the existing [LibraryClasses.common]. At the same time, fix the grammar for the related comments. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18617 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08ArmVirtPkg/ArmVirtQemu: enable non-exec DXE stack for AARCH64Ard Biesheuvel
Enable the non-exec DXE stack feature when building for AARCH64. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18589 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-01ArmVirtPkg: use 4 KB section alignment for ARM DXE_RUNTIME_DRIVER modulesArd Biesheuvel
In order to support the Properties Table memory protection feature on 32-bit ARM, build DXE_RUNTIME_DRIVER type binaries with 4 KB section alignment by setting the common-page-size linker command line option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Zimmermann <sigmaepsilon92@gmail.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18566 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-25ArmVirtPkg: build the TFTP command into the UEFI shellLaszlo Ersek
The TFTP command is easy to use, it has very nice documentation (accessible with "HELP TFTP" in the shell), and it's a very versatile tool for downloading files from the host to the guest, via virtual network, while the guest is in the UEFI shell. Even better, enabling this command in the shell increases the uncompressed FVMAIN size only by 8192 bytes, in my AARCH64 build of VirtArmQemu.dsc, and the final size increase (after LZMA compression) that is visible in the FVMAIN_COMPACT volume is merely 1976 bytes. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18555 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-24ArmVirtPkg: QemuFwCfgLib: read bytes from fw-cfg with DMA when availableLaszlo Ersek
The protocol is documented in "docs/specs/fw_cfg.txt" in the QEMU tree. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18545 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-24ArmVirtPkg: VirtFdtDxe: detect fw-cfg DMA interface from the DTBLaszlo Ersek
A DMA-like transfer interface has recently been implemented in QEMU for fw-cfg. For ARM and AARCH64 virtual machines, the binding prescribes a new 8-byte wide register at offset 0x10 in the register block. Make VirtFdtDxe expose this register if it is present. Please see "docs/specs/fw_cfg.txt" in the QEMU tree for more information. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18544 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-22ArmVirtPkg: reduce preallocation of boot services data pagesArd Biesheuvel
Commit SVN r18503 ("MdeModulePkg DxeCore: Take the range in resource HOB for PHIT as higher priority") changed the GCD init logic to take the sum of the region sizes in gMemoryTypeInformation[] into account when estimating the minimal amount of memory needed to boot the system. Unfortunately, as an unintended side effect, this change results in boot failures of ArmVirtQemu when running with QEMU's default memory size of 128 MB. The reason is that the sum of the gMemoryTypeInformation region sizes plus the size of the inital PEI region exceeds 128 MB. Since we do not actually need to preallocate 20,000 pages' worth of BootServicesData memory, reduce this figure to the more reasonable 12,000. Reported-by: Mark Rutland <mark.rutland@arm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18533 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-18ArmVirtPkg: PlatformIntelBdsLib: signal ReadyToBoot on direct kernel bootLaszlo Ersek
According to the UEFI spec, EFI_EVENT_GROUP_READY_TO_BOOT "is notified by the system when the Boot Manager is about to load and execute a boot option". ArmVirtPkg doesn't do this currently when launching a kernel from the QEMU command line. OvmfPkg does (see git commit 28a34033ee). At least two edk2-wide callbacks are worth mentioning: - OnReadyToBoot() in "MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c" performs variable reclaim and (optionally) installs variable usage statistics as a vendor config table; - OnReadyToBoot() in "SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c" installs the image execution info table if it doesn't exist yet, in SecureBoot-enabled builds. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18513 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-09ArmVirtPkg: set max physical address width to 40 bitsArd Biesheuvel
When executing on a LPAE capable 32-bit ARM platform, we support up to 40 bits of physical address space so set PcdPrePiCpuMemorySize accordingly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18428 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-09ArmVirtPkg/ArmVirtMemoryInitPeiLib: handle memory above 4 GB on 32-bit ARMArd Biesheuvel
On 32-bit ARM, split system memory into a region below (and up to) 4 GB and a region above 4 GB. This is necessary to get the DXE core to consider the former as the resource descriptor that describes the primary memory region that also covers the PHIT region. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18427 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-26ArmVirtPkg: revert unintended change to ArmVirt.dsc.incArd Biesheuvel
The recent changes to ArmVExpress-FVP-AArch64 in SVN r18309 contained a hunk to ArmVirt.dsc.inc which was included in error. So remove it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18321 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25ArmPlatformPkg/FVP: unify support for Foundation and Base modelsArd Biesheuvel
Now that the PL180 and PL111 drivers know how to behave when executed on the Foundation model (which does not emulate the hardware), we can remove the ARM_FOUNDATION_FVP ifdefs and produce a single build that runs on both the Foundation model and the Base model. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18309 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25ArmVirtPkg: Link separated VarCheckUefiLib NULL class library instanceStar Zeng
Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18290 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25ArmVirtPkg: Add VarCheckLib library mappingStar Zeng
Since Variable driver has been updated to consume the separated VarCheckLib. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18283 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-11ArmVirtPkg: use global section alignment in custom linker scriptArd Biesheuvel
The ArmVirtPrePiUniCoreRelocatable module comes with its own GNU linker script to create a PIE executable that can relocate itself at runtime. In order to be able to build this module using CLANG, we need to adhere to the section alignment passed via to the linker using -z commmon-page-size, so add this to the linker script. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18203 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-11ArmVirtPkg: avoid relocated immediates in AARCH64 asmArd Biesheuvel
The relocated immediate notation supported by GNU as (e.g., #:lo12:foo) is not supported by clang. Since we are loading a constant value, they were not entirely appropriate here anyway, so simply replace them with assembler arithmetic expressions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18202 6f19259b-4bc3-4df7-8a09-765794883524