All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 00/12] arm64 EFI stub
@ 2014-07-22  0:43 Roy Franz
  2014-07-22  0:43 ` [PATCH V2 01/12] Create efi-shared.[ch], and move string functions Roy Franz
                   ` (12 more replies)
  0 siblings, 13 replies; 50+ messages in thread
From: Roy Franz @ 2014-07-22  0:43 UTC (permalink / raw)
  To: xen-devel, ian.campbell, stefano.stabellini, tim, jbeulich, keir
  Cc: Roy Franz, fu.wei, linaro-uefi

I think this patchset is in good shape, with the exception of the usage of
the EFI memory map, which I am looking for some suggestions on.  The current
implementation populates the bootinfo memory bank list from the EFI memory map,
rather than from the device tree, and doesn't use any reserved ranges.  This
works, however the EFI memory map can contain a lot of entries, many of which
are small.  Depending on the layout, this could trigger the code that sets
up the frametable to discard most of memory.  Also, as a side effect of some
memory being ignored to manage the frametable size, the EFI stub needs to
ensure that it loads modules into memory that XEN is going to map. The
FVP model has 2GBytes of DRAM at 0x80000000 and another 2 at 0x800000000,
so the disjoint case is common.

It seems that both these problems go largely away if sparse frametable mappings are
supported, but I'm not sure how much effort that would be.  I think most
of the work done to handle things robustly with the non-sparse frametable
would not apply once a sparse frametable is supported.  Does adding support
for a sparse frametable mapping seem like a reasonable way forward on this?




This patch series adds EFI support for arm64 in the form of a EFI stub in
similar fashion to the linux kernel EFI support.  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.

This patchset is based on the staging branch to get Ian's multiboot/device
tree patches.

This series is also available at:
git://git.linaro.org/people/roy.franz/xen.git   arm64-efi-stub-v2


Changes since v1:
(I have tried to address all feedback on 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 (12):
  Create efi-shared.[ch], and move string functions
  rename printErrMsg to PrintErrMesgExit
  Refactor get_parent_handle for sharing
  Refactor read_file() so it can be shared.
  replace split_value() with truncate_string()
  add read_config_file() function for XEN EFI config file
  create handle_cmdline() function
  Refactor get_argv() for sharing
  Move shared EFI functions to efi-shared.c
  add arm64 cache flushing code from linux
  Add fdt_create_empty_tree() function.
  Add EFI stub for arm64

 xen/arch/arm/Makefile               |   5 +
 xen/arch/arm/Rules.mk               |   1 +
 xen/arch/arm/arm64/Makefile         |   1 +
 xen/arch/arm/arm64/cache.S          | 100 +++++
 xen/arch/arm/arm64/head.S           | 185 +++++++++-
 xen/arch/arm/efi/Makefile           |   2 +
 xen/arch/arm/efi/efi.c              | 714 ++++++++++++++++++++++++++++++++++++
 xen/arch/arm/xen.lds.S              |   1 +
 xen/arch/x86/Rules.mk               |   1 +
 xen/arch/x86/efi/boot.c             | 625 ++++---------------------------
 xen/common/Makefile                 |   2 +
 xen/common/efi/Makefile             |   3 +
 xen/common/efi/efi-shared.c         | 648 ++++++++++++++++++++++++++++++++
 xen/common/libfdt/Makefile.libfdt   |   2 +-
 xen/common/libfdt/fdt_empty_tree.c  |  84 +++++
 xen/include/asm-arm/arm64/efibind.h | 216 +++++++++++
 xen/include/asm-arm/efibind.h       |   2 +
 xen/include/asm-arm/setup.h         |   2 +-
 xen/include/efi/efi-shared.h        |  72 ++++
 xen/include/xen/libfdt/libfdt.h     |   1 +
 20 files changed, 2101 insertions(+), 566 deletions(-)
 create mode 100644 xen/arch/arm/arm64/cache.S
 create mode 100644 xen/arch/arm/efi/Makefile
 create mode 100644 xen/arch/arm/efi/efi.c
 create mode 100644 xen/common/efi/Makefile
 create mode 100644 xen/common/efi/efi-shared.c
 create mode 100644 xen/common/libfdt/fdt_empty_tree.c
 create mode 100644 xen/include/asm-arm/arm64/efibind.h
 create mode 100644 xen/include/asm-arm/efibind.h
 create mode 100644 xen/include/efi/efi-shared.h

-- 
2.0.0

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2014-08-19 12:56 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22  0:43 [PATCH V2 00/12] arm64 EFI stub Roy Franz
2014-07-22  0:43 ` [PATCH V2 01/12] Create efi-shared.[ch], and move string functions Roy Franz
2014-07-23 16:31   ` Jan Beulich
2014-07-28 15:41     ` Ian Campbell
2014-07-28 15:52       ` Jan Beulich
2014-07-28 15:56         ` Ian Campbell
2014-07-28 16:00           ` Jan Beulich
2014-07-28 16:04             ` Ian Campbell
2014-07-28 16:10               ` Jan Beulich
2014-08-06 23:55                 ` Roy Franz
2014-08-07  6:17                   ` Jan Beulich
2014-08-09  0:27                     ` Roy Franz
2014-08-06 23:42     ` Roy Franz
2014-07-22  0:43 ` [PATCH V2 02/12] rename printErrMsg to PrintErrMesgExit Roy Franz
2014-07-23 16:33   ` Jan Beulich
2014-07-22  0:43 ` [PATCH V2 03/12] Refactor get_parent_handle for sharing Roy Franz
2014-07-23 16:37   ` Jan Beulich
2014-07-22  0:43 ` [PATCH V2 04/12] Refactor read_file() so it can be shared Roy Franz
2014-07-24  7:09   ` Jan Beulich
2014-08-06 18:38     ` Roy Franz
2014-08-07  6:20       ` Jan Beulich
2014-08-07 17:26         ` Roy Franz
2014-07-22  0:43 ` [PATCH V2 05/12] replace split_value() with truncate_string() Roy Franz
2014-07-24  7:19   ` Jan Beulich
2014-08-06 22:37     ` Roy Franz
2014-08-07  6:24       ` Jan Beulich
2014-08-18 23:38         ` Roy Franz
2014-08-19 12:56           ` Jan Beulich
2014-07-22  0:43 ` [PATCH V2 06/12] add read_config_file() function for XEN EFI config file Roy Franz
2014-07-24  7:32   ` Jan Beulich
2014-08-06 22:42     ` Roy Franz
2014-07-22  0:43 ` [PATCH V2 07/12] create handle_cmdline() function Roy Franz
2014-07-24  7:36   ` Jan Beulich
2014-07-28 15:44     ` Ian Campbell
2014-07-28 15:57       ` Jan Beulich
2014-07-22  0:43 ` [PATCH V2 08/12] Refactor get_argv() for sharing Roy Franz
2014-07-24  7:38   ` Jan Beulich
2014-07-22  0:43 ` [PATCH V2 09/12] Move shared EFI functions to efi-shared.c Roy Franz
2014-07-22  0:43 ` [PATCH V2 10/12] add arm64 cache flushing code from linux Roy Franz
2014-07-28 15:53   ` Ian Campbell
2014-07-28 16:24     ` Ian Campbell
2014-07-22  0:43 ` [PATCH V2 11/12] Add fdt_create_empty_tree() function Roy Franz
2014-07-22 16:36   ` [Linaro-uefi] " Julien Grall
2014-07-22 17:12     ` Roy Franz
2014-07-22 17:15       ` Julien Grall
2014-07-23  9:58         ` Ian Campbell
2014-07-23 16:15           ` Roy Franz
2014-07-22  0:43 ` [PATCH V2 12/12] Add EFI stub for arm64 Roy Franz
2014-07-29  9:46   ` Ian Campbell
2014-07-28 15:30 ` [PATCH V2 00/12] arm64 EFI stub Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.