linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] efi/libstub/x86: fix mixed mode boot issue after macro refactor
@ 2020-05-03 15:45 Ard Biesheuvel
  2020-05-04  0:38 ` [PATCH 0/1] efi/libstub: Fix mixed mode boot on efi/next Arvind Sankar
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2020-05-03 15:45 UTC (permalink / raw)
  To: linux-efi; +Cc: linux, Ard Biesheuvel

Commit

  22090f84bc3f8081 ("efi/libstub: Unify EFI call wrappers for non-x86")

refactored some macros that are used to wrap EFI service calls, and
allow us to boot the 64-bit x86 kernel from 32-bit firmware. Sadly, due
to an oversight, this caused a boot issue on mixed mode, due to the fact
that efi_is_native() is not a macro on x86, and so #ifndef will not
detect that it is already defined.

Fix this by defining the macro as well.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/x86/include/asm/efi.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index cd0c3fbf6156..42b2fd123a2f 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -240,6 +240,7 @@ static inline bool efi_is_native(void)
 		return true;
 	return efi_is_64bit();
 }
+#define efi_is_native efi_is_native
 
 #define efi_mixed_mode_cast(attr)					\
 	__builtin_choose_expr(						\
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread
* Re: [PATCH] efi/libstub/x86: fix mixed mode boot issue after macro refactor
@ 2020-05-03 16:16 Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2020-05-03 16:16 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-efi

On Sun, May 03, 2020 at 05:45:07PM +0200, Ard Biesheuvel wrote:
> Commit
> 
>   22090f84bc3f8081 ("efi/libstub: Unify EFI call wrappers for non-x86")
> 
> refactored some macros that are used to wrap EFI service calls, and
> allow us to boot the 64-bit x86 kernel from 32-bit firmware. Sadly, due
> to an oversight, this caused a boot issue on mixed mode, due to the fact
> that efi_is_native() is not a macro on x86, and so #ifndef will not
> detect that it is already defined.
> 
> Fix this by defining the macro as well.
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Tested-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  arch/x86/include/asm/efi.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> index cd0c3fbf6156..42b2fd123a2f 100644
> --- a/arch/x86/include/asm/efi.h
> +++ b/arch/x86/include/asm/efi.h
> @@ -240,6 +240,7 @@ static inline bool efi_is_native(void)
>  		return true;
>  	return efi_is_64bit();
>  }
> +#define efi_is_native efi_is_native
>  
>  #define efi_mixed_mode_cast(attr)					\
>  	__builtin_choose_expr(						\
> -- 
> 2.26.2
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-05-05  7:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-03 15:45 [PATCH] efi/libstub/x86: fix mixed mode boot issue after macro refactor Ard Biesheuvel
2020-05-04  0:38 ` [PATCH 0/1] efi/libstub: Fix mixed mode boot on efi/next Arvind Sankar
2020-05-04  0:38   ` [PATCH 1/1] efi/libstub: Fix mixed mode boot issue after macro refactor Arvind Sankar
2020-05-04  8:05     ` Ard Biesheuvel
2020-05-04 14:02       ` Arvind Sankar
2020-05-04 14:15         ` Ard Biesheuvel
2020-05-04 14:27           ` Arvind Sankar
2020-05-04 14:33             ` Ard Biesheuvel
2020-05-04 15:02               ` [PATCH v2] " Arvind Sankar
2020-05-05  7:58                 ` Ard Biesheuvel
2020-05-04  2:25   ` [PATCH 0/1] efi/libstub: Fix mixed mode boot on efi/next Guenter Roeck
2020-05-03 16:16 [PATCH] efi/libstub/x86: fix mixed mode boot issue after macro refactor Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).