]> xenbits.xensource.com Git - people/royger/xen.git/commit
x86: make Xen early boot code relocatable
authorDaniel Kiper <daniel.kiper@oracle.com>
Fri, 7 Apr 2017 11:36:32 +0000 (13:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Apr 2017 11:36:32 +0000 (13:36 +0200)
commitb28044226e1ccac9b41478c7b3082fcb75278a97
treeb032106636b2518e128bf295e6eafef55139e22b
parent8c17af4aba2edb19249d9516e3ee7b827a9cecb2
x86: make Xen early boot code relocatable

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 2 MiB and ends at ~5 MiB) where image should be loaded initially is a RAM
and it is free (legacy BIOS platforms are merciful for Xen but I found at
least one EFI platform on which Xen load address conflicts with EFI boot
services; it is Dell PowerEdge R820 with latest firmware). To cope with that
problem we must make Xen early boot code relocatable and help boot loader to
relocate image in proper way by suggesting, not requesting specific load
addresses as it is right now, allowed address ranges. This patch does former.
It does not add multiboot2 protocol interface which is done in "x86: add
multiboot2 protocol support for relocatable images" patch.

This patch changes following things:
  - %esi register is used as a storage for Xen image load base address;
    it is mostly unused in early boot code and preserved during C functions
    calls in 32-bit mode,
  - %fs is used as base for Xen data relative addressing in 32-bit code
    if it is possible; %esi is used for that thing during error printing
    because it is not always possible to properly and efficiently
    initialize %fs.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/boot/head.S
xen/arch/x86/boot/trampoline.S
xen/arch/x86/boot/x86_64.S
xen/arch/x86/setup.c
xen/arch/x86/x86_64/asm-offsets.c
xen/include/asm-x86/page.h