Linux-Toolchains Archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Alexandre Chartre <alexandre.chartre@oracle.com>
Cc: kbuild-all@lists.01.org,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	linux-toolchains@vger.kernel.org,
	kernel test robot <lkp@intel.com>,
	Arvind Sankar <nivedita@alum.mit.edu>,
	Ard Biesheuvel <ardb@kernel.org>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [RFC][PATCH 21/24] x86/entry: Disable stack-protector for IST entry C handlers
Date: Fri, 13 Nov 2020 10:59:26 -0800	[thread overview]
Message-ID: <CAKwvOdnvhyNs1arkVO1=pw9GB9NePKUfQYAY+Q0Ur9Qe9HJ37w@mail.gmail.com> (raw)
In-Reply-To: <202011131552.4kvOb9Id-lkp@intel.com>

On Thu, Nov 12, 2020 at 11:59 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Alexandre,
>
> [FYI, it's a private test report for your RFC patch.]
> [auto build test WARNING on tip/x86/mm]
> [also build test WARNING on v5.10-rc3]
> [cannot apply to tip/x86/core tip/x86/asm next-20201112]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
>
> url:    https://github.com/0day-ci/linux/commits/Alexandre-Chartre/x86-pti-Defer-CR3-switch-to-C-code/20201109-225007
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 1fcd009102ee02e217f2e7635ab65517d785da8e
> config: x86_64-randconfig-a011-20201109 (attached as .config)
> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 09ec07827b1128504457a93dee80b2ceee1af600)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install x86_64 cross compiling tool for clang build
>         # apt-get install binutils-x86-64-linux-gnu
>         # https://github.com/0day-ci/linux/commit/1095b6a7acb8dc568c474cd3b3d1c8393fb49728
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Alexandre-Chartre/x86-pti-Defer-CR3-switch-to-C-code/20201109-225007
>         git checkout 1095b6a7acb8dc568c474cd3b3d1c8393fb49728
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> arch/x86/kernel/cpu/mce/core.c:2023:1: warning: unknown attribute 'optimize' ignored [-Wunknown-attributes]
>    DEFINE_IDTENTRY_MCE(exc_machine_check)
>    ^
>    arch/x86/include/asm/idtentry.h:539:30: note: expanded from macro 'DEFINE_IDTENTRY_MCE'
>    #define DEFINE_IDTENTRY_MCE             DEFINE_IDTENTRY_IST
>                                            ^
>    arch/x86/include/asm/idtentry.h:428:2: note: expanded from macro 'DEFINE_IDTENTRY_IST'
>            no_stack_protector DEFINE_IDTENTRY_RAW(func)
>            ^
>    arch/x86/include/asm/idtentry.h:110:18: note: expanded from macro 'no_stack_protector'
>            __attribute__ ((optimize("-O2,-fno-stack-protector,-fno-omit-frame-pointer")))
>                            ^

Hi Alexandre,
The `optimize` attribute is both non-portable across toolchains (hence
this warning) and a little quirky in GCC.  It's advised that you do
not use it.  If you can describe the issue you're trying to solve with
it, we likely have a better way to fix.

If it's removing a stack protector, -fno-stack-protector for the whole
translation unit is the only portable solution today. (GCC 10 just
gained the no_stack_protector attribute, but the kernel needs to
support older versions of GCC).

>    1 warning generated.
>
> vim +/optimize +2023 arch/x86/kernel/cpu/mce/core.c
>
> 4c0dcd8350a03c arch/x86/kernel/cpu/mce/core.c   Thomas Gleixner 2020-02-25  2020
> 4c0dcd8350a03c arch/x86/kernel/cpu/mce/core.c   Thomas Gleixner 2020-02-25  2021  #ifdef CONFIG_X86_64
> 4c0dcd8350a03c arch/x86/kernel/cpu/mce/core.c   Thomas Gleixner 2020-02-25  2022  /* MCE hit kernel mode */
> 4c0dcd8350a03c arch/x86/kernel/cpu/mce/core.c   Thomas Gleixner 2020-02-25 @2023  DEFINE_IDTENTRY_MCE(exc_machine_check)
> 4c0dcd8350a03c arch/x86/kernel/cpu/mce/core.c   Thomas Gleixner 2020-02-25  2024  {
> cd840e424f27fc arch/x86/kernel/cpu/mce/core.c   Peter Zijlstra  2020-05-29  2025        unsigned long dr7;
> cd840e424f27fc arch/x86/kernel/cpu/mce/core.c   Peter Zijlstra  2020-05-29  2026
> cd840e424f27fc arch/x86/kernel/cpu/mce/core.c   Peter Zijlstra  2020-05-29  2027        dr7 = local_db_save();
> 4c0dcd8350a03c arch/x86/kernel/cpu/mce/core.c   Thomas Gleixner 2020-02-25  2028        exc_machine_check_kernel(regs);
> cd840e424f27fc arch/x86/kernel/cpu/mce/core.c   Peter Zijlstra  2020-05-29  2029        local_db_restore(dr7);
> 4c0dcd8350a03c arch/x86/kernel/cpu/mce/core.c   Thomas Gleixner 2020-02-25  2030  }
> 9eda8cb3ac2352 arch/x86/kernel/cpu/mcheck/mce.c Andi Kleen      2009-07-09  2031
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202011131552.4kvOb9Id-lkp%40intel.com.



-- 
Thanks,
~Nick Desaulniers

       reply	other threads:[~2020-11-13 18:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201109144425.270789-22-alexandre.chartre@oracle.com>
     [not found] ` <202011131552.4kvOb9Id-lkp@intel.com>
2020-11-13 18:59   ` Nick Desaulniers [this message]
2020-11-13 19:39     ` [RFC][PATCH 21/24] x86/entry: Disable stack-protector for IST entry C handlers Alexandre Chartre
2020-11-13 19:45       ` Nick Desaulniers
2020-11-13 23:47     ` Segher Boessenkool
2020-11-14  0:01       ` Miguel Ojeda
2020-11-14  0:26         ` Segher Boessenkool
2020-11-14  1:58           ` Miguel Ojeda
2020-11-14 10:20             ` Ard Biesheuvel
2020-11-25 19:56               ` Kees Cook
2020-11-25 23:00                 ` Segher Boessenkool
2020-11-26  6:40                   ` Ard Biesheuvel
2020-11-26 20:22                     ` Segher Boessenkool
2020-11-26 21:05                       ` Arvind Sankar
2020-11-26 22:00                       ` Ard Biesheuvel
2020-11-14  0:11       ` Nick Desaulniers
2020-11-14  0:43         ` Segher Boessenkool
2020-11-14  0:48           ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKwvOdnvhyNs1arkVO1=pw9GB9NePKUfQYAY+Q0Ur9Qe9HJ37w@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=alexandre.chartre@oracle.com \
    --cc=ardb@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=nivedita@alum.mit.edu \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).