All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@kernel.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	X86 ML <x86@kernel.org>, Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: use register variable to get stack pointer value
Date: Fri, 29 Sep 2017 11:37:52 -0700	[thread overview]
Message-ID: <CALCETrUZN=bEbBYwohM+oALu+MG7-SJUAG5_Fr4ppNVQ_SFMAg@mail.gmail.com> (raw)
In-Reply-To: <20170929153828.rtxwllhsjgiaeaos@treble>

On Fri, Sep 29, 2017 at 8:38 AM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> On Fri, Sep 29, 2017 at 05:15:36PM +0300, Andrey Ryabinin wrote:
>> Currently we use current_stack_pointer() function to get the value
>> of the stack pointer register. Since commit f5caf621ee35
>> ("x86/asm: Fix inline asm call constraints for Clang") we have stack
>> register variable declared. It can be used instead of current_stack_pointer()
>> function which allows to optimize away some excessive "mov %rsp, %<dst>"
>> instructions:
>>
>> -mov    %rsp,%rdx
>> -sub    %rdx,%rax
>> -cmp    $0x3fff,%rax
>> -ja     ffffffff810722fd <ist_begin_non_atomic+0x2d>
>>
>> +sub    %rsp,%rax
>> +cmp    $0x3fff,%rax
>> +ja     ffffffff810722fa <ist_begin_non_atomic+0x2a>
>>
>> Remove current_stack_pointer(), rename __asm_call_sp to current_stack_pointer
>> and use it instead of removed function.
>>
>> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
>
> Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>


Ok with me.  As an alternative, you could leave it as
current_stack_pointer(), but either way is fine.

  reply	other threads:[~2017-09-29 18:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 14:15 [PATCH] x86: use register variable to get stack pointer value Andrey Ryabinin
2017-09-29 15:38 ` Josh Poimboeuf
2017-09-29 18:37   ` Andy Lutomirski [this message]
2017-09-29 19:16     ` Josh Poimboeuf
2017-09-29 20:15 ` [tip:x86/urgent] x86/asm: Use " tip-bot for Andrey Ryabinin

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='CALCETrUZN=bEbBYwohM+oALu+MG7-SJUAG5_Fr4ppNVQ_SFMAg@mail.gmail.com' \
    --to=luto@kernel.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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.