All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andy Lutomirski <luto@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Alexander Potapenko <glider@google.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: Re: [PATCH 2/2] x86/asm: Fix inline asm call constraints for clang
Date: Wed, 20 Sep 2017 16:07:31 -0500	[thread overview]
Message-ID: <20170920210731.kbcibdmbd4b3ppfi@treble> (raw)
In-Reply-To: <CACT4Y+b1EagSNhwsVkgt4sH8PHrLPO7Mp+Z+JNBWo+qxO+LMSg@mail.gmail.com>

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 <hpa@zytor.com> 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

  reply	other threads:[~2017-09-20 21:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 18:45 [PATCH 0/2] x86: Fix inline asm call constraints for clang Josh Poimboeuf
2017-09-19 18:45 ` [PATCH 1/2] objtool: Handle another GCC stack pointer adjustment bug Josh Poimboeuf
2017-09-19 18:45 ` [PATCH 2/2] x86/asm: Fix inline asm call constraints for clang Josh Poimboeuf
2017-09-19 21:55   ` Alexander Potapenko
2017-09-19 22:25     ` Alexander Potapenko
2017-09-20  1:47       ` Josh Poimboeuf
2017-09-20  1:18   ` Josh Poimboeuf
2017-09-20 17:54     ` Josh Poimboeuf
2017-09-20 17:32   ` H. Peter Anvin
2017-09-20 17:38     ` Dmitry Vyukov
2017-09-20 17:46       ` H. Peter Anvin
2017-09-20 18:01         ` Dmitry Vyukov
2017-09-20 21:07           ` Josh Poimboeuf [this message]
2017-09-20 21:19             ` Andy Lutomirski
2017-09-21  8:12               ` Dmitry Vyukov
2017-09-21 11:52                 ` Brian Gerst
2017-09-21 12:18                   ` Dmitry Vyukov
2017-09-20 17:51     ` Josh Poimboeuf
2017-09-21 15:35       ` Ingo Molnar
2017-09-21 16:18         ` Josh Poimboeuf

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=20170920210731.kbcibdmbd4b3ppfi@treble \
    --to=jpoimboe@redhat.com \
    --cc=arnd@arndb.de \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mka@chromium.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.