Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3836196pxb; Mon, 27 Sep 2021 03:51:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5wM55TiezSwsCeZ2gxv7cEl3OArfZP4VJMjFPMc/dyoZ3WOlQo3v5x4IPFiKBtCoed1Hq X-Received: by 2002:a17:906:ac6:: with SMTP id z6mr3648009ejf.89.1632739876815; Mon, 27 Sep 2021 03:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632739876; cv=none; d=google.com; s=arc-20160816; b=SBfakbZmMWEquoFYC5zSRcIRjdYxkHb61I8s6xssAUN8YuPPsTVXpKmANvC3GAzQgb g79+2jXQmDeHp1yVhRcT4X+b9W3+l74O+t69KHlATbFHFUx+szo54BcxUpgXFObMa/PZ LUlsYinoX8z5zrZhE40uE5iufe5HMo0a/3/w81VUV5PigrovAilbphSMhp04hVPjePr4 PBBWSBACE7VyAKEYcLOMs573xHI1oGU4kAeRlwf2yL3E4MKy8BoQiTop5W/WFsjb24ZP A/1tIiNGBAE20ijkwvrxg5nLzCsnqlGQ6rBssKflZWw9ZLXLJ54xj5Y//3tNB/OgejNK EjHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3ynWd8Zx/UxhFNorDm3xDui3u6SVEtZ0FxFoZifd+Wo=; b=CPns8b/4HzU6IcmczJvI/QpHk2Tno6ughMF7oc57W7fa046wjJUr/e0jNXoIUXJxty +jNAMSCt0fDZNN7D0naXUh0wkhn4XSlEqXx9AqKjOzPOfzjEyaYFq3Jx7qEdqu/qUHDH +8tQmOSWMSKDy+UmQYCMuwa+oHvZeNdyOHeOsQEyO6EFiB4HOQJNy93oYJC1IPTNaNM/ CK9j73oN2a9ppqOADn9lE6WtNAm6CQSgYOM6QCYm0eQxU8aKniTUU65i6/nOtLg/Syry tXM8sEEBBJTJtrUXzEpISTs1lySh7BHBXo6ZjhfAnWGEneUw6cC+x0jdfShng9CrgtSc UDhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si16462839edx.219.2021.09.27.03.50.53; Mon, 27 Sep 2021 03:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233893AbhI0KvB (ORCPT + 99 others); Mon, 27 Sep 2021 06:51:01 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:39357 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233866AbhI0Ku6 (ORCPT ); Mon, 27 Sep 2021 06:50:58 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R711e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=laijs@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0Upn50xz_1632739756; Received: from C02XQCBJJG5H.local(mailfrom:laijs@linux.alibaba.com fp:SMTPD_---0Upn50xz_1632739756) by smtp.aliyun-inc.com(127.0.0.1); Mon, 27 Sep 2021 18:49:17 +0800 Subject: Re: [PATCH V2 02/41] x86/traps: Remove stack-protector from traps.c To: Borislav Petkov , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Joerg Roedel , Javier Martinez Canillas , Daniel Bristot de Oliveira , Brijesh Singh , Andy Shevchenko , Arvind Sankar , Juergen Gross , Chester Lin References: <20210926150838.197719-1-jiangshanlai@gmail.com> <20210926150838.197719-3-jiangshanlai@gmail.com> From: Lai Jiangshan Message-ID: Date: Mon, 27 Sep 2021 18:49:16 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/9/27 18:19, Borislav Petkov wrote: > On Sun, Sep 26, 2021 at 11:07:59PM +0800, Lai Jiangshan wrote: >> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile >> index 8f4e8fa6ed75..0e054e2304c6 100644 >> --- a/arch/x86/kernel/Makefile >> +++ b/arch/x86/kernel/Makefile >> @@ -48,6 +48,9 @@ KCOV_INSTRUMENT := n >> >> CFLAGS_head$(BITS).o += -fno-stack-protector >> >> +CFLAGS_REMOVE_traps.o = -fstack-protector -fstack-protector-strong > > Why this too? > >> +CFLAGS_traps.o += -fno-stack-protector > > Isn't this enough to disable stack protector for this file? > I did not investigate deep enough. I reviewed the generated code and found %gs is accessed early for the C entry function and searched for solution and I chose to copy the code that I thought is the most complete: kernel/entry/Makefile Using only "-fno-stack-protector" is enough to disable stack protector with my .config, I'm not so sure about other configuration. Thanks Lai