[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180129174403.GH2228@hirez.programming.kicks-ass.net>
Date: Mon, 29 Jan 2018 18:44:03 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: David Woodhouse <dwmw2@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Josh Poimboeuf <jpoimboe@...hat.com>,
linux-kernel@...r.kernel.org, Dave Hansen <dave.hansen@...el.com>,
Ashok Raj <ashok.raj@...el.com>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg KH <gregkh@...uxfoundation.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Andi Kleen <ak@...ux.intel.com>,
Arjan Van De Ven <arjan.van.de.ven@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Jun Nakajima <jun.nakajima@...el.com>,
Asit Mallick <asit.k.mallick@...el.com>,
Jason Baron <jbaron@...mai.com>
Subject: Re: [PATCH 04/24] x86,nospec: Annotate indirect calls/jumps
On Fri, Jan 26, 2018 at 10:19:47AM +0000, David Woodhouse wrote:
> On Tue, 2018-01-23 at 16:25 +0100, Peter Zijlstra wrote:
> > Annotate the indirect calls/jumps in the CALL_NOSPEC/JUMP_NOSPEC
> > alternatives.
> >
> >
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
>
> Reviewed-by: David Woodhouse <dwmw@...zon.co.uk>
>
> However...
>
>
> > /*
> > + * This should be used immediately before an indirect jump/call. It tells
> > + * objtool the subsequent indirect jump/call is vouched safe for retpoline
> > + * builds.
> > + */
> > +.macro ANNOTATE_RETPOLINE_SAFE
> > + .Lannotate_\@:
> > + .pushsection .discard.retpoline_safe
> > + _ASM_PTR .Lannotate_\@
> > + .popsection
> > +.endm
>
> Didn't I just see one of those in patch 3? So this makes two...
>
>
>
> > @@ -143,6 +155,12 @@
> > ".long 999b - .\n\t" \
> > ".popsection\n\t"
> >
> > +#define ANNOTATE_RETPOLINE_SAFE \
> > + "999:\n\t" \
> > + ".pushsection .discard.retpoline_safe\n\t" \
> > + _ASM_PTR " 999b\n\t" \
> > + ".popsection\n\t"
> > +
> > #if defined(CONFIG_X86_64) && defined(RETPOLINE)
>
> ... three.
>
> Now, I did briefly toy with the idea of using a .macro from both
> __ASSEMBLY__ and inline asm, making the latter work by means of
> asm(".include \"asm/nospec-branch.h\");
>
> In the end I just ended up with the __FILL_RETURN_BUFFER CPP macro
> which is used from both by other tricks.
>
> Can we look at doing something like that, please?
I'll try. The paravirt one might be tricky, I always end in header-hell
with that thing.
Powered by blists - more mailing lists