Re: [edk2] Corrupted EFI region

2013-09-16 Thread Matt Fleming
On Fri, 13 Sep, at 02:38:12PM, jerry.hoem...@hp.com wrote: Matt, We have hit an issue on our new platform in development related to the call of efi_reserve_boot_services() from setup_arch(). The reservation can interfere with allocation of the crash kernel. Jerry, thanks for bringing

Re: [edk2] Corrupted EFI region

2013-09-16 Thread Laszlo Ersek
On 09/16/13 12:59, Matt Fleming wrote: On Fri, 13 Sep, at 02:38:12PM, jerry.hoem...@hp.com wrote: Matt, We have hit an issue on our new platform in development related to the call of efi_reserve_boot_services() from setup_arch(). The reservation can interfere with allocation of the crash

Re: EFI stub boots only with setup_efi_pc() commented

2013-09-16 Thread Matt Fleming
On Mon, 09 Sep, at 12:45:00PM, Clea F. Rees wrote: 2013/9/5 Matt Fleming m...@console-pimps.org: Sorry for the delay in replying to this. Does your machine hang during setup_efi_pci() or later on in boot? I'm not certain. How would I tell this? I think the answer is probably during

Re: [edk2] Corrupted EFI region

2013-09-16 Thread Josh Triplett
On Mon, Sep 16, 2013 at 01:50:46PM +0200, Laszlo Ersek wrote: On 09/16/13 12:59, Matt Fleming wrote: On Fri, 13 Sep, at 02:38:12PM, jerry.hoem...@hp.com wrote: Matt, We have hit an issue on our new platform in development related to the call of efi_reserve_boot_services() from

Re: [edk2] Corrupted EFI region

2013-09-16 Thread Laszlo Ersek
On 09/16/13 17:57, Josh Triplett wrote: The edk2 commit that flipped the memory type underneath the image data from EfiReservedMemoryType to EfiBootServicesData is: https://github.com/tianocore/edk2/commit/4c58575e I think this commit is wrong. It's fine for OSPM to release the image

Re: [edk2] Corrupted EFI region

2013-09-16 Thread Matthew Garrett
On Mon, Sep 16, 2013 at 06:25:22PM +0200, Laszlo Ersek wrote: Or are you alluding to UEFI firmware that's not based on TianoCore? Most BGRT implementations are IBV specific rather than coming from Tiano. The ACPI spec says that the image should be stored in EfiBootServicesData, and most

Re: [edk2] Corrupted EFI region

2013-09-16 Thread Josh Triplett
On Mon, Sep 16, 2013 at 06:25:22PM +0200, Laszlo Ersek wrote: On 09/16/13 17:57, Josh Triplett wrote: The edk2 commit that flipped the memory type underneath the image data from EfiReservedMemoryType to EfiBootServicesData is: https://github.com/tianocore/edk2/commit/4c58575e I

[PATCH 07/17] Move relocate_kernel() to shared file.

2013-09-16 Thread Roy Franz
The relocate_kernel() function will be generalized and used by all architectures, as they all have similar requirements. Signed-off-by: Roy Franz roy.fr...@linaro.org --- arch/x86/boot/compressed/eboot.c | 34 --- drivers/firmware/efi/efi-stub-helper.c | 35

[PATCH V4 00/17] ARM EFI stub common code

2013-09-16 Thread Roy Franz
This patch is the common/x86 portion of the ARM EFI stub patchset broken out. These changes support the addition of EFI stub support for the ARM and ARM64 architectures. The common code that is now shared in efi-stub-helper.c is based on code in the x86 stub that has been generalized to support

[PATCH 01/17] EFI stub documentation updates

2013-09-16 Thread Roy Franz
Move efi-stub.txt out of x86 directory and into common directory in preparation for adding ARM EFI stub support. Signed-off-by: Roy Franz roy.fr...@linaro.org --- Documentation/efi-stub.txt | 65 Documentation/x86/efi-stub.txt | 65

[PATCH 13/17] Allow efi_free() to be called with size of 0, and do nothing in that case.

2013-09-16 Thread Roy Franz
Make efi_free() safely callable with size of 0, similar to free() being callable with NULL pointers. Remove size checks that this makes redundant. This also avoids some size checks in the ARM EFI stub code that will be added as well. Signed-off-by: Roy Franz roy.fr...@linaro.org ---

[PATCH 17/17] resolve warnings found on ARM compile

2013-09-16 Thread Roy Franz
warnings from gcc: warning: label 'free_pool' defined but not used [-Wunused-label] warning: value computed is not used [-Wunused-value] Signed-off-by: Roy Franz roy.fr...@linaro.org --- drivers/firmware/efi/efi-stub-helper.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH 16/17] Fix types in EFI calls to match EFI function definitions.

2013-09-16 Thread Roy Franz
EFI calls can made directly on ARM, so the function pointers are directly invoked. This allows types to be checked at compile time, so here we ensure that the parameters match the function signature. The wrappers used by x86 prevent any type checking. Correct the type of chunksize to be based on

[PATCH 15/17] Renames in handle_cmdline_files() to complete generalization.

2013-09-16 Thread Roy Franz
Rename variables to be not initrd specific, as now the function loads arbitrary files. This change is exclusively renames and comment changes to reflect the generalization. Signed-off-by: Roy Franz roy.fr...@linaro.org Acked-by: Mark Salter msal...@redhat.com Reviewed-by: Grant Likely

[PATCH 12/17] use efi_get_memory_map() to get final map for x86

2013-09-16 Thread Roy Franz
Replace the open-coded memory map getting with the efi_get_memory_map() that is now general enough to use. Signed-off-by: Roy Franz roy.fr...@linaro.org --- arch/x86/boot/compressed/eboot.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git

[PATCH 14/17] Generalize handle_ramdisks() and rename to handle_cmdline_files().

2013-09-16 Thread Roy Franz
The handle_cmdline_files now takes the option to handle as a string, and returns the loaded data through parameters, rather than taking an x86 specific setup_header structure. For ARM, this will be used to load a device tree blob in addition to initrd images. Signed-off-by: Roy Franz

[PATCH 10/17] Rename __get_map() to efi_get_memory_map()

2013-09-16 Thread Roy Franz
Rename function in preparation for making it more flexible and sharing it. Signed-off-by: Roy Franz roy.fr...@linaro.org --- drivers/firmware/efi/efi-stub-helper.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/efi/efi-stub-helper.c

[PATCH 05/17] Rename memory allocation/free functions

2013-09-16 Thread Roy Franz
Rename them to be more similar, as low_free() could be used to free memory allocated by both high_alloc() and low_alloc(). high_alloc() - efi_high_alloc() low_alloc() - efi_low_alloc() low_free() - efi_free() Signed-off-by: Roy Franz roy.fr...@linaro.org Acked-by: Mark Salter

[PATCH 11/17] generalize efi_get_memory_map()

2013-09-16 Thread Roy Franz
Add arguments for returning the descriptor version and also the memory map key. The key is required for calling exit_boot_services(). Signed-off-by: Roy Franz roy.fr...@linaro.org --- drivers/firmware/efi/efi-stub-helper.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-)

[PATCH 02/17] Add proper definitions for some EFI function pointers.

2013-09-16 Thread Roy Franz
The x86/AMD64 EFI stubs must use a call wrapper to convert between the Linux and EFI ABIs, so void pointers are sufficient. For ARM, the ABIs are compatible, so we can directly invoke the function pointers. The functions that are used by the ARM stub are updated to match the EFI definitions.

[PATCH 08/17] Generalize relocate_kernel() for use by other architectures.

2013-09-16 Thread Roy Franz
Rename relocate_kernel() to efi_relocate_kernel(), and take parameters rather than x86 specific structure. Add max_addr argument as for ARM we have some address constraints that we need to enforce when relocating the kernel. Add alloc_size parameter for use by ARM64 which uses an uncompressed

[PATCH 03/17] Move common EFI stub code from x86 arch code to common location

2013-09-16 Thread Roy Franz
No code changes made, just moving functions and #define from x86 arch directory to common location. Code is shared using #include, similar to how decompression code is shared among architectures. Signed-off-by: Roy Franz roy.fr...@linaro.org Acked-by: Mark Salter msal...@redhat.com Reviewed-by:

[PATCH 04/17] Add system table pointer argument to shared functions.

2013-09-16 Thread Roy Franz
Add system table pointer argument to shared EFI stub related functions so they no longer use a global system table pointer as they did when part of eboot.c. For the ARM EFI stub this allows us to avoid global variables completely and thereby not have to deal with GOT fixups. Not having the EFI