[PATCH 1/7] efi: add grub_efi_get_dram_base() function for arm*

2017-06-12 Thread Leif Lindholm
Since ARM platforms do not have a common memory map, add a helper function that finds the lowest address region with the EFI_MEMORY_WB attribute set in the UEFI memory map. Required for the arm/arm64 linux loader to restrict the initrd location to where it will be accessible by the kernel at runti

[PATCH 3/7] efi: move fdt helper library

2017-06-12 Thread Leif Lindholm
There is nothing ARM64 (or even ARM) specific about the efi fdt helper library, which is used for locating or overriding a firmware-provided devicetree in a UEFI system - so move it to loader/efi for reuse. Move the fdtload.h include file to grub/efi and move the EFI page size definitions to grub/

[PATCH 2/7] efi: refactor grub_efi_allocate_pages

2017-06-12 Thread Leif Lindholm
Expose a new function, grub_efi_allocate_pages_real(), making it possible to specify allocation type and memory type as supported by the UEFI AllocatePages boot service. Make grub_efi_allocate_pages() a consumer of the new function, maintaining its old functionality. Also delete some left-around

[PATCH 4/7] arm64: make efi linux loader more generic

2017-06-12 Thread Leif Lindholm
In order to enable reuse of the arm64 efi linux loader for arm, change a few function names and macros. Add a global definition of GRUB_PE32_MAGIC in grub/efi/pe32.h. Make the arm64 efi loader (and fdt helpers) 32/64-bit safe. Also update the arm64 xen loader, since it depends on some of the func

[PATCH 0/7] efi: improved correctness, arm unification, and cleanup

2017-06-12 Thread Leif Lindholm
This patch series is really three different ones, but they unite around the need for (and the implementation) of more flexible control of memory allocation on UEFI systems. 1: Adding new interfaces - A function for detecting the start address of RAM Since ARM platforms have no standardised memor

[PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE

2017-06-12 Thread Leif Lindholm
With upcoming changes to EDK2, allocations of type EFI_LOADER_DATA may not return regions with execute ability. Since modules are loaded onto the heap, change the heap allocation type to GRUB_EFI_LOADER_CODE in order to permit execution on systems with this feature enabled. Closes: 50420 Signed-o

[PATCH 6/7] efi: restrict arm/arm64 linux loader initrd placement

2017-06-12 Thread Leif Lindholm
The 32-bit arm Linux kernel is built as a zImage, which self-decompresses down to near start of RAM. In order for an initrd/initramfs to be accessible, it needs to be placed within the first ~768MB of RAM. The initrd loader built into the kernel EFI stub restricts this down to 512MB for simplicity

[PATCH 5/7] arm: reuse arm64 linux loader on efi systems

2017-06-12 Thread Leif Lindholm
The original 32-bit arm EFI Linux loader reused the 32-bit Linux loader for U-Boot. However, this meant it was acting in an entirely not UEFI-compliant fashion. Since EFI stub loader support for arm went into upstream Linux for 4.5, we can now reuse the same loader as is used on arm64. This resul

[PATCH] ehci: fix build error of print format specifier

2017-06-12 Thread Michael Chang
It is introduced by commit e058df7b5a9cc7aaa9872eaa916b715544a8f9840, use PRIxGRUB_ADDR as format specfier to fix the portability problem. --- grub-core/bus/usb/ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c index