[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f806fc6c59902072a6be1cca3c01a21f1e79e081.camel@infradead.org>
Date: Mon, 25 Mar 2019 14:43:12 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Daniel Borkmann <daniel@...earbox.net>, tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org, mliska@...e.cz,
"H . J . Lu" <hjl.tools@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Björn Töpel <bjorn.topel@...el.com>,
Magnus Karlsson <magnus.karlsson@...el.com>,
Alexei Starovoitov <ast@...nel.org>,
"David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH] x86, retpolines: entirely disable switch jump tables
when retpolines are enabled
On Mon, 2019-03-25 at 15:37 +0100, Daniel Borkmann wrote:
> 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.
Hm, yes. That ought to be perfectly sufficient for anyone who can
actually read and is paying enough attention.
Sorry :)
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5174 bytes)
Powered by blists - more mailing lists