[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAS+Ej9q7Tw7Op8J27KUeFUEg6VvytWm6SXd1qB-ocUJ8A@mail.gmail.com>
Date: Tue, 31 Oct 2023 21:20:33 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: "Jiri Slaby (SUSE)" <jirislaby@...nel.org>, peterz@...radead.org,
linux-kernel@...r.kernel.org, Yu-cheng Yu <yu-cheng.yu@...el.com>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Kees Cook <keescook@...omium.org>,
Mike Rapoport <rppt@...nel.org>,
Pengfei Xu <pengfei.xu@...el.com>,
John Allen <john.allen@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kbuild@...r.kernel.org
Subject: Re: [PATCH] x86: Let AS_WRUSS depend on X86_64
On Tue, Oct 31, 2023 at 8:26 PM Borislav Petkov <bp@...en8.de> wrote:
>
> + linux-kbuild@...r.kernel.org
>
> On Tue, Oct 31, 2023 at 11:21:11AM +0100, Jiri Slaby (SUSE) wrote:
> > Since commit 18e66b695e78 ("x86/shstk: Add Kconfig option for shadow
> > stack"), AS_WRUSS is set even in 32-bit .configs. It is due to how
> > Kbuild works. .config is not considered during make oldconfig (and other
> > make *config), so standard (64-bit) gcc is invoked from 'as-instr'
> > Kbuild tests.
I do not mind either way.
Please note "depends on X86_64" cannot prevent gcc
from running here.
$(as-instr,wrussq %rax$(comma)(%rbx)) is replaced with 'y'
while parsing the Kconfig files.
I want to change it in the future, but that is how Kconfig works now.
You don't save the cost of running the compiler.
> And such gcc indeed reports that wruss is supported, so
> > AS_WRUSS=y is set.
> >
> > Provided the wruss instruction is 64-bit only (and used in pure 64-bit
> > X86_USER_SHADOW_STACK), it has little sense to have AS_WRUSS=y set on
> > 32-bit.
> >
> > Therefore, make the whole test dependent on X86_64 to ensure it's set
> > only on 64-bit.
> >
> > Signed-off-by: Jiri Slaby (SUSE) <jirislaby@...nel.org>
> > Cc: Yu-cheng Yu <yu-cheng.yu@...el.com>
> > Cc: Rick Edgecombe <rick.p.edgecombe@...el.com>
> > Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> > Cc: Borislav Petkov (AMD) <bp@...en8.de>
> > Cc: Kees Cook <keescook@...omium.org>
> > Cc: Mike Rapoport (IBM) <rppt@...nel.org>
> > Cc: Pengfei Xu <pengfei.xu@...el.com>
> > Cc: John Allen <john.allen@....com>
> > Cc: Kees Cook <keescook@...omium.org>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: Ingo Molnar <mingo@...hat.com>
> > Cc: "H. Peter Anvin" <hpa@...or.com>
> > Cc: x86@...nel.org
> > ---
> > arch/x86/Kconfig.assembler | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/x86/Kconfig.assembler b/arch/x86/Kconfig.assembler
> > index 8ad41da301e5..a5b5241711e3 100644
> > --- a/arch/x86/Kconfig.assembler
> > +++ b/arch/x86/Kconfig.assembler
> > @@ -27,5 +27,6 @@ config AS_GFNI
> >
> > config AS_WRUSS
> > def_bool $(as-instr,wrussq %rax$(comma)(%rbx))
> > + depends on X86_64
> > help
> > Supported by binutils >= 2.31 and LLVM integrated assembler
> > --
> > 2.42.0
> >
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists