]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xen/arm: make ARM_EFI selectable for Arm64
authorWei Chen <wei.chen@arm.com>
Mon, 26 Jun 2023 03:33:53 +0000 (11:33 +0800)
committerJulien Grall <jgrall@amazon.com>
Tue, 4 Jul 2023 19:16:58 +0000 (20:16 +0100)
Currently, ARM_EFI will mandatorily selected by Arm64.
Even if the user knows for sure that their images will not
start in the EFI environment, they can't disable the EFI
support for Arm64. This means there will be about 3K lines
unused code in their images.

So in this patch, we make ARM_EFI selectable for Arm64, and
based on that, we can use CONFIG_ARM_EFI to gate the EFI
specific code in head.S for those images that will not be
booted in EFI environment.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/Kconfig
xen/arch/arm/arm64/head.S

index 06b5ff755c9531a6069e854f1595f21958ee4fe1..c30f3245738843b0c761798f9704d36ef5bf5b67 100644 (file)
@@ -7,7 +7,6 @@ config ARM_64
        def_bool y
        depends on !ARM_32
        select 64BIT
-       select ARM_EFI
        select HAS_FAST_MULTIPLY
 
 config ARM
@@ -71,7 +70,13 @@ config ACPI
          an alternative to device tree on ARM64.
 
 config ARM_EFI
-       bool
+       bool "UEFI boot service support"
+       depends on ARM_64
+       default y
+       help
+         This option provides support for boot services through
+         UEFI firmware. A UEFI stub is provided to allow Xen to
+         be booted as an EFI application.
 
 config GICV3
        bool "GICv3 driver"
index c09d0b3a1ac7d01f46af79855f021b43ee7f1d3b..31cdb54d74e556a1d5787046f3686704f3fa5d48 100644 (file)
 
 #include <asm/page.h>
 #include <asm/early_printk.h>
+
+#ifdef CONFIG_ARM_EFI
 #include <efi/efierr.h>
 #include <asm/arm64/efibind.h>
+#endif
 
 #define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
 #define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
@@ -171,8 +174,10 @@ efi_head:
         .byte   0x52
         .byte   0x4d
         .byte   0x64
-        .long   pe_header - efi_head        /* Offset to the PE header. */
-
+#ifndef CONFIG_ARM_EFI
+        .long   0                    /* 0 means no PE header. */
+#else
+        .long   pe_header - efi_head /* Offset to the PE header. */
         /*
          * Add the PE/COFF header to the file.  The address of this header
          * is at offset 0x3c in the file, and is part of Linux "Image"
@@ -278,6 +283,8 @@ section_table:
         .short  0                /* NumberOfLineNumbers  (0 for executables) */
         .long   0xe0500020       /* Characteristics (section flags) */
         .align  5
+#endif /* CONFIG_ARM_EFI */
+
 real_start:
         /* BSS should be zeroed when booting without EFI */
         mov   x26, #0                /* x26 := skip_zero_bss */
@@ -965,6 +972,8 @@ putn:   ret
 ENTRY(lookup_processor_type)
         mov  x0, #0
         ret
+
+#ifdef CONFIG_ARM_EFI
 /*
  *  Function to transition from EFI loader in C, to Xen entry point.
  *  void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
@@ -1023,6 +1032,8 @@ ENTRY(efi_xen_start)
         b     real_start_efi
 ENDPROC(efi_xen_start)
 
+#endif /* CONFIG_ARM_EFI */
+
 /*
  * Local variables:
  * mode: ASM