Re: [PATCH -v2] EFI: Runtime services virtual mapping

2013-09-22 Thread Dave Young
On 09/21/13 at 01:39pm, Borislav Petkov wrote: On Thu, Sep 19, 2013 at 04:54:54PM +0200, Borislav Petkov wrote: From: Borislav Petkov b...@suse.de We map the EFI regions needed for runtime services contiguously on virtual addresses starting from -4G down for a total max space of 64G.

Re: [PATCH -v2] EFI: Runtime services virtual mapping

2013-09-22 Thread Borislav Petkov
On Sun, Sep 22, 2013 at 08:35:15PM +0800, Dave Young wrote: I tested your new patch, it works both with efi stub and grub boot in 1st kernel. Good, thanks! But it paniced in kexec boot with my kexec related patcheset, the patchset That's the second kernel, right? contains 3 patch: 1.

Re: [PATCH -v2] EFI: Runtime services virtual mapping

2013-09-22 Thread Dave Young
On 09/22/13 at 03:37pm, Borislav Petkov wrote: On Sun, Sep 22, 2013 at 08:35:15PM +0800, Dave Young wrote: I tested your new patch, it works both with efi stub and grub boot in 1st kernel. Good, thanks! But it paniced in kexec boot with my kexec related patcheset, the patchset

Re: [PATCH -v2] EFI: Runtime services virtual mapping

2013-09-22 Thread H. Peter Anvin
The address that faults is interesting in that it is indeed just below -4G. The question at hand is probably what information you are using to build the EFI mappings in the secondary kernel and what could make it not match the primary. Assuming it isn't as simple as the mappings never get

Re: [PATCH -v2] EFI: Runtime services virtual mapping

2013-09-22 Thread Borislav Petkov
On Sun, Sep 22, 2013 at 08:27:34AM -0700, H. Peter Anvin wrote:a The address that faults is interesting in that it is indeed just below -4G. The question at hand is probably what information you are using to build the EFI mappings in the secondary kernel and what could make it not match the

[PATCH 06/18] Enforce minimum alignment of 1 page on allocations.

2013-09-22 Thread Roy Franz
The efi_high_alloc() and efi_low_alloc() functions use the EFI_ALLOCATE_ADDRESS option to the EFI function allocate_pages(), which requires a minimum of page alignment, and rejects all other requests. The existing code could fail to allocate depending on allocation size, as although repeated

[PATCH V5 00/18] ARM EFI stub common code

2013-09-22 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/18] EFI stub documentation updates

2013-09-22 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 12/18] generalize efi_get_memory_map()

2013-09-22 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 18/18] resolve warnings found on ARM compile

2013-09-22 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 13/18] use efi_get_memory_map() to get final map for x86

2013-09-22 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/18] Allow efi_free() to be called with size of 0, and do nothing in that case.

2013-09-22 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 11/18] Rename __get_map() to efi_get_memory_map()

2013-09-22 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 09/18] Move unicode to ASCII conversion to shared function.

2013-09-22 Thread Roy Franz
Move the open-coded conversion to a shared function for use by all architectures. Change the allocation to prefer a high address for ARM, as this is required to avoid conflicts with reserved regions in low memory. We don't know the specifics of these regions until after we process the command

Re: [PATCH 10/18] Do proper conversion from UTF-16 to UTF-8

2013-09-22 Thread H. Peter Anvin
Sorry this version is broken and doesn't even compile due to remaining options_size references. Roy Franz roy.fr...@linaro.org wrote: From: H. Peter Anvin h...@zytor.com Improve the conversion of the UTF-16 EFI command line to UTF-8 for passing to the kernel. Signed-off-by: Roy Franz

Re: [PATCHv2] x86: EFI stub support for large memory maps

2013-09-22 Thread Linn Crosetto
On Tue, Sep 17, 2013 at 09:14:52PM +0100, Matt Fleming wrote: +static efi_status_t alloc_e820ext(u32 nr_desc, struct setup_data **e820ext, + u32 *e820ext_size) +{ + efi_status_t status; + unsigned long size; + + size = sizeof(struct setup_data) + +

Re: [PATCH 10/18] Do proper conversion from UTF-16 to UTF-8

2013-09-22 Thread H. Peter Anvin
On 09/22/2013 04:07 PM, Roy Franz wrote: On Sun, Sep 22, 2013 at 3:54 PM, H. Peter Anvin h...@zytor.com wrote: Sorry this version is broken and doesn't even compile due to remaining options_size references. I compiled and tested this series on both x86_64 (using OVMF) and on the ARM

[PATCHv3] x86: EFI stub support for large memory maps

2013-09-22 Thread Linn Crosetto
This patch fixes a problem with EFI memory maps larger than 128 entries when booting using the EFI stub, which results in overflowing e820_map in boot_params and an eventual halt when checking the map size in sanitize_e820_map(). If the number of map entries is greater than what can fit in