Re: [PATCH v2 1/2] x86/retpoline: Simplify vmexit_fill_RSB()

2018-01-29 Thread Peter Zijlstra
On Fri, Jan 26, 2018 at 09:07:25PM +0100, Borislav Petkov wrote: > +.macro FILL_RETURN_BUFFER nr:req ftr:req > #ifdef CONFIG_RETPOLINE > + ALTERNATIVE "", "call __clear_rsb", \ftr > #endif > .endm > > @@ -206,15 +174,10 @@ extern char __indirect_thunk_end[]; > static inline void vmexit_fi

Re: [PATCH v2 1/2] x86/retpoline: Simplify vmexit_fill_RSB()

2018-01-27 Thread Konrad Rzeszutek Wilk
On Sat, Jan 27, 2018 at 10:01:55AM +0100, Borislav Petkov wrote: > On Fri, Jan 26, 2018 at 11:20:39PM -0500, Konrad Rzeszutek Wilk wrote: > > BOINK? > > > > Really? > > There's always someone who's bound to get offended, right? So I better > change it to something boring, yes? https://www.networ

Re: [PATCH v2 1/2] x86/retpoline: Simplify vmexit_fill_RSB()

2018-01-27 Thread Borislav Petkov
On Fri, Jan 26, 2018 at 11:20:39PM -0500, Konrad Rzeszutek Wilk wrote: > BOINK? > > Really? There's always someone who's bound to get offended, right? So I better change it to something boring, yes? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the rep

Re: [PATCH v2 1/2] x86/retpoline: Simplify vmexit_fill_RSB()

2018-01-26 Thread Konrad Rzeszutek Wilk
> + * Google experimented with loop-unrolling and this turned out to be > + * the optimal version — two calls, each with their own speculation > + * trap should their return address end up getting used, in a loop. > + */ > +.macro BOINK_RSB nr:req sp:req BOINK? Really?

[PATCH v2 1/2] x86/retpoline: Simplify vmexit_fill_RSB()

2018-01-26 Thread Borislav Petkov
Simplify it to call an asm-function instead of pasting 41 insn bytes at every call site. Also, add alignment to the macro as suggested here: https://support.google.com/faqs/answer/7625886 Signed-off-by: Borislav Petkov Cc: David Woodhouse --- arch/x86/entry/entry_32.S | 2 +- ar