Re: [PATCH v2 2/6] relocator: Do not use memory region if its starta is smaller than size

2015-07-20 Thread Andrei Borzenkov
On Mon, Jul 20, 2015 at 5:35 PM, Daniel Kiper wrote: > malloc_in_range() should not use memory region if its starta is smaller > than size. Otherwise target wraps around and points to region which is > usually not a RAM, e.g.: > > loader/multiboot.c:93: segment 0: paddr=0x80, memsz=0x3f80,

Re: GRUB release schedule?

2015-07-20 Thread Vladimir 'phcoder' Serbinenko
I'll do next beta tomorrow and will assess current open bugs to see how far we're from release Le 20 juil. 2015 20:23, "Peter Jones" a écrit : > Hi everyone, > Is there a plan for when upcoming GNU GRUB releases will happen? > > As far as I can tell, the last official release on > ftp://ftp.gnu.o

GRUB release schedule?

2015-07-20 Thread Peter Jones
Hi everyone, Is there a plan for when upcoming GNU GRUB releases will happen? As far as I can tell, the last official release on ftp://ftp.gnu.org/gnu/grub/ was 2.00 on 28-Jun-2012, and the last beta on http://alpha.gnu.org/pub/gnu/grub/ for the next version was 2.02~beta2 on 24-Dec-2013 . There

Re: Wimboot fails to get initrd data (probably regression)

2015-07-20 Thread Andrei Borzenkov
В Mon, 20 Jul 2015 14:38:39 +0200 Bernhard Übelacker пишет: > This makes the boot succeed again (Also attached as patch to current grub > git): > Applied. ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-dev

[PATCH v2 5/6] multiboot2: Add support for relocatable images

2015-07-20 Thread Daniel Kiper
Signed-off-by: Daniel Kiper --- grub-core/loader/i386/multiboot_mbi.c |6 ++-- grub-core/loader/multiboot.c | 12 +-- grub-core/loader/multiboot_elfxx.c| 28 +++ grub-core/loader/multiboot_mbi2.c | 63 + include/grub/multi

[PATCH v2 1/6] gitignore: Ignore *.orig, *.rej and *.swp files

2015-07-20 Thread Daniel Kiper
Signed-off-by: Daniel Kiper --- .gitignore |3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 18ab8e8..6d25d39 100644 --- a/.gitignore +++ b/.gitignore @@ -147,6 +147,7 @@ mod-*.c missing netboot_test *.o +*.orig *.a ohci_test partmap_test @@ -160,9 +161

[PATCH v2 6/6] multiboot2: Do not pass memory maps to image if EFI boot services are enabled

2015-07-20 Thread Daniel Kiper
Do not pass memory maps to image if it asked for EFI boot services. Maps are usually invalid in that case and they can confuse potential user. Image should get memory map itself just before ExitBootServices() call. Signed-off-by: Daniel Kiper --- grub-core/loader/multiboot_mbi2.c | 71

[PATCH v2 3/6] i386/relocator: Add grub_relocator64_efi relocator

2015-07-20 Thread Daniel Kiper
Add grub_relocator64_efi relocator. It will be used on EFI 64-bit platforms when multiboot2 compatible image requests MULTIBOOT_TAG_TYPE_EFI_BS. Relocator will set lower parts of %rax and %rbx accordingly to multiboot2 specification. On the other hand processor mode, just before jumping into loaded

[PATCH v2 4/6] multiboot2: Add tags used to pass ImageHandle to loaded image

2015-07-20 Thread Daniel Kiper
Add tags used to pass ImageHandle to loaded image. It is used by at least ExitBootServices() function. Signed-off-by: Daniel Kiper --- grub-core/loader/multiboot_mbi2.c | 46 + include/multiboot2.h | 16 + 2 files changed, 53 inser

[PATCH v2 0/6] multiboot2: Add two extensions and fix some issues

2015-07-20 Thread Daniel Kiper
Hi, This patch series: - enables EFI boot services usage in loaded images by multiboot2 protocol, - add support for multiboot2 protocol compatible relocatable images, - fixes two minor issues. Daniel .gitignore|3 ++ grub-core/Makefile.core.def

[PATCH v2 2/6] relocator: Do not use memory region if its starta is smaller than size

2015-07-20 Thread Daniel Kiper
malloc_in_range() should not use memory region if its starta is smaller than size. Otherwise target wraps around and points to region which is usually not a RAM, e.g.: loader/multiboot.c:93: segment 0: paddr=0x80, memsz=0x3f80, vaddr=0x80 lib/relocator.c:1241: min_addr = 0x0, max_addr

[PATCH v2 23/23] x86: add multiboot2 protocol support for relocatable images

2015-07-20 Thread Daniel Kiper
Add multiboot2 protocol support for relocatable images. Only GRUB2 with relevant patches understands that feature. Older multiboot protocol (regardless of version) compatible loaders ignore it and everything works as usual. Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S | 46

[PATCH v2 09/23] efi: create efi_enabled()

2015-07-20 Thread Daniel Kiper
We need more fine grained knowledge about EFI environment and check for EFI platform and EFI loader separately to properly support multiboot2 protocol. In general Xen loaded by this protocol uses memory mappings and loaded modules in similar way to Xen loaded by multiboot (v1) protocol. Hence, crea

[PATCH v2 20/23] x86: add multiboot2 protocol support for EFI platforms

2015-07-20 Thread Daniel Kiper
Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - generate multiboot2 header using macros (suggested by Jan Beulich), - switch CPU to x86_32 mode before jumping to 32-bit code (suggested by Andrew Cooper), - reduce code changes to increase patch readability (su

[PATCH v2 15/23] efi: split out efi_tables()

2015-07-20 Thread Daniel Kiper
..which collects system tables data. We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 61 +++-

[PATCH v2 16/23] efi: split out efi_variables()

2015-07-20 Thread Daniel Kiper
..which collects variable store parameters. We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 41 -

[PATCH v2 14/23] efi: split out efi_find_gop_mode()

2015-07-20 Thread Daniel Kiper
..which finds suitable GOP mode. We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 94

[PATCH v2 17/23] efi: split out efi_set_gop_mode()

2015-07-20 Thread Daniel Kiper
..which sets chosen GOP mode. We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 33 - 1 fi

[PATCH v2 22/23] x86: make Xen early boot code relocatable

2015-07-20 Thread Daniel Kiper
Every multiboot protocol (regardless of version) compatible image must specify its load address (in ELF or multiboot header). Multiboot protocol compatible loader have to load image at specified address. However, there is no guarantee that the requested memory region (in case of Xen it starts at 1

[PATCH v2 11/23] efi: split out efi_init()

2015-07-20 Thread Daniel Kiper
..which initializes basic EFI variables. We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 28 +---

[PATCH v2 21/23] x86/boot: implement early command line parser in C

2015-07-20 Thread Daniel Kiper
Current early command line parser implementation in assembler is very difficult to change to relocatable stuff using segment registers. This requires a lot of changes in very weird and fragile code. So, reimplement this functionality in C. This way code will be relocatable out of the box and much e

[PATCH v2 19/23] x86/efi: create new early memory allocator

2015-07-20 Thread Daniel Kiper
There is a problem with place_string() which is used as early memory allocator. It gets memory chunks starting from start symbol and going down. Sadly this does not work when Xen is loaded using multiboot2 protocol because start lives on 1 MiB address. So, I tried to use mem_lower address calculate

[PATCH v2 08/23] x86: add multiboot2 protocol support

2015-07-20 Thread Daniel Kiper
Add multiboot2 protocol support. Alter min memory limit handling as we now may not find it from either multiboot (v1) or multiboot2. This way we are laying the foundation for EFI + GRUB2 + Xen development. Signed-off-by: Daniel Kiper Reviewed-by: Andrew Cooper --- v2 - suggestions/fixes: - g

[PATCH v2 10/23] efi: build xen.gz with EFI code

2015-07-20 Thread Daniel Kiper
Build xen.gz with EFI code. We need this to support multiboot2 protocol on EFI platforms. If we wish to load not ELF file using multiboot (v1) or multiboot2 then it must contain "linear" (or "flat") representation of code and data. Currently, PE file contains many sections which are not "linear" (

[PATCH v2 05/23] x86/boot/reloc: create generic alloc and copy functions

2015-07-20 Thread Daniel Kiper
Create generic alloc and copy functions. We need separate tools for memory allocation and copy to provide multiboot2 protocol support. Signed-off-by: Daniel Kiper Reviewed-by: Andrew Cooper --- v2 - suggestions/fixes: - generalize new functions names (suggested by Jan Beulich), - redu

[PATCH v2 06/23] x86/boot: use %ecx instead of %eax

2015-07-20 Thread Daniel Kiper
Use %ecx instead of %eax to store low memory upper limit from EBDA. This way we do not wipe multiboot protocol identifier. It is needed in reloc() to differentiate between multiboot (v1) and multiboot2 protocol. Signed-off-by: Daniel Kiper Reviewed-by: Andrew Cooper --- xen/arch/x86/boot/head.S

[PATCH v2 02/23] x86/boot: copy only text section from *.lnk file to *.bin file

2015-07-20 Thread Daniel Kiper
Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/build32.mk |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk index c208249..c83effe 100644 --- a/xen/arch/x86/boot/build32.mk +++ b/xen/arch/x86/boot/build32.mk @@ -1

[PATCH v2 12/23] efi: split out efi_console_set_mode()

2015-07-20 Thread Daniel Kiper
..which sets console mode. We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 37 - 1 f

[PATCH v2 18/23] efi: split out efi_exit_boot()

2015-07-20 Thread Daniel Kiper
..which gets memory map and calls ExitBootServices(). We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 92 +++

[PATCH v2 07/23] x86/boot/reloc: Rename some variables and rearrange code a bit

2015-07-20 Thread Daniel Kiper
Rename mbi and mbi_old variables and rearrange code a bit to make it more readable. Additionally, this way multiboot (v1) protocol implementation and future multiboot2 protocol implementation will use the same variable naming convention. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes:

[PATCH v2 13/23] efi: split out efi_get_gop()

2015-07-20 Thread Daniel Kiper
..which gets pointer to GOP device. We want to re-use this code to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - improve commit message (suggested by Jan Beulich). --- xen/common/efi/boot.c | 59 ++---

[PATCH v2 00/23] x86: multiboot2 protocol support

2015-07-20 Thread Daniel Kiper
Hi, I am sending, long awaited, second version of multiboot2 protocol support for legacy BIOS and EFI platforms. It fixes all major issues discovered until now. There are still some minor problems which should be fixed in one way or another. I will address them in next releases. This series, in g

[PATCH v2 03/23] x86: zero BSS using stosl instead of stosb

2015-07-20 Thread Daniel Kiper
Additionally, align relevant comment to coding style. Suggested-by: Andrew Cooper Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S |5 +++-- xen/arch/x86/xen.lds.S |2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boo

[PATCH v2 01/23] x86/boot: remove unneeded instruction

2015-07-20 Thread Daniel Kiper
Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S |1 - 1 file changed, 1 deletion(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index cfd59dc..f63b349 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -169,7 +169,6 @@ __start: /* A

[PATCH v2 04/23] x86/boot: call reloc() using cdecl calling convention

2015-07-20 Thread Daniel Kiper
Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S |4 +++- xen/arch/x86/boot/reloc.c | 20 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index ed42782..3cbb2e6 10064

Re: Wimboot fails to get initrd data (probably regression)

2015-07-20 Thread Andrei Borzenkov
On Mon, Jul 20, 2015 at 4:47 PM, Andrei Borzenkov wrote: > > But code already does exactly the same. > Ignore this. I see. Thank you! ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

Re: Wimboot fails to get initrd data (probably regression)

2015-07-20 Thread Andrei Borzenkov
On Mon, Jul 20, 2015 at 3:38 PM, Bernhard Übelacker wrote: > > > @@ -213,6 +213,7 @@ grub_initrd_init (int argc, char *argv[], > >if (newc) > { > + initrd_ctx->size = ALIGN_UP (initrd_ctx->size, 4); >initrd_ctx->size += ALIGN_UP (sizeof (struct newc_head)

Wimboot fails to get initrd data (probably regression)

2015-07-20 Thread Bernhard Übelacker
Hello, I built yesterdays git of grub2. I observed that booting via wimboot 2.2.4 or 2.4.1 is in this combination not longer possible. The last lines of the failing boot on screen: ... Using boot.wim via 0xfca5254 len 0x13fc7f7f ...found WIM file boot.wim Bad CPIO magic FAT

Re: [PATCH 1/2] Add powerpc little-endian (ppc64le) flags

2015-07-20 Thread Paulo Flabiano Smorigo
On 2015-07-16 16:30, Andrei Borzenkov wrote: В Thu, 16 Jul 2015 21:05:07 +0200 Vladimir 'φ-coder/phcoder' Serbinenko пишет: On 16.07.2015 20:55, Andrei Borzenkov wrote: В Wed, 15 Jul 2015 19:42:39 +0200 Vladimir 'φ-coder/phcoder' Serbinenko пишет: It is possible to compile using "--target=