Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Mark Rutland
On Wed, May 29, 2019 at 12:57:15PM +0200, Dmitry Vyukov wrote: > On Wed, May 29, 2019 at 12:30 PM Peter Zijlstra wrote: > > > > On Wed, May 29, 2019 at 12:16:31PM +0200, Marco Elver wrote: > > > On Wed, 29 May 2019 at 12:01, Peter Zijlstra wrote: > > > > > > > > On Wed, May 29, 2019 at 11:20:17AM

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Peter Zijlstra
On Wed, May 29, 2019 at 01:29:51PM +0200, Dmitry Vyukov wrote: > Thanks. I've filed https://bugzilla.kernel.org/show_bug.cgi?id=203751 > for checking alignment with all the points and references, so that > it's not lost. Thanks!

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Peter Zijlstra
On Wed, May 29, 2019 at 11:20:56AM +, David Laight wrote: > From: Dmitry Vyukov > > Sent: 29 May 2019 11:57 > > Interesting. Does an address passed to bitops also should be aligned, > > or alignment is supposed to be handled by bitops themselves? > > The bitops are defined on 'long []' and it

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Dmitry Vyukov
On Wed, May 29, 2019 at 1:23 PM Andrey Ryabinin wrote: > On 5/29/19 1:57 PM, Dmitry Vyukov wrote: > > On Wed, May 29, 2019 at 12:30 PM Peter Zijlstra > > wrote: > >> > >> On Wed, May 29, 2019 at 12:16:31PM +0200, Marco Elver wrote: > >>> On Wed, 29 May 2019 at 12:01, Peter Zijlstra wrote: > >>>

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Andrey Ryabinin
On 5/29/19 1:57 PM, Dmitry Vyukov wrote: > On Wed, May 29, 2019 at 12:30 PM Peter Zijlstra wrote: >> >> On Wed, May 29, 2019 at 12:16:31PM +0200, Marco Elver wrote: >>> On Wed, 29 May 2019 at 12:01, Peter Zijlstra wrote: On Wed, May 29, 2019 at 11:20:17AM +0200, Marco Elver wrote: >>

RE: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread David Laight
From: Dmitry Vyukov > Sent: 29 May 2019 11:57 > On Wed, May 29, 2019 at 12:30 PM Peter Zijlstra wrote: > > > > On Wed, May 29, 2019 at 12:16:31PM +0200, Marco Elver wrote: > > > On Wed, 29 May 2019 at 12:01, Peter Zijlstra wrote: > > > > > > > > On Wed, May 29, 2019 at 11:20:17AM +0200, Marco Elv

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Dmitry Vyukov
On Wed, May 29, 2019 at 12:30 PM Peter Zijlstra wrote: > > On Wed, May 29, 2019 at 12:16:31PM +0200, Marco Elver wrote: > > On Wed, 29 May 2019 at 12:01, Peter Zijlstra wrote: > > > > > > On Wed, May 29, 2019 at 11:20:17AM +0200, Marco Elver wrote: > > > > For the default, we decided to err on th

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Peter Zijlstra
On Wed, May 29, 2019 at 12:16:31PM +0200, Marco Elver wrote: > On Wed, 29 May 2019 at 12:01, Peter Zijlstra wrote: > > > > On Wed, May 29, 2019 at 11:20:17AM +0200, Marco Elver wrote: > > > For the default, we decided to err on the conservative side for now, > > > since it seems that e.g. x86 oper

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Marco Elver
On Wed, 29 May 2019 at 12:01, Peter Zijlstra wrote: > > On Wed, May 29, 2019 at 11:20:17AM +0200, Marco Elver wrote: > > For the default, we decided to err on the conservative side for now, > > since it seems that e.g. x86 operates only on the byte the bit is on. > > This is not correct, see for i

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Peter Zijlstra
On Wed, May 29, 2019 at 11:20:17AM +0200, Marco Elver wrote: > For the default, we decided to err on the conservative side for now, > since it seems that e.g. x86 operates only on the byte the bit is on. This is not correct, see for instance set_bit(): static __always_inline void set_bit(long nr,

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Marco Elver
On Wed, 29 May 2019 at 10:53, Dmitry Vyukov wrote: > > On Tue, May 28, 2019 at 6:50 PM Mark Rutland wrote: > > > > On Tue, May 28, 2019 at 06:32:58PM +0200, Marco Elver wrote: > > > This adds a new header to asm-generic to allow optionally instrumenting > > > architecture-specific asm implementat

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-29 Thread Dmitry Vyukov
On Tue, May 28, 2019 at 6:50 PM Mark Rutland wrote: > > On Tue, May 28, 2019 at 06:32:58PM +0200, Marco Elver wrote: > > This adds a new header to asm-generic to allow optionally instrumenting > > architecture-specific asm implementations of bitops. > > > > This change includes the required change

Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-28 Thread Mark Rutland
On Tue, May 28, 2019 at 06:32:58PM +0200, Marco Elver wrote: > This adds a new header to asm-generic to allow optionally instrumenting > architecture-specific asm implementations of bitops. > > This change includes the required change for x86 as reference and > changes the kernel API doc to point

[PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN

2019-05-28 Thread Marco Elver
This adds a new header to asm-generic to allow optionally instrumenting architecture-specific asm implementations of bitops. This change includes the required change for x86 as reference and changes the kernel API doc to point to bitops-instrumented.h instead. Rationale: the functions in x86's bit