From: tip-bot for Mark Rutland <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: boqun.feng@gmail.com, tglx@linutronix.de,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
mark.rutland@arm.com, will.deacon@arm.com, peterz@infradead.org,
mingo@kernel.org, dvyukov@google.com, hpa@zytor.com
Subject: [tip:locking/core] locking/atomics/x86: Reduce arch_cmpxchg64*() instrumentation
Date: Wed, 25 Jul 2018 07:34:03 -0700 [thread overview]
Message-ID: <tip-00d5551cc4eec0fc39c3871c25c613553acfb866@git.kernel.org> (raw)
In-Reply-To: <20180716113017.3909-3-mark.rutland@arm.com>
Commit-ID: 00d5551cc4eec0fc39c3871c25c613553acfb866
Gitweb: https://git.kernel.org/tip/00d5551cc4eec0fc39c3871c25c613553acfb866
Author: Mark Rutland <mark.rutland@arm.com>
AuthorDate: Mon, 16 Jul 2018 12:30:07 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 25 Jul 2018 11:53:58 +0200
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index bfca3b346c74..072e5459fe2f 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -10,13 +10,13 @@ static inline void set_64bit(volatile u64 *ptr, u64 val)
#define arch_cmpxchg64(ptr, o, n) \
({ \
BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
- cmpxchg((ptr), (o), (n)); \
+ arch_cmpxchg((ptr), (o), (n)); \
})
#define arch_cmpxchg64_local(ptr, o, n) \
({ \
BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
- cmpxchg_local((ptr), (o), (n)); \
+ arch_cmpxchg_local((ptr), (o), (n)); \
})
#define system_has_cmpxchg_double() boot_cpu_has(X86_FEATURE_CX16)
next prev parent reply other threads:[~2018-07-25 14:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 11:30 [PATCHv4 00/12] atomics: generate atomic headers / instrument arm64 Mark Rutland
2018-07-16 11:30 ` [PATCHv4 01/12] atomic/tty: Fix up atomic abuse in ldsem Mark Rutland
2018-07-24 7:15 ` Ingo Molnar
2018-07-24 9:20 ` Peter Zijlstra
2018-07-24 9:23 ` Mark Rutland
2018-07-24 11:13 ` Ingo Molnar
2018-07-24 13:05 ` Mark Rutland
2018-07-24 13:40 ` Ingo Molnar
2018-07-24 15:06 ` Mark Rutland
2018-07-16 11:30 ` [PATCHv4 02/12] atomics/x86: reduce arch_cmpxchg64*() instrumentation Mark Rutland
2018-07-16 19:23 ` Thomas Gleixner
2018-07-25 14:34 ` tip-bot for Mark Rutland [this message]
2018-07-16 11:30 ` [PATCHv4 03/12] atomics: simplify cmpxchg() instrumentation Mark Rutland
2018-07-25 14:34 ` [tip:locking/core] locking/atomics: Simplify " tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 04/12] atomics/treewide: instrument xchg() Mark Rutland
2018-07-25 14:35 ` [tip:locking/core] locking/atomics: Instrument xchg() tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 05/12] atomics: instrument cmpxchg_double*() Mark Rutland
2018-07-25 14:35 ` [tip:locking/core] locking/atomics: Instrument cmpxchg_double*() tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 06/12] atomics/treewide: rework ordering barriers Mark Rutland
2018-07-25 14:36 ` [tip:locking/core] locking/atomics: Rework " tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 07/12] atomics: add common header generation files Mark Rutland
2018-07-16 11:30 ` [PATCHv4 08/12] atomics: switch to generated fallbacks Mark Rutland
2018-07-16 11:30 ` [PATCHv4 09/12] atomics: switch to generated atomic-long Mark Rutland
2018-07-16 11:30 ` [PATCHv4 10/12] atomics: switch to generated instrumentation Mark Rutland
2018-07-16 11:30 ` [PATCHv4 11/12] atomics: check generated headers are up-to-date Mark Rutland
2018-07-16 11:30 ` [PATCHv4 12/12] arm64: use instrumented atomics Mark Rutland
2018-07-23 9:57 ` [PATCHv4 00/12] atomics: generate atomic headers / instrument arm64 Mark Rutland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-00d5551cc4eec0fc39c3871c25c613553acfb866@git.kernel.org \
--to=tipbot@zytor.com \
--cc=boqun.feng@gmail.com \
--cc=dvyukov@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome