[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH for-4.5 V9] arm64 EFI stub



This patch series adds EFI boot support for arm64.  A PE/COFF header is created
in head.S, as there is no toolchain support for PE/COFF on arm64.  This also
has the advantage that the file is both an "Image" file and a PE/COFF
executable - the same binary can be loaded and run either way.  The EFI 'stub'
code is a shim layer that serves as the loader for the XEN kernel in the EFI
environment.  The stub loads the dom0 kernel and initrd if required, and adds
entries for them as well as for the EFI data structures into the device tree
passed to XEN.  Once the device tree is constructed, EFI boot services are
exited, and the stub transfers control to the normal XEN entry point.  The only
indication XEN has that it was loaded via the stub is that the device tree
contains EFI properties.  This is all very similar to the arm/arm64 Linux
kernel EFI stubs.

Based on staging tree a608c40d

Changes since v8:
* rebase to staging a608c40d to get already merged patches, now a single patch
  adding the ARM code remains.
* Add arch-private runtime.h files to arch/*/efi directories.  ARM version
  is currently empty to allow unconditional inclusion by runtime.c, rather
  than #ifdef in runtime.c.
* Move x86 specific include of asm/mc146818rtc.h to x86 runtime.h
* Move x86 specific definition of efi_l4_pgtable to x86 runtime.h.  This needs
  #ifndef COMPAT check, but I think this is cleaner long-term than an x86
  #ifdef in runtime.c.
* move include of xen/bitops.h to proper alphabetized location.

Changes since v7:
* Some patches already accepted, no longer in series.
* Clean up blexit error messages (remove ERROR)
* don't process options for xsm/ramdisk modules
* Add comment explaining construction of module string, remove
  superfluous place_string() of empty string, only add options
  if present.
* remove bare extern rtc_lock declaration, use #ifdef to control
  x86 specific RTC include file.
* blank line addition in runtime.c

Changes since v6:
* Move pci unitialized buffer fix to first patch in series, restructured
  by Jan
* Move efi_l4_pgtable extern to efi.h
* Fix symlink creation in Makefile for common/efi files
* Use dt_set_cell to simplify fdt_set_reg() implementation
* move include of asm/fixmap.h back to boot.c
* formating fix in runtime.c

Changes since v5:
* FDT and ARM cache flushing patches removed, as those have been applied
  to master branch
* rebased to master that includes above changesets.
* Added new patch fixing bug in PCI rom scan code. 
  (separate patch since it is a bug fix)
* efi-boot.h files moved from global include directories to arch/*/efi
  directories, as that is the only place they are used.
* removed redundant newlines in blexit() calls
* removed uneccessary initializers.
* reverted string variable changes that where left over from other reverted
  changes.
* removed local memory map variables, no longer required.
* made symlinks from commone/efi relative
* simplify get_argv() call with NULL parameter
* rename efi_arch_memory to efi_arch_memory_setup
* fixed type of local 'i' variable in new arch functions.  reviewed
  other local variables.
* fixed wstrlen coding style
* various formatting fixes - init ordering, remove declration reordering,
  blank lines, etc.
* moved x86 externs to appropriate global includes.
* fixed XXX placeholder in comments
* simplified ucode file handling, ignore anything after filename, as options
  not supported
* Added Acked-by lines for patches fully acked, or where minor changes were
  requested and made.

Changes since v4:
* Move runtime.c/compat.c/efi.h from arch/x86/efi to common/efi
* Create symbolic links at build time from common/efi to arch/xxx/efi
* Moved all non-VGA video code back to boot.c
* Cleaned up __init in forward declarations, moved declarations to common file
* Fixed type of i in efi_arch_process_memory_map()
* Added early/late arch cfg file functions - arm64 needs early, x86 wants late.
* Added #ifdefs to disable runtime services code that is not yet implemented for
  ARM (code moved back from arch specific file.)
  Global variables are left, as this allows common code setting these in boot
  code to be left.
* just provide arch specific allocator for EFI memory map, not function
  returning the map.
* Renamed truncate_string() to split_string()
* Fixed up MBI static inilization comments in moved code.
* Added explanation of ARM config file ordering requirement to commit message
  and code.
* Added explanation of increase of NR_MEM_BANKS
* Variety of minor formating cleanups.
* Remove mem-reserve regions from DTB in addition to the memory banks.  The EFI
  memory map is the only memory description that is used.

Changes since v3:
* Add symbolic link from common/efi/boot.c to arch/x86/efi/boot.c.  This
  simplifies the build system changes and resolves the parallel build issues
  in v3.  x86 EFI code build is unchanged, and ARM EFI code uses the normal
  common build structure. (This symlink seems to have confused git's moved file
  detection for boot.c)
* Fix XEN to be Xen throughout
* Fix spacing and missing blank lines between functions
* Add pseudo-prototype of efi_xen_start is head.S, change prototype to take
  pointer instead of integer to avoid cast, add comment explaining saving of x0
* Use uintptr_t in casts from uint to pointer for device tree.
* Change alignment requirements to 4k in PE/COFF header and alignment check
  in code.
* Rebased to latest master branch.

Changes since v2:
* Major refactor to use common EFI entry point and factor out arch specific
  code, rather than factoring out the common code.
* Update entire libfdt to v1.4.0 to provide fdt_create_empty_tree()

Changes since v1:
* Added common/efi directory for shared EFI code, and arch/arm/efi for 
  arm-specfic code.  Global build hacking of -fshort-wchar removed.
  arm32, arm64, and x86 with/without EFI enabled toolchain all build.
  The x86 build previously autodetected whether the EFI version should
  be built or not based on toolchain support.  I couldn't get this working
  nicely with the common code, so for x86 I have the common code always
  build, and the EFI autodection works as normal for building the EFI
  version.
* Basic use of the EFI memory map instead of FDT based memory description.
  More work needed to resolve differences between FDT description of 
  a small number of large memory banks with reserved regions, and EFI's
  potentially long list of available regions, which can be long.
* More refactoring of common EFI code to not directly exit using blexit(),
  as this broke the pre-linking targets.  All shared code returns status,
  and it is up to the caller to exit and clean up.
* Reduced the number of patches.  Refactoring of x86 code first, then moving
  all code to efi-shared.c in one patch.
* Fixed formatting/tab issues in new files, added Emacs footer.
* Fixed efi_get_memory_map to return NULL map pointer on error in addition
  to failed status.
* Added comments in head.S regarding PE/COFF specification, and 1:1 
  mapping used by EFI code.
* Updated device tree bindings to use new multiboot bindings.  Since the stub
  is always built into XEN, we don't have to support older bindings.

Roy Franz (1):
  Add ARM EFI boot support

 xen/arch/arm/Makefile               |   1 +
 xen/arch/arm/arm64/head.S           | 150 +++++++++-
 xen/arch/arm/efi/Makefile           |   4 +
 xen/arch/arm/efi/efi-boot.h         | 575 ++++++++++++++++++++++++++++++++++++
 xen/arch/arm/efi/runtime.h          |   1 +
 xen/arch/arm/xen.lds.S              |   1 +
 xen/arch/x86/efi/runtime.h          |   5 +
 xen/common/efi/boot.c               |  17 +-
 xen/common/efi/efi.h                |   2 +
 xen/common/efi/runtime.c            |  14 +-
 xen/include/asm-arm/arm64/efibind.h | 216 ++++++++++++++
 xen/include/asm-arm/efibind.h       |   2 +
 xen/include/asm-arm/setup.h         |   2 +-
 13 files changed, 981 insertions(+), 9 deletions(-)
 create mode 100644 xen/arch/arm/efi/Makefile
 create mode 100644 xen/arch/arm/efi/efi-boot.h
 create mode 100644 xen/arch/arm/efi/runtime.h
 create mode 100644 xen/arch/x86/efi/runtime.h
 create mode 100644 xen/include/asm-arm/arm64/efibind.h
 create mode 100644 xen/include/asm-arm/efibind.h

-- 
2.1.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.