[lkml]   [2018]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 01/18] asm-generic/barrier: add generic nospec helpers
On Fri, Jan 5, 2018 at 6:55 PM, Linus Torvalds
<> wrote:
> On Fri, Jan 5, 2018 at 5:09 PM, Dan Williams <> wrote:
>> +#ifndef nospec_ptr
>> +#define nospec_ptr(ptr, lo, hi) \
> Do we actually want this horrible interface?
> It just causes the compiler - or inline asm - to generate worse code,
> because it needs to compare against both high and low limits.
> Basically all users are arrays that are zero-based, and where a
> comparison against the high _index_ limit would be sufficient.
> But the way this is all designed, it's literally designed for bad code
> generation for the unusual case, and the usual array case is written
> in the form of the unusual and wrong non-array case. That really seems
> excessively stupid.

Yes, it appears we can kill nospec_ptr() and move nospec_array_ptr()
to assume 0 based arrays rather than use nospec_ptr.

 \ /
  Last update: 2018-01-06 06:23    [W:0.162 / U:1.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site