xen: reuse x86 EFI stub functions for Arm
authorWei Chen <wei.chen@arm.com>
Fri, 10 Jun 2022 05:53:09 +0000 (13:53 +0800)
committerJulien Grall <jgrall@amazon.com>
Fri, 17 Jun 2022 08:36:12 +0000 (09:36 +0100)
commit7f96859b0d00dd7f6e6fefa66706268cc2761a3d
tree4662564362ce113c350144a2404fbe94e3ca8595
parent0c5304d14a1c0b8016b942675041da36227713f0
xen: reuse x86 EFI stub functions for Arm

x86 is using compiler feature testing to decide EFI build
enable or not. When EFI build is disabled, x86 will use an
efi/stub.c file to replace efi/runtime.c for build objects.
Following this idea, we introduce a stub file for Arm, but
use CONFIG_ARM_EFI to decide EFI build enable or not.

And the most functions in x86 EFI stub.c can be reused for
other architectures, like Arm. So we move them to common
and keep the x86 specific function in x86/efi/stub.c.

To avoid the symbol link conflict error when linking common
stub files to x86/efi. We add a regular file check in efi
stub files' link script. Depends on this check we can bypass
the link behaviors for existed stub files in x86/efi.

As there is no Arm specific EFI stub function for Arm in
current stage, Arm still can use the existed symbol link
method for EFI stub files.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Tested-by: Jiamei Xie <jiamei.xie@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/arm/Kconfig
xen/arch/arm/Makefile
xen/arch/arm/efi/Makefile
xen/arch/x86/efi/stub.c
xen/common/efi/efi-common.mk
xen/common/efi/stub.c [new file with mode: 0644]