Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1600627
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] x86, kasan: add KASAN checks to atomic operations |
| Date | 2017-03-14 16:50 +0100 |
| Message-ID | <tkWRX-29k-3@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <tiLHj-8qM-7@gated-at.bofh.it> <tiLHj-8qM-9@gated-at.bofh.it> <tiOOS-1ZF-5@gated-at.bofh.it> <tkWyD-20n-39@gated-at.bofh.it> <tkWIi-25L-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Mar 14, 2017 at 04:32:30PM +0100, Peter Zijlstra wrote:
> On Tue, Mar 14, 2017 at 04:22:52PM +0100, Dmitry Vyukov wrote:
> > -static __always_inline int atomic_read(const atomic_t *v)
> > +static __always_inline int arch_atomic_read(const atomic_t *v)
> > {
> > - return READ_ONCE((v)->counter);
> > + return READ_ONCE_NOCHECK((v)->counter);
>
> Should NOCHEKC come with a comment, because i've no idea why this is so.
I suspect the idea is that given the wrapper will have done the KASAN
check, duplicating it here is either sub-optimal, or results in
duplicate splats. READ_ONCE() has an implicit KASAN check,
READ_ONCE_NOCHECK() does not.
If this is to solve duplicate splats, it'd be worth having a
WRITE_ONCE_NOCHECK() for arch_atomic_set().
Agreed on the comment, regardless.
Thanks,
Mark.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] x86, kasan: add KASAN checks to atomic operations Peter Zijlstra <peterz@infradead.org> - 2017-03-14 16:40 +0100
Re: [PATCH] x86, kasan: add KASAN checks to atomic operations Mark Rutland <mark.rutland@arm.com> - 2017-03-14 16:50 +0100
Re: [PATCH] x86, kasan: add KASAN checks to atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-14 20:30 +0100
csiph-web