From: Ingo Molnar <mingo@kernel.org>
To: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@amacapital.net>,
Frederic Weisbecker <fweisbec@gmail.com>,
Will Drewry <wad@chromium.org>, Kees Cook <keescook@chromium.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs
Date: Sat, 12 Mar 2016 16:45:02 +0100 [thread overview]
Message-ID: <20160312154502.GD17873@gmail.com> (raw)
In-Reply-To: <1457715214-7432-1-git-send-email-dvlasenk@redhat.com>
* Denys Vlasenko <dvlasenk@redhat.com> wrote:
> Use of a temporary R8 register here seems to be unnecessary.
>
> "push %r8" is a two-byte insn (it needs REX prefix to specify R8),
> "push $0" is two-byte too. It seems just using the latter would be
> no worse.
>
> Thus, code had an unnecessary "xorq %r8,%r8" insn.
> It probably costs nothing in execution time here since we are probably
> limited by store bandwidth at this point, but still.
Note that the 3 fewer instruction in the image also shrink the code by 16 bytes:
arch/x86/entry/entry_64_compat.o:
text data bss dec hex filename
380 0 0 380 17c entry_64_compat.o.before
364 0 0 364 16c entry_64_compat.o.after
because (at least in this defconfig build) one of these functions shrunk below a
16-byte boundary. So cache footprint got denser.
Thanks,
Ingo
prev parent reply other threads:[~2016-03-12 15:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 16:53 [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Denys Vlasenko
2016-03-12 15:38 ` Ingo Molnar
2016-03-12 17:53 ` Denys Vlasenko
2016-03-12 18:05 ` Andy Lutomirski
2016-03-12 21:41 ` Denys Vlasenko
2016-03-12 15:45 ` Ingo Molnar [this message]
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=20160312154502.GD17873@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=dvlasenk@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=rostedt@goodmis.org \
--cc=wad@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox