RE: [PATCH 2/2] x86/fred: Fix build with CONFIG_IA32_EMULATION=n

From: Li, Xin3
Date: Tue Jan 30 2024 - 11:33:23 EST


> On Tue, Jan 30, 2024 at 03:22:01PM +0000, Li, Xin3 wrote:
> > How do you think?
>
> Interesting. For some reason gcc doesn't constant-fold it away like clang does.

Even more interesting, gcc doesn't complain it with the attached config
File in which CONFIG_X86_FRED=y and CONFIG_IA32_EMULATION not set.

I compared the 2 config files, nothing suspicious to me.

CCing PeterZ to give insights 😊

> > diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h
> > index c7ef6ea2fa99..01342d343c19 100644
> > --- a/arch/x86/include/asm/ia32.h
> > +++ b/arch/x86/include/asm/ia32.h
> > @@ -81,7 +81,7 @@ static inline void ia32_disable(void)
> >
> > #else /* !CONFIG_IA32_EMULATION */
> >
> > -static inline bool ia32_enabled(void)
> > +static __always_inline bool ia32_enabled(void)
> > {
> > return IS_ENABLED(CONFIG_X86_32);
> > }
>
> Looks good to me. Lemme try it here.

Thank you very much!
-Xin

Attachment: fred-no_ia32_emu.config
Description: fred-no_ia32_emu.config