Re: [PATCH V2] IB/core: Add mitigation for Spectre V1

2019-07-31 Thread Doug Ledford
On Wed, 2019-07-31 at 14:52 -0400, Doug Ledford wrote: > On Wed, 2019-07-31 at 12:52 -0500, Gustavo A. R. Silva wrote: > > This is insufficient. The speculation windows are large: > > > > "Speculative execution on modern CPUs can run several > > hundred instructions ahead." [1] > > > > [

Re: [PATCH V2] IB/core: Add mitigation for Spectre V1

2019-07-31 Thread Doug Ledford
On Wed, 2019-07-31 at 12:52 -0500, Gustavo A. R. Silva wrote: > This is insufficient. The speculation windows are large: > > "Speculative execution on modern CPUs can run several > hundred instructions ahead." [1] > > [1] https://spectreattack.com/spectre.pdf Thanks, I'll take a look at

Re: [PATCH V2] IB/core: Add mitigation for Spectre V1

2019-07-31 Thread Gustavo A. R. Silva
On 7/31/19 9:52 AM, Doug Ledford wrote: > > I'm not sure this is the best fix for this. However, here is where I > get to admit that I largely ignored the whole Spectre V1 thing, so I'm > not sure I completely understand the vulnerability and the limits to > that. But, looking at the functio

Re: [PATCH V2] IB/core: Add mitigation for Spectre V1

2019-07-31 Thread Doug Ledford
On Tue, 2019-07-30 at 21:39 -0700, Luck, Tony wrote: > Some processors may mispredict an array bounds check and > speculatively access memory that they should not. With > a user supplied array index we like to play things safe > by masking the value with the array size before it is > used as an ind

[PATCH V2] IB/core: Add mitigation for Spectre V1

2019-07-30 Thread Luck, Tony
Some processors may mispredict an array bounds check and speculatively access memory that they should not. With a user supplied array index we like to play things safe by masking the value with the array size before it is used as an index. Signed-off-by: Tony Luck --- V2: Mask the index *AFTER