Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-24 Thread Ricardo Neri
On Fri, 2017-02-24 at 09:47 -0500, Nathan Howard wrote: > Also, this code would read better with the inner test > reversed or done first > > if (indx_offset < 0) { > if (indx_offset != -EDOM) >

Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-24 Thread Adan Hawthorn
On Thu, Feb 23, 2017 at 9:33 PM, Joe Perches wrote: > On Thu, 2017-02-23 at 14:17 -0800, Ricardo Neri wrote: >> On Thu, 2017-02-23 at 08:24 +0100, Peter Zijlstra wrote: >> > On Wed, Feb 22, 2017 at 10:36:50PM -0800, Ricardo Neri wrote: >> > > + /* >> > > + * A nega

Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-23 Thread Ricardo Neri
On Thu, 2017-02-23 at 18:33 -0800, Joe Perches wrote: > On Thu, 2017-02-23 at 14:17 -0800, Ricardo Neri wrote: > > On Thu, 2017-02-23 at 08:24 +0100, Peter Zijlstra wrote: > > > On Wed, Feb 22, 2017 at 10:36:50PM -0800, Ricardo Neri wrote: > > > > + /* > > > > +

Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-23 Thread Joe Perches
On Thu, 2017-02-23 at 14:17 -0800, Ricardo Neri wrote: > On Thu, 2017-02-23 at 08:24 +0100, Peter Zijlstra wrote: > > On Wed, Feb 22, 2017 at 10:36:50PM -0800, Ricardo Neri wrote: > > > + /* > > > + * A negative offset generally means a error, except > > > +

Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-23 Thread Ricardo Neri
On Thu, 2017-02-23 at 08:24 +0100, Peter Zijlstra wrote: > On Wed, Feb 22, 2017 at 10:36:50PM -0800, Ricardo Neri wrote: > > + /* > > +* A negative offset generally means a error, except > > +* -EDOM, which means that the contents of the reg

Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-23 Thread Paul Crawford
On 23/02/17 07:24, Peter Zijlstra wrote: On Wed, Feb 22, 2017 at 10:36:50PM -0800, Ricardo Neri wrote: + /* +* A negative offset generally means a error, except +* -EDOM, which means that the contents of the register +

Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-22 Thread Peter Zijlstra
On Wed, Feb 22, 2017 at 10:36:50PM -0800, Ricardo Neri wrote: > + /* > + * A negative offset generally means a error, except > + * -EDOM, which means that the contents of the register > + * should not be used as inde

[PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

2017-02-22 Thread Ricardo Neri
Section 2.2.1.2 of the Intel 64 and IA-32 Architectures Software Developer's Manual volume 2A states that when memory addressing is used (i.e., mod part of ModR/M is not 3), a SIB byte is used and the index of the SIB byte points to the R/ESP (i.e., index = 4), the index should not be used in the c