From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE1ACC56202 for ; Fri, 13 Nov 2020 19:39:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 961292223F for ; Fri, 13 Nov 2020 19:39:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="LMjj8m/b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726227AbgKMTj7 (ORCPT ); Fri, 13 Nov 2020 14:39:59 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:57042 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726162AbgKMTj6 (ORCPT ); Fri, 13 Nov 2020 14:39:58 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0ADJYF5d187324; Fri, 13 Nov 2020 19:39:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=mR+ICCcQYiIk0bTaivOXjxpJmpis0xh/rO3FFm6LUbM=; b=LMjj8m/bqLVsV59hW9mRAQn+MnOOVMmB4p8cEcI6NmbLGkZ2qs8U8ckvu2lN62vnwgUV ZiCDjYmkMgBUPZJOFcezm0HJqUoTyTgm6T1DYFbgGgdmiTgOHzD7/e0Ddb2zgMoe71no MRFghMgjQ5rolWtHtW7/QPqvxj9ZY4GGgO/Xl6N4JeLeAIjrtUbj6TZTNafno1unXjZ/ PRTDQzCiXYIi15XeNvSJg1vjAvf44cirMixRJa0Xf3WE0gjCLxZy5AQtjSIZVXGKmeL0 p1dmgIvQylM51uVOAClngG8XPteWrUubwFNEac0+a4ugeQCilY7rJocJ+F9JKetvibBm Gw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 34nkhmbyhy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 13 Nov 2020 19:39:42 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0ADJZGrd031878; Fri, 13 Nov 2020 19:37:41 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 34rt58dxyy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Nov 2020 19:37:41 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0ADJbZNv005000; Fri, 13 Nov 2020 19:37:35 GMT Received: from linux.home (/92.157.91.83) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 13 Nov 2020 11:37:34 -0800 Subject: Re: [RFC][PATCH 21/24] x86/entry: Disable stack-protector for IST entry C handlers To: Nick Desaulniers Cc: kbuild-all@lists.01.org, clang-built-linux , linux-toolchains@vger.kernel.org, kernel test robot , Arvind Sankar , Ard Biesheuvel , Miguel Ojeda , Segher Boessenkool References: <20201109144425.270789-22-alexandre.chartre@oracle.com> <202011131552.4kvOb9Id-lkp@intel.com> From: Alexandre Chartre Message-ID: <0bcf6613-372b-8192-8a7d-c61659b852a9@oracle.com> Date: Fri, 13 Nov 2020 20:39:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9804 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011130126 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9804 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 malwarescore=0 adultscore=0 clxscore=1011 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011130126 Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On 11/13/20 7:59 PM, Nick Desaulniers wrote: > On Thu, Nov 12, 2020 at 11:59 PM kernel test robot 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 >> >> 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. Yeah, I feared this wouldn't be portable. However, I am going to remove that patch; I am making a change which doesn't require to disable stack protector anymore. > 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). I needed to disable stack protector for particular functions. Good to know that GCC 10 will provide an attribute to do that. In the meantime, if I still need it, I guess I would group functions into a file and disable stack protector for that file. Thanks. alex. >> 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. > > >