All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/19] arm64 EFI stub
@ 2014-06-28  1:25 Roy Franz
  2014-06-28  1:25 ` [PATCH RFC 01/19] HACK: Add -fshort-wchar to global build Roy Franz
                   ` (22 more replies)
  0 siblings, 23 replies; 44+ messages in thread
From: Roy Franz @ 2014-06-28  1:25 UTC (permalink / raw)
  To: xen-devel, ian.campbell, stefano.stabellini, tim, jbeulich, keir
  Cc: Roy Franz, fu.wei, linaro-uefi


This patch series is an RFC series that 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.


The first 14 patches refactor and move x86 EFI code so that it can be 
shared with the arm64 EFI stub.  The remaining 5 patches add the new
arm64 EFI stub.

One significant omission from this series is proper EFI memory map 
handling in XEN itself.  This patch instead creates FDT memory nodes based 
on the EFI memory map.  This is functional, but not how we want to do 
it long term.  The XEN kernel updates for this will be largely
disjoint from this series, and I will be starting on that next.  I wanted 
to get this portion out for review without waiting for that portion of the 
code to be done.  The ADD_EFI_MEMORY_TO_FDT macro isolates code that will 
change when the proper EFI memory map handling is added to XEN.

I have some some simple tests booting from the EFI shell on arm64 (FVP 
base model) and x86_64 (vmware.)

This patch series is available on my git tree:
git://git.linaro.org/people/roy.franz/xen.git
tag: xen-efi-stub-rfc-20140627


There are a few open issues in this patch series that I would appreciate 
feedback/suggestions on:

1) Build system changes.  The 'efi-shared.c' file should be properly 
shared, rather than symbolicly linked.  One complication is that the EFI 
code (for both archs) needs to be compiled with "-fshort-wchar".  I also 
likely need to create an efi subdir for arm64.

2) Is it valid to start XEN with a device tree that only contains 
multi-boot and EFI info? (As would be the case if the stub doesn't get a 
device tree as input.)  Currently this isn't supported, some libfdt 
functions are missing, so I'm checking if this is desired before I add 
that.

3) I'm not sure arm64 needs it's own copy of efibind.h.  The x86_64 
version worked fine as is, but has some Microsoft related defines in 
there.  The arm64 version I created is a proper subset with the exception 
of the EFI_STUB_ERROR define.


(I am on vacation the week of June 30th-July 4th, so my responses will be 
delayed.)

Roy Franz (19):
  HACK: Add -fshort-wchar to global build
  Create efi-shared.[ch], and move string functions
  Move more functions from boot.c to efi-shared.c
  rename printErrMsg to PrintErrMesgExit
  Add PrintErrMesg function that doesn't exit
  Refactor read_file() so it can be shared.
  move read_file() to efi-shared.c
  Move removal of leading spaces from split_value to get_value()
  replace split_value() with truncate_string()
  move truncate_string() to efi-shared.c
  add read_config_file() function for XEN EFI config file
  create handle_cmdline() function
  Refactor get_argv() for sharing
  Move get_argv() and handle_cmdline() to efi-shared.c
  Add PE/COFF header in head.S
  create ARM EFI headers, based on x86
  Remove x86 specific defintions from efibind.h
  Add assembler use support for efibind.h
  Add EFI stub for ARM64

 Config.mk                           |   2 +
 xen/arch/arm/Makefile               |   2 +
 xen/arch/arm/arm64/head.S           | 178 +++++++++-
 xen/arch/arm/efi-shared.c           |   1 +
 xen/arch/arm/efi.c                  | 686 ++++++++++++++++++++++++++++++++++++
 xen/arch/arm/efi.h                  |  11 +
 xen/arch/arm/xen.lds.S              |   1 +
 xen/arch/x86/Makefile               |   4 +-
 xen/arch/x86/efi/Makefile           |   2 +-
 xen/arch/x86/efi/boot.c             | 614 +++-----------------------------
 xen/arch/x86/efi/efi-shared.c       | 620 ++++++++++++++++++++++++++++++++
 xen/include/asm-arm/arm64/efibind.h | 206 +++++++++++
 xen/include/asm-arm/efibind.h       |   2 +
 xen/include/efi/efi-shared.h        |  71 ++++
 14 files changed, 1832 insertions(+), 568 deletions(-)
 create mode 120000 xen/arch/arm/efi-shared.c
 create mode 100644 xen/arch/arm/efi.c
 create mode 100644 xen/arch/arm/efi.h
 create mode 100644 xen/arch/x86/efi/efi-shared.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] 44+ messages in thread

end of thread, other threads:[~2014-07-11  8:57 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-28  1:25 [PATCH RFC 00/19] arm64 EFI stub Roy Franz
2014-06-28  1:25 ` [PATCH RFC 01/19] HACK: Add -fshort-wchar to global build Roy Franz
2014-06-30 11:13   ` Jan Beulich
2014-06-28  1:25 ` [PATCH RFC 02/19] Create efi-shared.[ch], and move string functions Roy Franz
2014-06-30 11:15   ` Jan Beulich
2014-07-02 11:49     ` Ian Campbell
2014-07-02 11:55     ` Ian Campbell
2014-07-09 18:31       ` Roy Franz
2014-06-28  1:25 ` [PATCH RFC 03/19] Move more functions from boot.c to efi-shared.c Roy Franz
2014-06-28  1:25 ` [PATCH RFC 04/19] rename printErrMsg to PrintErrMesgExit Roy Franz
2014-06-28  1:25 ` [PATCH RFC 05/19] Add PrintErrMesg function that doesn't exit Roy Franz
2014-06-28  1:25 ` [PATCH RFC 06/19] Refactor read_file() so it can be shared Roy Franz
2014-06-28  1:25 ` [PATCH RFC 07/19] move read_file() to efi-shared.c Roy Franz
2014-06-28  1:25 ` [PATCH RFC 08/19] Move removal of leading spaces from split_value to get_value() Roy Franz
2014-06-28  1:25 ` [PATCH RFC 09/19] replace split_value() with truncate_string() Roy Franz
2014-06-28  1:25 ` [PATCH RFC 10/19] move truncate_string() to efi-shared.c Roy Franz
2014-06-28  1:25 ` [PATCH RFC 11/19] add read_config_file() function for XEN EFI config file Roy Franz
2014-06-28  1:25 ` [PATCH RFC 12/19] create handle_cmdline() function Roy Franz
2014-06-28  1:25 ` [PATCH RFC 13/19] Refactor get_argv() for sharing Roy Franz
2014-06-28  1:25 ` [PATCH RFC 14/19] Move get_argv() and handle_cmdline() to efi-shared.c Roy Franz
2014-06-28  1:25 ` [PATCH RFC 15/19] Add PE/COFF header in head.S Roy Franz
2014-07-02 12:02   ` Ian Campbell
2014-07-09 18:35     ` Roy Franz
2014-06-28  1:25 ` [PATCH RFC 16/19] create ARM EFI headers, based on x86 Roy Franz
2014-06-28  1:25 ` [PATCH RFC 17/19] Remove x86 specific defintions from efibind.h Roy Franz
2014-07-02 12:03   ` Ian Campbell
2014-07-09 18:27     ` Roy Franz
2014-07-10  7:59       ` Ian Campbell
2014-06-28  1:25 ` [PATCH RFC 18/19] Add assembler use support for efibind.h Roy Franz
2014-06-28  1:25 ` [PATCH RFC 19/19] Add EFI stub for ARM64 Roy Franz
2014-07-02 12:34   ` Ian Campbell
2014-07-09 19:15     ` Roy Franz
2014-07-10  8:13       ` Ian Campbell
2014-07-10  9:21         ` [Linaro-uefi] " Julien Grall
2014-07-10  9:33           ` Ian Campbell
2014-06-28 15:34 ` [PATCH RFC 00/19] arm64 EFI stub Roy Franz
2014-06-29 16:42 ` [Linaro-uefi] " Julien Grall
2014-06-30 11:12 ` Jan Beulich
2014-07-02 11:52 ` Ian Campbell
2014-07-02 12:31   ` Ian Campbell
2014-07-09 18:24     ` Roy Franz
2014-07-10  7:58       ` Ian Campbell
2014-07-10 17:33         ` Roy Franz
2014-07-11  8:57           ` 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.