diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-11-11 08:25:07 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-11-11 08:25:07 +0100 |
commit | 4c8ee71620d734c8ad129fad085167f56f9ce351 (patch) | |
tree | 87208b0144aa664c96dd8b43bbcaaf1f25af606b /kernel/kcov.c | |
parent | c7faee2109f978f3ef826c48b7e60609061fda4f (diff) | |
parent | 27bcd37e0240bbe33f0efe244b5aad52104115b3 (diff) |
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/kcov.c')
-rw-r--r-- | kernel/kcov.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/kcov.c b/kernel/kcov.c index 8d44b3fea9d0..30e6d05aa5a9 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c @@ -53,8 +53,15 @@ void notrace __sanitizer_cov_trace_pc(void) /* * We are interested in code coverage as a function of a syscall inputs, * so we ignore code executed in interrupts. + * The checks for whether we are in an interrupt are open-coded, because + * 1. We can't use in_interrupt() here, since it also returns true + * when we are inside local_bh_disable() section. + * 2. We don't want to use (in_irq() | in_serving_softirq() | in_nmi()), + * since that leads to slower generated code (three separate tests, + * one for each of the flags). */ - if (!t || in_interrupt()) + if (!t || (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_OFFSET + | NMI_MASK))) return; mode = READ_ONCE(t->kcov_mode); if (mode == KCOV_MODE_TRACE) { |