diff mbox series

[v3,1/9] EFI: Introduce inline stub for efi_enabled on !X86 && !ARM

Message ID 39069a589f9c4dc0db9b01b7412c1a99bea55f37.1710443965.git.sanastasio@raptorengineering.com (mailing list archive)
State Superseded
Headers show
Series Early Boot Allocation on Power | expand

Commit Message

Shawn Anastasio March 14, 2024, 10:15 p.m. UTC
On architectures with no EFI support, define an inline stub
implementation of efi_enabled in efi.h that always returns false.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/include/xen/efi.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Julien Grall March 21, 2024, 5:30 p.m. UTC | #1
Hi Shawn,

On 14/03/2024 22:15, Shawn Anastasio wrote:
> On architectures with no EFI support, define an inline stub
> implementation of efi_enabled in efi.h that always returns false.
> 
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,
Jan Beulich March 22, 2024, 8:01 a.m. UTC | #2
On 14.03.2024 23:15, Shawn Anastasio wrote:
> --- a/xen/include/xen/efi.h
> +++ b/xen/include/xen/efi.h
> @@ -31,7 +31,15 @@ union compat_pf_efi_info;
>  struct xenpf_efi_runtime_call;
>  struct compat_pf_efi_runtime_call;
>  
> +#if defined(CONFIG_X86) || defined(CONFIG_ARM)
>  bool efi_enabled(unsigned int feature);
> +#else
> +static inline bool efi_enabled(unsigned int feature)
> +{
> +    return false;
> +}
> +#endif

While fine as is for now, surely Arm32 could benefit from the inline stub,
too.

Jan
Julien Grall March 22, 2024, 1:14 p.m. UTC | #3
Hi Jan,

On 22/03/2024 08:01, Jan Beulich wrote:
> On 14.03.2024 23:15, Shawn Anastasio wrote:
>> --- a/xen/include/xen/efi.h
>> +++ b/xen/include/xen/efi.h
>> @@ -31,7 +31,15 @@ union compat_pf_efi_info;
>>   struct xenpf_efi_runtime_call;
>>   struct compat_pf_efi_runtime_call;
>>   
>> +#if defined(CONFIG_X86) || defined(CONFIG_ARM)
>>   bool efi_enabled(unsigned int feature);
>> +#else
>> +static inline bool efi_enabled(unsigned int feature)
>> +{
>> +    return false;
>> +}
>> +#endif
> 
> While fine as is for now, surely Arm32 could benefit from the inline stub,
> too.

At least for now, Arm32 provides efi_enabled(). It would be possible to 
rework, but I think this should be left in a follow-up.

Also, ideally, we would have a common CONFIG_EFI (rather than 
CONFIG_ARM_EFI).

Cheers,
diff mbox series

Patch

diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 942d2e9491..160804e294 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -31,7 +31,15 @@  union compat_pf_efi_info;
 struct xenpf_efi_runtime_call;
 struct compat_pf_efi_runtime_call;
 
+#if defined(CONFIG_X86) || defined(CONFIG_ARM)
 bool efi_enabled(unsigned int feature);
+#else
+static inline bool efi_enabled(unsigned int feature)
+{
+    return false;
+}
+#endif
+
 void efi_init_memory(void);
 bool efi_boot_mem_unused(unsigned long *start, unsigned long *end);
 bool efi_rs_using_pgtables(void);