Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1038753pxb; Wed, 15 Sep 2021 20:44:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4VC+vEUEbnhyeMfXSTRbDV7KwZzCeaSvkICSeifd5jl8Ov2LI0K4iCpMl3TbzAb7Uac4d X-Received: by 2002:a17:906:2350:: with SMTP id m16mr3829124eja.340.1631763870318; Wed, 15 Sep 2021 20:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631763870; cv=none; d=google.com; s=arc-20160816; b=xX6Ag9qonNGNSvjjhvd7gJbzxpuU/fqfBvNlN7toynsK7hhhg7+JtzBZyLJmUhqhZy kNAZoe/SWT4MDIj7ZJ4AXqW9yFf2WWcNzB62k7uofnDtItLA1Q8OMSMGZZKVHBzwoUux ObbgWYbUnjGhxfWM43GsQnL8IusMlKn5iZ+xKcTno9ueEtj0qf9dHXe//w4gMn4AUepF kwZWkgpNF7IL6owHCkNBgGZNj+DWbC0Z49PRcq32QiPjO73D0m8p4y6nrT2zXY2Rw37X BTVx5m+TZ07qilsSnyZsPmfbtLlwfbLPqfwTMqBAOkLnrYKCrWNl7WQE5mwJh0OjIGvn blkw== 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=tvNjZY7KP6z25CglYVZkD1n/jJWXmseDmWqr1kHyxP0=; b=W4CaK4VP6KGej6KWHbk8bUiEp9Qcu4V8EPfswp1W0ETswNKc4UUqtC+QL8oiPCZ0fn nsgXNiyOBzLEP1teFQPl89T17KN/YyGS5Bxqpzs3lnWkH1HJGfIxcX4LRR9SC+/mhuqg taKbwSDGahdyOnwYD3dOQTGwJGZNmY54Q9ROcLjE+sbZih0+Njp4UbjHbYE8rZU0q32X 3BZlgUdLHucnxveCrCxWT5yPyCdxwp66pPCAv7BqpNkhnvFLDeGDhL0mN1Vwmg7Sy1Kl svnhp8dNaL06X1B/I0r87HJzec3caeeLNw7v+qDoRHf23JpvorGfL1vGbD+KlX4yuIk8 +Y4w== 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 du4si2252560ejc.696.2021.09.15.20.44.06; Wed, 15 Sep 2021 20:44:30 -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 S234203AbhIPDnq (ORCPT + 99 others); Wed, 15 Sep 2021 23:43:46 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:56456 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233630AbhIPDnq (ORCPT ); Wed, 15 Sep 2021 23:43:46 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=20;SR=0;TI=SMTPD_---0UoXWyLM_1631763742; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UoXWyLM_1631763742) by smtp.aliyun-inc.com(127.0.0.1); Thu, 16 Sep 2021 11:42:23 +0800 Subject: Re: [PATCH] x86: Increase exception stack sizes To: Peter Zijlstra Cc: Dave Hansen , Dave Hansen , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "open list:X86 MM" , "open list:BPF (Safe dynamic programs and tools)" , "open list:BPF (Safe dynamic programs and tools)" References: <09777a57-a771-5e17-7e17-afc03ea9b83b@linux.alibaba.com> <4f63c8bc-1d09-1717-cf81-f9091a9f9fb0@linux.alibaba.com> <18252e42-9c30-73d4-e3bb-0e705a78af41@intel.com> <4cba7088-f7c8-edcf-02cd-396eb2a56b46@linux.alibaba.com> <09d0190b-f2cc-9e64-4d3a-4eb0def22b7b@linux.alibaba.com> From: =?UTF-8?B?546L6LSH?= Message-ID: <0278349e-3a6d-9ebd-6cc3-490fb99d1990@linux.alibaba.com> Date: Thu, 16 Sep 2021 11:42:22 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/9/15 δΈ‹εˆ11:19, Peter Zijlstra wrote: > On Wed, Sep 15, 2021 at 03:34:20PM +0800, ηŽ‹θ΄‡ wrote: >> Hi, Dave, Peter >> >> What if we just increase the stack size when ftrace enabled? > > I think we can do an unconditional increase. But please first test that > guard page patch :-) Nice~ let's focus on the guard one firstly. Regards, Michael Wang > > --- > Subject: x86: Increase exception stack sizes > From: Peter Zijlstra > Date: Wed Sep 15 16:19:46 CEST 2021 > > It turns out that a single page of stack is trivial to overflow with > all the tracing gunk enabled. Raise the exception stacks to 2 pages, > which is still half the interrupt stacks, which are at 4 pages. > > Reported-by: Michael Wang > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/x86/include/asm/page_64_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/arch/x86/include/asm/page_64_types.h > +++ b/arch/x86/include/asm/page_64_types.h > @@ -15,7 +15,7 @@ > #define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER) > #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) > > -#define EXCEPTION_STACK_ORDER (0 + KASAN_STACK_ORDER) > +#define EXCEPTION_STACK_ORDER (1 + KASAN_STACK_ORDER) > #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) > > #define IRQ_STACK_ORDER (2 + KASAN_STACK_ORDER) >