Re: [PATCH 06/18] x86, barrier: stop speculation for failed access_ok

From
Alexei Starovoitov <hidden>
Date
2018-01-08 02:24:18
Also in
lkml, netdev
Reply to
Dan Williams, 2018-01-07
On Sun, Jan 07, 2018 at 12:15:40PM -0800, Dan Williams wrote:
I'm thinking we should provide the option to at least build the
hot-path nospec_array_ptr() usages without an lfence.

    CONFIG_SPECTRE1_PARANOIA_SAFE
    CONFIG_SPECTRE1_PARANOIA_PERF
SAFE vs PERF naming is problematic and misleading, since users don't
have the data to make a decision they will be forced to go with SAFE.

What is not safe about array_access() macro with AND ?
How lfence approach makes it safer ?
Only because lfence was blessed by intel earlier when
they couldn't figure out a different way?

How about:
CONFIG_SPECTRE1_WORKAROUND_INDEX_MASK
CONFIG_SPECTRE1_WORKAROUND_LOAD_FENCE
...if only for easing performance testing and let the distribution set
its policy.

Where hot-path usages can do:

    nospec_relax(nospec_array_ptr())
AND approach doesn't prevent speculation hence nospec_ is an incorrect prefix.
Alan's "speculation management" terminology fits well here.

Can we keep array_access() name and change it underneath to
either mask or lfence ?
Thread (136 messages) 136 messages, 29 authors, last reply 2018-01-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help