[XEN PATCH 3/3] xen/efi: efibind: Drop alternative define for old GCC versions

nicola.vetrini@gmail.com posted 3 patches 2 months, 2 weeks ago
[XEN PATCH 3/3] xen/efi: efibind: Drop alternative define for old GCC versions
Posted by nicola.vetrini@gmail.com 2 months, 2 weeks ago
From: Nicola Vetrini <nicola.vetrini@gmail.com>

Since the toolchain baseline for GCC is 5.1, there is no need for
this case.

Signed-off-by: Nicola Vetrini <nicola.vetrini@gmail.com>
---
Mentioned in https://gitlab.com/xen-project/xen/-/issues/201
---
 xen/arch/x86/include/asm/x86_64/efibind.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/x86_64/efibind.h b/xen/arch/x86/include/asm/x86_64/efibind.h
index b29342c61cac..d71b9324a6bb 100644
--- a/xen/arch/x86/include/asm/x86_64/efibind.h
+++ b/xen/arch/x86/include/asm/x86_64/efibind.h
@@ -173,10 +173,8 @@ typedef uint64_t   UINTN;
 #ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
     #ifdef _MSC_EXTENSIONS
         #define EFIAPI __cdecl  // Force C calling convention for Microsoft C compiler
-    #elif __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-        #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
     #else
-        #define EFIAPI          // Substitute expression to force C calling convention
+        #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
     #endif
 #endif
 
-- 
2.43.0
Re: [XEN PATCH 3/3] xen/efi: efibind: Drop alternative define for old GCC versions
Posted by Andrew Cooper 2 months, 2 weeks ago
On 13/08/2025 8:12 pm, nicola.vetrini@gmail.com wrote:
> From: Nicola Vetrini <nicola.vetrini@gmail.com>
>
> Since the toolchain baseline for GCC is 5.1, there is no need for
> this case.
>
> Signed-off-by: Nicola Vetrini <nicola.vetrini@gmail.com>
> ---
> Mentioned in https://gitlab.com/xen-project/xen/-/issues/201

I personally am in favour of this change, but in the past there has been
objection to changing this header it is vendered from elsewhere.

e.g. far more could be stripped out if ...

> ---
>  xen/arch/x86/include/asm/x86_64/efibind.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/xen/arch/x86/include/asm/x86_64/efibind.h b/xen/arch/x86/include/asm/x86_64/efibind.h
> index b29342c61cac..d71b9324a6bb 100644
> --- a/xen/arch/x86/include/asm/x86_64/efibind.h
> +++ b/xen/arch/x86/include/asm/x86_64/efibind.h
> @@ -173,10 +173,8 @@ typedef uint64_t   UINTN;
>  #ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
>      #ifdef _MSC_EXTENSIONS
>          #define EFIAPI __cdecl  // Force C calling convention for Microsoft C compiler

... it's noted that Xen doesn't use MSC and I can't see anyone taking
the time to make it work.

~Andrew
Re: [XEN PATCH 3/3] xen/efi: efibind: Drop alternative define for old GCC versions
Posted by Jan Beulich 2 months, 2 weeks ago
On 14.08.2025 00:39, Andrew Cooper wrote:
> On 13/08/2025 8:12 pm, nicola.vetrini@gmail.com wrote:
>> From: Nicola Vetrini <nicola.vetrini@gmail.com>
>>
>> Since the toolchain baseline for GCC is 5.1, there is no need for
>> this case.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@gmail.com>
>> ---
>> Mentioned in https://gitlab.com/xen-project/xen/-/issues/201
> 
> I personally am in favour of this change, but in the past there has been
> objection to changing this header it is vendered from elsewhere.

The two lines Nicola is taking out altogether were our additions already
anyway. Playing with them ought to be fine. Context may better be left
intact. I'd like to note though that in gnuefi the detection logic has
changed, too. Maintainers may want to sync that.

As to me, earlier on, objecting to fiddling with imported files here:
Now that maintainership has changed, the new maintainers will need to
make up their take on this.

Jan