2020-10-03 06:05:56

by Heinrich Schuchardt

[permalink] [raw]
Subject: [PATCH 1/1] efi/libstub/x86: simplify efi_is_native()

CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.
There is no need to check CONFIG_X86_64 again.

Signed-off-by: Heinrich Schuchardt <[email protected]>
---
arch/x86/include/asm/efi.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index b9c2667ac46c..ab28bf1c74cf 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)

static inline bool efi_is_native(void)
{
- if (!IS_ENABLED(CONFIG_X86_64))
- return true;
return efi_is_64bit();
}

--
2.28.0


2020-10-03 17:30:00

by Brian Gerst

[permalink] [raw]
Subject: Re: [PATCH 1/1] efi/libstub/x86: simplify efi_is_native()

On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <[email protected]> wrote:
>
> CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.
> There is no need to check CONFIG_X86_64 again.
>
> Signed-off-by: Heinrich Schuchardt <[email protected]>
> ---
> arch/x86/include/asm/efi.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> index b9c2667ac46c..ab28bf1c74cf 100644
> --- a/arch/x86/include/asm/efi.h
> +++ b/arch/x86/include/asm/efi.h
> @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)
>
> static inline bool efi_is_native(void)
> {
> - if (!IS_ENABLED(CONFIG_X86_64))
> - return true;
> return efi_is_64bit();
> }

This would then return false for native 32-bit.

--
Brian Gerst

2020-10-03 19:46:03

by Arvind Sankar

[permalink] [raw]
Subject: Re: [PATCH 1/1] efi/libstub/x86: simplify efi_is_native()

On Sat, Oct 03, 2020 at 01:28:18PM -0400, Brian Gerst wrote:
> On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <[email protected]> wrote:
> >
> > CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.
> > There is no need to check CONFIG_X86_64 again.
> >
> > Signed-off-by: Heinrich Schuchardt <[email protected]>
> > ---
> > arch/x86/include/asm/efi.h | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> > index b9c2667ac46c..ab28bf1c74cf 100644
> > --- a/arch/x86/include/asm/efi.h
> > +++ b/arch/x86/include/asm/efi.h
> > @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)
> >
> > static inline bool efi_is_native(void)
> > {
> > - if (!IS_ENABLED(CONFIG_X86_64))
> > - return true;
> > return efi_is_64bit();
> > }
>
> This would then return false for native 32-bit.
>
> --
> Brian Gerst

32-bit doesn't use this implementation: it's #define'd to true in
drivers/firmware/efi/libstub/efistub.h.

Thanks.

2020-10-04 14:15:55

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH 1/1] efi/libstub/x86: simplify efi_is_native()

On Sat, 3 Oct 2020 at 21:44, Arvind Sankar <[email protected]> wrote:
>
> On Sat, Oct 03, 2020 at 01:28:18PM -0400, Brian Gerst wrote:
> > On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <[email protected]> wrote:
> > >
> > > CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.
> > > There is no need to check CONFIG_X86_64 again.
> > >
> > > Signed-off-by: Heinrich Schuchardt <[email protected]>
> > > ---
> > > arch/x86/include/asm/efi.h | 2 --
> > > 1 file changed, 2 deletions(-)
> > >
> > > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> > > index b9c2667ac46c..ab28bf1c74cf 100644
> > > --- a/arch/x86/include/asm/efi.h
> > > +++ b/arch/x86/include/asm/efi.h
> > > @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)
> > >
> > > static inline bool efi_is_native(void)
> > > {
> > > - if (!IS_ENABLED(CONFIG_X86_64))
> > > - return true;
> > > return efi_is_64bit();
> > > }
> >
> > This would then return false for native 32-bit.
> >
> > --
> > Brian Gerst
>
> 32-bit doesn't use this implementation: it's #define'd to true in
> drivers/firmware/efi/libstub/efistub.h.
>

Yes, and the reason this [now redundant] test exists is because this
did not use to be the case before

de8c55208c386 efi/libstub: Fix mixed mode boot issue after macro refactor

So for this patch

Acked-by: Ard Biesheuvel <[email protected]>

I'll queue this up

2020-10-04 14:42:20

by Arvind Sankar

[permalink] [raw]
Subject: Re: [PATCH 1/1] efi/libstub/x86: simplify efi_is_native()

On Sun, Oct 04, 2020 at 04:14:11PM +0200, Ard Biesheuvel wrote:
> On Sat, 3 Oct 2020 at 21:44, Arvind Sankar <[email protected]> wrote:
> >
> > On Sat, Oct 03, 2020 at 01:28:18PM -0400, Brian Gerst wrote:
> > > On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <[email protected]> wrote:
> > > >
> > > > CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.
> > > > There is no need to check CONFIG_X86_64 again.
> > > >
> > > > Signed-off-by: Heinrich Schuchardt <[email protected]>
> > > > ---
> > > > arch/x86/include/asm/efi.h | 2 --
> > > > 1 file changed, 2 deletions(-)
> > > >
> > > > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> > > > index b9c2667ac46c..ab28bf1c74cf 100644
> > > > --- a/arch/x86/include/asm/efi.h
> > > > +++ b/arch/x86/include/asm/efi.h
> > > > @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)
> > > >
> > > > static inline bool efi_is_native(void)
> > > > {
> > > > - if (!IS_ENABLED(CONFIG_X86_64))
> > > > - return true;
> > > > return efi_is_64bit();
> > > > }
> > >
> > > This would then return false for native 32-bit.
> > >
> > > --
> > > Brian Gerst
> >
> > 32-bit doesn't use this implementation: it's #define'd to true in
> > drivers/firmware/efi/libstub/efistub.h.
> >
>
> Yes, and the reason this [now redundant] test exists is because this
> did not use to be the case before
>
> de8c55208c386 efi/libstub: Fix mixed mode boot issue after macro refactor

Heh, my fault for not cleaning it up then :)

>
> So for this patch
>
> Acked-by: Ard Biesheuvel <[email protected]>
>
> I'll queue this up

2020-11-17 18:08:00

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: efi/core] efi/libstub/x86: simplify efi_is_native()

The following commit has been merged into the efi/core branch of tip:

Commit-ID: bc13809f1c47245cd584f4ad31ad06a5c5f40e54
Gitweb: https://git.kernel.org/tip/bc13809f1c47245cd584f4ad31ad06a5c5f40e54
Author: Heinrich Schuchardt <[email protected]>
AuthorDate: Sat, 03 Oct 2020 08:03:56 +02:00
Committer: Ard Biesheuvel <[email protected]>
CommitterDate: Mon, 26 Oct 2020 08:06:36 +01:00

efi/libstub/x86: simplify efi_is_native()

CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.
There is no need to check CONFIG_X86_64 again.

Signed-off-by: Heinrich Schuchardt <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ard Biesheuvel <[email protected]>
---
arch/x86/include/asm/efi.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index bc9758e..7673dc8 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -213,8 +213,6 @@ static inline bool efi_is_64bit(void)

static inline bool efi_is_native(void)
{
- if (!IS_ENABLED(CONFIG_X86_64))
- return true;
return efi_is_64bit();
}