lkml.org 
[lkml]   [2020]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH -rcu] asm-generic, kcsan: Add KCSAN instrumentation for bitops
On Wed, 15 Jan 2020 at 20:27, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wed, Jan 15, 2020 at 5:58 PM Marco Elver <elver@google.com> wrote:
> > * set_bit - Atomically set a bit in memory
> > @@ -26,6 +27,7 @@
> > static inline void set_bit(long nr, volatile unsigned long *addr)
> > {
> > kasan_check_write(addr + BIT_WORD(nr), sizeof(long));
> > + kcsan_check_atomic_write(addr + BIT_WORD(nr), sizeof(long));
> > arch_set_bit(nr, addr);
> > }
>
> It looks like you add a kcsan_check_atomic_write or kcsan_check_write directly
> next to almost any instance of kasan_check_write().
>
> Are there any cases where we actually just need one of the two but not the
> other? If not, maybe it's better to rename the macro and have it do both things
> as needed?

Do you mean adding an inline helper at the top of each bitops header
here, similar to what we did for atomic-instrumented? Happy to do
that if it improves readability.

Thanks,
-- Marco

\
 
 \ /
  Last update: 2020-01-15 20:51    [W:0.066 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site