Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584AbdITVHg (ORCPT ); Wed, 20 Sep 2017 17:07:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38294 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbdITVHf (ORCPT ); Wed, 20 Sep 2017 17:07:35 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9A7B8356D4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Wed, 20 Sep 2017 16:07:31 -0500 From: Josh Poimboeuf To: Dmitry Vyukov Cc: "H. Peter Anvin" , "x86@kernel.org" , LKML , Ingo Molnar , Thomas Gleixner , Andy Lutomirski , Linus Torvalds , Alexander Potapenko , Matthias Kaehlcke , Arnd Bergmann , Peter Zijlstra , Andrey Ryabinin Subject: Re: [PATCH 2/2] x86/asm: Fix inline asm call constraints for clang Message-ID: <20170920210731.kbcibdmbd4b3ppfi@treble> References: <31e96e6bcfcb47725e15a093b9c31660dfaad430.1505846562.git.jpoimboe@redhat.com> <7e39ef18-3e60-8cc9-ec4f-1cd02ade171f@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 20 Sep 2017 21:07:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1329 Lines: 30 On Wed, Sep 20, 2017 at 08:01:02PM +0200, Dmitry Vyukov wrote: > On Wed, Sep 20, 2017 at 7:46 PM, H. Peter Anvin wrote: > > On 09/20/17 10:38, Dmitry Vyukov wrote: > >> > >> I think we need just the frame itself and RSP pointing below this > >> frame. If we don't have a frame, CALL instruction will smash whatever > >> RSP happens to point to. Compiler doesn't have to setup RSP to point > >> below used part of stack in leaf functions. > >> > > > > In the kernel it does. Redzoning is not allowed in the kernel, because > > interrupts or exceptions would also smash the redzone. > > I see... But it's the same for user-space signals, the first thing a > signal should do is to skip the redzone. I guess interrupt handlers > should switch to interrupt stack which avoids smashing redzone > altogether. Do you mean nested interrupts/exceptions in interrupts? > In my experience frames in leaf functions can have pretty large > performance penalty. Wonder if we have we considered changing > interrupt/exception handlers to avoid smashing redzones and disable > leaf frames? Currently, on x86-64, I believe all exceptions have their own dedicated stacks in the kernel, but IRQs still come in on the task's kernel stack. Andy, do you know if there's a reason why IRQs don't use a dedicated IST stack? -- Josh