Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1600841
| From | Dmitry Vyukov <dvyukov@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] x86, kasan: add KASAN checks to atomic operations |
| Date | 2017-03-14 20:30 +0100 |
| Message-ID | <tl0iS-4M7-13@gated-at.bofh.it> (permalink) |
| References | (6 earlier) <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> <tkWRX-29k-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Mar 14, 2017 at 4:44 PM, Mark Rutland <mark.rutland@arm.com> 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.
Reverted xchg changes.
Added comments re READ_ONCE_NOCHECK() and WRITE_ONCE().
Added file comment.
Split into 3 patches and mailed.
Thanks!
Back to linux.kernel | Previous | Next — Previous 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