Hi, > On 19 May 2022, at 03:36, Wei Chen <[email protected]> wrote: > > Hi Jan, > >> -----Original Message----- >> From: Jan Beulich <[email protected]> >> Sent: 2022年5月18日 21:05 >> To: Wei Chen <[email protected]> >> Cc: nd <[email protected]>; Stefano Stabellini <[email protected]>; Julien >> Grall <[email protected]>; Bertrand Marquis <[email protected]>; >> Volodymyr Babchuk <[email protected]>; Andrew Cooper >> <[email protected]>; Roger Pau Monné <[email protected]>; Wei >> Liu <[email protected]>; Jiamei Xie <[email protected]>; xen- >> [email protected] >> Subject: Re: [PATCH v3 2/9] xen: reuse x86 EFI stub functions for Arm >> >> On 11.05.2022 03:46, Wei Chen wrote: >>> 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. >> >> Wouldn't it be better to mandate that every arch has its stub.c, >> and in the Arm one all you'd do (for now) is #include the common >> one? (But see also below.) >> > > Personally, I don't like to include a C file into another C file. > But I am OK as long as the Arm maintainers agree. > @Stefano Stabellini @Bertrand Marquis @Julien Grall
I agree with Wei here and if we are realistic the current way the EFI code works needs a redesign anyway and asking him to change this in this serie is not right. So I am OK with Wei solution. Cheers Bertrand
