OSDN Git Service

locking/atomics/x86: Reduce arch_cmpxchg64*() instrumentation
authorMark Rutland <mark.rutland@arm.com>
Mon, 16 Jul 2018 11:30:07 +0000 (12:30 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 25 Jul 2018 09:53:58 +0000 (11:53 +0200)
commit00d5551cc4eec0fc39c3871c25c613553acfb866
tree0211b44aef123f99f4651a15992bcb106e659e51
parent71b7ff5ebc9b1d5aa95eb48d6388234f1304fd19
locking/atomics/x86: Reduce arch_cmpxchg64*() instrumentation

Currently x86's arch_cmpxchg64() and arch_cmpxchg64_local() are
instrumented twice, as they call into instrumented atomics rather than
their arch_ equivalents.

A call to cmpxchg64() results in:

  cmpxchg64()
    kasan_check_write()
    arch_cmpxchg64()
      cmpxchg()
        kasan_check_write()
        arch_cmpxchg()

Let's fix this up and call the arch_ equivalents, resulting in:

  cmpxchg64()
    kasan_check_write()
    arch_cmpxchg64()
      arch_cmpxchg()

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: andy.shevchenko@gmail.com
Cc: arnd@arndb.de
Cc: aryabinin@virtuozzo.com
Cc: catalin.marinas@arm.com
Cc: glider@google.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: parri.andrea@gmail.com
Cc: peter@hurleysoftware.com
Link: http://lkml.kernel.org/r/20180716113017.3909-3-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/cmpxchg_64.h