Re: [RFC PATCH] x86/retpolines: Prevent speculation after RET

2021-02-19 Thread Andrew Cooper
On 19/02/2021 08:15, Peter Zijlstra wrote: > On Thu, Feb 18, 2021 at 08:11:38PM +0100, Borislav Petkov wrote: >> On Thu, Feb 18, 2021 at 08:02:31PM +0100, Peter Zijlstra wrote: >>> On Thu, Feb 18, 2021 at 07:46:39PM +0100, Borislav Petkov wrote: Both vendors speculate after a near RET in some

RE: [RFC PATCH] x86/retpolines: Prevent speculation after RET

2021-02-19 Thread David Laight
From: Peter Zijlstra > Sent: 18 February 2021 19:03 > > On Thu, Feb 18, 2021 at 07:46:39PM +0100, Borislav Petkov wrote: > > Both vendors speculate after a near RET in some way: > > > > Intel: > > > > "Unlike near indirect CALL and near indirect JMP, the processor will not > > speculatively

Re: [RFC PATCH] x86/retpolines: Prevent speculation after RET

2021-02-19 Thread Peter Zijlstra
On Thu, Feb 18, 2021 at 08:11:38PM +0100, Borislav Petkov wrote: > On Thu, Feb 18, 2021 at 08:02:31PM +0100, Peter Zijlstra wrote: > > On Thu, Feb 18, 2021 at 07:46:39PM +0100, Borislav Petkov wrote: > > > Both vendors speculate after a near RET in some way: > > > > > > Intel: > > > > > >

Re: [RFC PATCH] x86/retpolines: Prevent speculation after RET

2021-02-18 Thread Borislav Petkov
On Thu, Feb 18, 2021 at 08:02:31PM +0100, Peter Zijlstra wrote: > On Thu, Feb 18, 2021 at 07:46:39PM +0100, Borislav Petkov wrote: > > Both vendors speculate after a near RET in some way: > > > > Intel: > > > > "Unlike near indirect CALL and near indirect JMP, the processor will not > >

Re: [RFC PATCH] x86/retpolines: Prevent speculation after RET

2021-02-18 Thread Peter Zijlstra
On Thu, Feb 18, 2021 at 07:46:39PM +0100, Borislav Petkov wrote: > Both vendors speculate after a near RET in some way: > > Intel: > > "Unlike near indirect CALL and near indirect JMP, the processor will not > speculatively execute the next sequential instruction after a near RET > unless that

[RFC PATCH] x86/retpolines: Prevent speculation after RET

2021-02-18 Thread Borislav Petkov
On Thu, Feb 18, 2021 at 05:59:38PM +0100, Peter Zijlstra wrote: > Hi! > > The first patch rearranges the implementation and consolidates unused bytes. > The second patch uses INT3 over LFENCE to shrink the retpoline to 15 bytes, by > which 4 can live in a cacheline. > > Patches have been boot