From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Rohan McLure <rmclure@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Sasha Levin <sashal@kernel.org>,
npiggin@gmail.com, christophe.leroy@csgroup.eu,
alexandre.belloni@bootlin.com, Julia.Lawall@inria.fr,
ganeshgr@linux.ibm.com, heying24@huawei.com,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH AUTOSEL 6.1 11/15] powerpc/kcsan: Exclude udelay to prevent recursive instrumentation
Date: Sun, 5 Mar 2023 08:53:02 -0500 [thread overview]
Message-ID: <20230305135306.1793564-11-sashal@kernel.org> (raw)
In-Reply-To: <20230305135306.1793564-1-sashal@kernel.org>
From: Rohan McLure <rmclure@linux.ibm.com>
[ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ]
In order for KCSAN to increase its likelihood of observing a data race,
it sets a watchpoint on memory accesses and stalls, allowing for
detection of conflicting accesses by other kernel threads or interrupts.
Stalls are implemented by injecting a call to udelay in instrumented code.
To prevent recursive instrumentation, exclude udelay from being instrumented.
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230206021801.105268-3-rmclure@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/kernel/time.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index f157552d79b38..285159e65a3ba 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -374,7 +374,7 @@ void vtime_flush(struct task_struct *tsk)
#define calc_cputime_factors()
#endif
-void __delay(unsigned long loops)
+void __no_kcsan __delay(unsigned long loops)
{
unsigned long start;
@@ -395,7 +395,7 @@ void __delay(unsigned long loops)
}
EXPORT_SYMBOL(__delay);
-void udelay(unsigned long usecs)
+void __no_kcsan udelay(unsigned long usecs)
{
__delay(tb_ticks_per_usec * usecs);
}
--
2.39.2
next prev parent reply other threads:[~2023-03-05 13:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-05 13:52 [PATCH AUTOSEL 6.1 01/15] clk: qcom: mmcc-apq8084: remove spdm clocks Sasha Levin
2023-03-05 13:52 ` [PATCH AUTOSEL 6.1 02/15] MIPS: Fix a compilation issue Sasha Levin
2023-03-05 13:52 ` [PATCH AUTOSEL 6.1 03/15] powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ Sasha Levin
2023-03-05 13:52 ` [PATCH AUTOSEL 6.1 04/15] powerpc/64: Don't recurse irq replay Sasha Levin
2023-03-05 13:52 ` [PATCH AUTOSEL 6.1 05/15] s390/virtio: sort out physical vs virtual pointers usage Sasha Levin
2023-03-05 13:52 ` [PATCH AUTOSEL 6.1 06/15] powerpc/iommu: fix memory leak with using debugfs_lookup() Sasha Levin
2023-03-05 13:52 ` [PATCH AUTOSEL 6.1 07/15] clk: renesas: rcar-gen3: Disable R-Car H3 ES1.* Sasha Levin
2023-03-05 13:52 ` [PATCH AUTOSEL 6.1 08/15] powerpc/bpf/32: Only set a stack frame when necessary Sasha Levin
2023-03-05 13:53 ` [PATCH AUTOSEL 6.1 09/15] powerpc/64: Fix task_cpu in early boot when booting non-zero cpuid Sasha Levin
2023-03-05 13:53 ` [PATCH AUTOSEL 6.1 10/15] powerpc/64: Move paca allocation to early_setup() Sasha Levin
2023-03-05 13:53 ` Sasha Levin [this message]
2023-03-05 13:53 ` [PATCH AUTOSEL 6.1 12/15] alpha: fix R_ALPHA_LITERAL reloc for large modules Sasha Levin
2023-03-05 13:53 ` [PATCH AUTOSEL 6.1 13/15] macintosh: windfarm: Use unsigned type for 1-bit bitfields Sasha Levin
2023-03-05 13:53 ` [PATCH AUTOSEL 6.1 14/15] PCI: Add SolidRun vendor ID Sasha Levin
2023-03-05 13:53 ` [PATCH AUTOSEL 6.1 15/15] PCI: Avoid FLR for SolidRun SNET DPU rev 1 Sasha Levin
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=20230305135306.1793564-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Julia.Lawall@inria.fr \
--cc=alexandre.belloni@bootlin.com \
--cc=christophe.leroy@csgroup.eu \
--cc=ganeshgr@linux.ibm.com \
--cc=heying24@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=rmclure@linux.ibm.com \
--cc=stable@vger.kernel.org \
/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