Quantcast
Channel: lkml.org : Vaidyanathan Srinivasan
Viewing all articles
Browse latest Browse all 890

Re: [RFC PATCH] asm/generic: introduce if_nospec and nospec_barrier

$
0
0
Linus Torvalds writes: (Summary) Which makes me suspect that lfence is a bad idea too.
suspect that lfence is a bad idea too.
If one common pattern is going to be bounces checking array accesses like this, then we probably should strive to turn
like this, then we probably should strive to turn
    if (index <

and the *implementation* might be architecture-specific, but one
particular implementation would be something like simply

#define array_access(base, idx, max) ({                         \
        union { typeof(base[0]) _val; } __u;\
        unsigned long _i = (idx);

Viewing all articles
Browse latest Browse all 890

Trending Articles