From: David Woodhouse <dwmw2@infradead.org>
To: Andy Lutomirski <luto@kernel.org>,
Matt Rickard <matt@softrans.com.au>,
LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
X86 ML <x86@kernel.org>, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] Handle clock_gettime(CLOCK_TAI) in VDSO
Date: Tue, 14 Aug 2018 18:30:48 +0200 [thread overview]
Message-ID: <1534264248.6862.23.camel@infradead.org> (raw)
In-Reply-To: <CALCETrWP41MRGVT7oYoP5_f3jdh5nEvKmDrYuHWwsRgUZCGf=w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
On Tue, 2018-08-14 at 07:20 -0700, Andy Lutomirski wrote:
> > + /* Doubled switch statement to work around kernel Makefile error */
> > + /* See: https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg567499.html */
>
> NAK.
>
> The issue here (after reading that thread) is that, with our current
> compile options, gcc generates a jump table once the switch statement
> hits five entries. And it uses retpolines for it, and somehow it
> generates the relocations in such a way that the vDSO build fails.
> We
> need to address this so that the vDSO build is reliable, but there's
> an important question here:
>
> Should the vDSO be built with retpolines, or should it be built with
> indirect branches? Or should we go out of our way to make sure that
> the vDSO contains neither retpolines nor indirect branches?
>
> We could accomplish the latter (sort of) by manually converting the
> switch into the appropriate if statements, but that's rather ugly.
>
> (Hmm. We should add exports to directly read each clock source.
> They'll be noticeably faster, especially when
> cache-and-predictor-code.)
Surely it's kind of expected that the vDSO can't find an externally
provided __x86_indirect_thunk_rax symbol, since we only provide one as
part of the kernel image.
Building the vDSO with -mindirect-branch=thunk(|-inline) should fix
that, if we want retpolines in the vDSO.
There's also -fno-jump-tables.
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5213 bytes --]
next prev parent reply other threads:[~2018-08-14 16:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180814011732.075EA6E0251@virtux32.softrans.com.au>
2018-08-14 14:20 ` [PATCH] Handle clock_gettime(CLOCK_TAI) in VDSO Andy Lutomirski
2018-08-14 16:30 ` David Woodhouse [this message]
2018-08-14 21:20 ` Andy Lutomirski
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=1534264248.6862.23.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=dave.hansen@linux.intel.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=matt@softrans.com.au \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox