From: Daniel Borkmann <daniel@iogearbox.net>
To: David Woodhouse <dwmw2@infradead.org>, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, mliska@suse.cz,
"H . J . Lu" <hjl.tools@gmail.com>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Jesper Dangaard Brouer" <brouer@redhat.com>,
"Björn Töpel" <bjorn.topel@intel.com>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] x86, retpolines: entirely disable switch jump tables when retpolines are enabled
Date: Mon, 25 Mar 2019 15:37:25 +0100 [thread overview]
Message-ID: <d7965189-c984-b177-8c69-c0e7ee78e71f@iogearbox.net> (raw)
In-Reply-To: <73ab8319a67a2d894564019c6bb0a806455987c6.camel@infradead.org>
On 03/25/2019 03:28 PM, David Woodhouse wrote:
> On Mon, 2019-03-25 at 14:56 +0100, Daniel Borkmann wrote:
>> More than 20 switch cases are not expected to be fast-path critical, but
>> it would still be good to align with gcc behavior for versions < 8.4.0 in
>> order to have consistency across supported gcc versions. vmlinux size is
>> slightly growing by 0.27% for older gcc. This flag is only set to work
>> around affected gcc, no change for clang.
>
> I note your final sentence doesn't actually say that clang doesn't have
> this problem, and doesn't *need* this (or an equivalent) change.
>
> It should say that (if it's true). And if it isn't true, then other
> remedial action would be in order.
clang doesn't have this problem as analyzed back in ce02ef06fcf7 ("x86,
retpolines: Raise limit for generating indirect calls from switch-case").
I thought both here would make it quite clear, from this patch commit msg:
"After this has been brought to attention to gcc folks [0], Martin Liska
has then fixed gcc to align with clang by avoiding to generate switch
jump tables entirely under retpolines."
And the comment in the Makefile code:
# Additionally, avoid generating expensive indirect jumps which
# are subject to retpolines for small number of switch cases.
# clang turns off jump table generation by default when under
# retpoline builds, however, gcc does not for x86. This has
# only been fixed starting from gcc stable version 8.4.0 and
# onwards, but not for older ones. See gcc bug #86952.
Thanks,
Daniel
next prev parent reply other threads:[~2019-03-25 14:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-25 13:56 [PATCH] x86, retpolines: entirely disable switch jump tables when retpolines are enabled Daniel Borkmann
2019-03-25 14:28 ` David Woodhouse
2019-03-25 14:37 ` Daniel Borkmann [this message]
2019-03-25 14:43 ` David Woodhouse
2019-03-28 12:43 ` [tip:x86/urgent] x86/retpolines: Disable " tip-bot for Daniel Borkmann
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=d7965189-c984-b177-8c69-c0e7ee78e71f@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=ast@kernel.org \
--cc=bjorn.topel@intel.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=dwmw2@infradead.org \
--cc=hjl.tools@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=mliska@suse.cz \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).