efi: build xen.gz with EFI code
authorDaniel Kiper <daniel.kiper@oracle.com>
Wed, 22 Feb 2017 13:36:56 +0000 (14:36 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 22 Feb 2017 13:36:56 +0000 (14:36 +0100)
commitb199c44afa3a0d18d0e968e78a590eb9e69e20ad
tree5e8ed91872ecf765d23ea4213f667bda03a80884
parentaea7cd8c0b8232a92402866774a7ee2503cbad30
efi: build xen.gz with EFI code

Build xen.gz with EFI code. We need this to support multiboot2
protocol on EFI platforms.

If we wish to load non-ELF file using multiboot (v1) or multiboot2 then
it must contain "linear" (or "flat") representation of code and data.
This is requirement of both boot protocols. Currently, PE file contains
many sections which are not "linear" (one after another without any holes)
or even do not have representation in a file (e.g. BSS). From EFI point
of view everything is OK and works. However, this file layout cannot be
properly interpreted by multiboot protocols family. In theory there is
a chance that we could build proper PE file (from multiboot protocols POV)
using current build system. However, it means that xen.efi further diverge
from Xen ELF file (in terms of contents and build method). On the other
hand ELF has all needed properties. So, it means that this is good starting
point for further development. Additionally, I think that this is also good
starting point for further xen.efi code and build optimizations. It looks
that there is a chance that finally we can generate xen.efi directly from
Xen ELF using just simple objcopy or other tool. This way we will have one
Xen binary which can be loaded by three boot protocols: EFI native loader,
multiboot (v1) and multiboot2.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
xen/arch/x86/Makefile
xen/arch/x86/efi/Makefile
xen/arch/x86/xen.lds.S
xen/common/efi/boot.c
xen/common/efi/runtime.c