Skip to contentSkip to conversation

EFI/arm64 updates

RFC PATCH In review Roy Franz 3 participants 9 messages Oct 2, 2014

lore
Share & tools
lore

Roy Franz

author
#0 lore raw

cover EFI/arm64 updates

I overlooked updating the EFI configuration file documentation in my patchset adding EFI boot support. While reviewing the documentation, I realized that the 'install' target was broken for arm64, as there is no separate xen.efi binary created.
I have a proposed documentation update, as well as some minor Makefile updates that add support for the 'install' target for the arm64 EFI binary. I'm not sure if the '/usr/lib64/efi' is the correct path for arm64 (maybe just /usr/lib in this case?)

Roy Franz (2):
EFI: Update documentation for arm64
arm64: Create xen.efi binary for arm64

 config/arm64.mk        |  2 ++
 docs/misc/efi.markdown | 30 ++++++++++++++++++++++++------
 xen/arch/arm/Makefile  |  4 ++++
 3 files changed, 30 insertions(+), 6 deletions(-)
Signature · 1 line
2.1.0
author
#1 lore raw

RFC PATCH 1/2 EFI: Update documentation for arm64

The arm64 EFI boot support added a new 'dtb' value to the configuration file. Update the documentation to describe this and how the coniguration file is not used when GRUB loads the modules. Updates 'ucode' description to indicate that it is x86 only.

---
 docs/misc/efi.markdown | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)
docs/misc/efi.markdown +24 -6
index 19b987a..ad8da93 100644
@@ -1,8 +1,19 @@
-Building xen.efi requires gcc 4.5.x or above (4.6.x or newer recommended, as
-4.5.x was probably never really tested for this purpose) and binutils 2.22 or
-newer. Additionally, the binutils build must be configured to include support
-for the x86_64-pep emulation (i.e. `--enable-targets=x86_64-pep` or an option
-of equivalent effect should be passed to the configure script).
+For x86, building xen.efi requires gcc 4.5.x or above (4.6.x or newer
+recommended, as 4.5.x was probably never really tested for this purpose) and
+binutils 2.22 or newer.  Additionally, the binutils build must be configured to
+include support for the x86_64-pep emulation (i.e.
+`--enable-targets=x86_64-pep` or an option of equivalent effect should be
+passed to the configure script).
+
+For arm64, the PE/COFF header is open-coded in assembly, so no toolchain
+support for PE/COFF is required.  Also, the PE/COFF header co-exists with the
+normal Image format, so a single binary may be booted as an Image file or as an
+EFI application.  When booted as an EFI application, Xen requires a
+configuration file as described below unless a bootloader, such as GRUB, has
+loaded the modules and describes them in the device tree provided to Xen.  If a
+bootloader provides a device tree containing modules then any configuration
+files are ignored, and the bootloader is responsible for populating all
+relevant device tree nodes.
 
 Once built, `make install-xen` will place the resulting binary directly into
 the EFI boot partition, provided `EFI_VENDOR` is set in the environment (and
@@ -73,7 +84,14 @@ Specifies an XSM module to load.
 
 ###`ucode=<filename>`
 
-Specifies a CPU microcode blob to load.
+Specifies a CPU microcode blob to load. (x86 only)
+
+###`dtb=<filename>`
+
+Specifies a device tree file to load.  The platform firmware may provide a
+DTB in an EFI configuration table, so this field is optional in that
+case. A dtb specified in the configuration file will override a device tree
+provided in the EFI configuration table. (ARM only)
 
 ###`chain=<filename>`
 
Signature · 1 line
2.1.0
Acked-by on v1 1/2
#2 lore raw

Re: [RFC PATCH 1/2] EFI: Update documentation for arm64

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 03:11, <[email protected]> wrote:

The arm64 EFI boot support added a new 'dtb' value to the configuration file. Update the documentation to describe this and how the coniguration file is not
used when GRUB loads the modules. Updates 'ucode' description to indicate that
it is x86 only.

Quoted 60 lines
---
 docs/misc/efi.markdown | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)
docs/misc/efi.markdown +0 -2
index 19b987a..ad8da93 100644
@@ -1,8 +1,19 @@
-Building xen.efi requires gcc 4.5.x or above (4.6.x or newer recommended, as
-4.5.x was probably never really tested for this purpose) and binutils 2.22 

or
-newer. Additionally, the binutils build must be configured to include support

docs/misc/efi.markdown +2 -2
-for the x86_64-pep emulation (i.e. `--enable-targets=x86_64-pep` or an option
-of equivalent effect should be passed to the configure script).
+For x86, building xen.efi requires gcc 4.5.x or above (4.6.x or newer
+recommended, as 4.5.x was probably never really tested for this purpose) 

and
+binutils 2.22 or newer. Additionally, the binutils build must be configured to

docs/misc/efi.markdown +6 -0
+include support for the x86_64-pep emulation (i.e.
+`--enable-targets=x86_64-pep` or an option of equivalent effect should be
+passed to the configure script).
+
+For arm64, the PE/COFF header is open-coded in assembly, so no toolchain
+support for PE/COFF is required.  Also, the PE/COFF header co-exists with 

the
+normal Image format, so a single binary may be booted as an Image file or as an

docs/misc/efi.markdown +2 -0
+EFI application.  When booted as an EFI application, Xen requires a
+configuration file as described below unless a bootloader, such as GRUB, 

has
+loaded the modules and describes them in the device tree provided to Xen. If a

docs/misc/efi.markdown +3 -0
+bootloader provides a device tree containing modules then any configuration
+files are ignored, and the bootloader is responsible for populating all
+relevant device tree nodes.
 
 Once built, `make install-xen` will place the resulting binary directly into
 the EFI boot partition, provided `EFI_VENDOR` is set in the environment 

(and

docs/misc/efi.markdown +8 -1
@@ -73,7 +84,14 @@ Specifies an XSM module to load.
 
 ###`ucode=<filename>`
 
-Specifies a CPU microcode blob to load.
+Specifies a CPU microcode blob to load. (x86 only)
+
+###`dtb=<filename>`
+
+Specifies a device tree file to load.  The platform firmware may provide a
+DTB in an EFI configuration table, so this field is optional in that
+case. A dtb specified in the configuration file will override a device tree
+provided in the EFI configuration table. (ARM only)
 
 ###`chain=<filename>`
 
Signature · 1 line
2.1.0
Acked-by
#3 lore raw

Re: [RFC PATCH 1/2] EFI: Update documentation for arm64

Quoted 11 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 03:11, <[email protected]> wrote:

The arm64 EFI boot support added a new 'dtb' value to the configuration file. Update the documentation to describe this and how the coniguration file is not
used when GRUB loads the modules. Updates 'ucode' description to indicate that
it is x86 only.

author
#4 lore raw

RFC PATCH 2/2 arm64: Create xen.efi binary for arm64

In reply to Roy Franz

The 'xen' binary for arm64 is both an Image file and a PE/COFF executable, copy it to xen.efi so that the 'make install' processing is shared with x86. Prior to this 'make install' was broken on arm64.

---
 config/arm64.mk       | 2 ++
 xen/arch/arm/Makefile | 4 ++++
 2 files changed, 6 insertions(+)
config/arm64.mk +2 -0
index 4e57b3a..6eafda2 100644
@@ -15,3 +15,5 @@ LDFLAGS_DIRECT += -EL
 CONFIG_LOAD_ADDRESS ?= 0x80000000
 
 IOEMU_CPU_ARCH ?= aarch64
+
+EFI_DIR ?= /usr/lib64/efi
xen/arch/arm/Makefile +4 -0
index f330302..9a25290 100644
@@ -49,6 +49,9 @@ ALL_OBJS := $(TARGET_SUBARCH)/head.o $(ALL_OBJS)
 
 $(TARGET): $(TARGET)-syms $(TARGET).axf
 	$(OBJCOPY) -O binary -S $< $@
+ifeq (arm64,$(XEN_TARGET_ARCH))
+	ln -sf $(notdir $@)  ../../$(notdir $@).efi
+endif
 
 $(TARGET).axf: $(TARGET)-syms
 	# XXX: VE model loads by VMA so instead of
@@ -100,3 +103,4 @@ clean::
 	rm -f asm-offsets.s xen.lds
 	rm -f $(BASEDIR)/.xen-syms.[0-9]*
 	rm -f $(TARGET).axf
+	rm -f $(TARGET).efi
Signature · 1 line
2.1.0
Acked-by on v1 2/2
#5 lore raw

Re: [RFC PATCH 2/2] arm64: Create xen.efi binary for arm64

Quoted 5 lines · Roy Franz

The 'xen' binary for arm64 is both an Image file and a PE/COFF executable, copy it to xen.efi so that the 'make install' processing is shared with x86. Prior to this 'make install' was broken on arm64.

If the affect of this is only to install Xen (and some symlinks) into /usr/lib64/efi and optionally into the ESP then:

What I don't want is for an extra xen.efi to show up in the regular /boot directory. I think this patch doesn't do that though.

Jan, slight aside: what do you think about setting EFI_VENDOR to e.g. XenProject by default (i.e. installing into the ESP by default)?

#6 lore raw

Re: [RFC PATCH 2/2] arm64: Create xen.efi binary for arm64

Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 15:03, <[email protected]> wrote:
Quoted 5 lines · Roy Franz

The 'xen' binary for arm64 is both an Image file and a PE/COFF executable, copy it to xen.efi so that the 'make install' processing is shared with x86. Prior to this 'make install' was broken on arm64.

If the affect of this is only to install Xen (and some symlinks) into /usr/lib64/efi and optionally into the ESP then:

Quoted 7 lines

What I don't want is for an extra xen.efi to show up in the regular /boot directory. I think this patch doesn't do that though.

Jan, slight aside: what do you think about setting EFI_VENDOR to e.g. XenProject by default (i.e. installing into the ESP by default)?

The respective directory on the EFI partition ought to exist (and I don't think we should be creating it). This part of the installation being only an aid for developers anyway, I'd prefer keeping EFI_VENDOR undefined (and hence skipping that installation step) by default.

Jan

#7 lore raw

Re: [RFC PATCH 2/2] arm64: Create xen.efi binary for arm64

Quoted 15 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 15:03, <[email protected]> wrote:
Quoted 5 lines · Roy Franz

The 'xen' binary for arm64 is both an Image file and a PE/COFF executable, copy it to xen.efi so that the 'make install' processing is shared with x86. Prior to this 'make install' was broken on arm64.

If the affect of this is only to install Xen (and some symlinks) into /usr/lib64/efi and optionally into the ESP then:

What I don't want is for an extra xen.efi to show up in the regular /boot directory. I think this patch doesn't do that though.

Quoted 8 lines
Quoted 2 lines

Jan, slight aside: what do you think about setting EFI_VENDOR to e.g. XenProject by default (i.e. installing into the ESP by default)?

The respective directory on the EFI partition ought to exist (and I don't think we should be creating it). This part of the installation being only an aid for developers anyway, I'd prefer keeping EFI_VENDOR undefined (and hence skipping that installation step) by default.

Makes sense to me, thanks.

Ian.

author
#8 lore raw

Re: [RFC PATCH 2/2] arm64: Create xen.efi binary for arm64

Quoted 25 lines · Ian Campbell
Quoted 15 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 15:03, <[email protected]> wrote:
Quoted 5 lines · Roy Franz

The 'xen' binary for arm64 is both an Image file and a PE/COFF executable, copy it to xen.efi so that the 'make install' processing is shared with x86. Prior to this 'make install' was broken on arm64.

If the affect of this is only to install Xen (and some symlinks) into /usr/lib64/efi and optionally into the ESP then:

What I don't want is for an extra xen.efi to show up in the regular /boot directory. I think this patch doesn't do that though.

Quoted 8 lines
Quoted 2 lines

Jan, slight aside: what do you think about setting EFI_VENDOR to e.g. XenProject by default (i.e. installing into the ESP by default)?

The respective directory on the EFI partition ought to exist (and I don't think we should be creating it). This part of the installation being only an aid for developers anyway, I'd prefer keeping EFI_VENDOR undefined (and hence skipping that installation step) by default.

Quoted 4 lines

Makes sense to me, thanks.

Ian.

Thanks. I wasn't sure how important this was, and wanted a conscious decision made
regarding it rather than being left out for ARM due to an oversight.

Roy