[PATCH v3 51/51] context_tracking: Fix noinstr vs KASAN
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: peterz@xxxxxxxxxxxxx
- Subject: [PATCH v3 51/51] context_tracking: Fix noinstr vs KASAN
- From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
- Date: Thu, 12 Jan 2023 20:44:05 +0100
- Cc: richard.henderson@xxxxxxxxxx, ink@xxxxxxxxxxxxxxxxxxxx, mattst88@xxxxxxxxx, vgupta@xxxxxxxxxx, linux@xxxxxxxxxxxxxxx, nsekhar@xxxxxx, brgl@xxxxxxxx, ulli.kroll@xxxxxxxxxxxxxx, linus.walleij@xxxxxxxxxx, shawnguo@xxxxxxxxxx, Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>, kernel@xxxxxxxxxxxxxx, festevam@xxxxxxxxx, linux-imx@xxxxxxx, tony@xxxxxxxxxxx, khilman@xxxxxxxxxx, krzysztof.kozlowski@xxxxxxxxxx, alim.akhtar@xxxxxxxxxxx, catalin.marinas@xxxxxxx, will@xxxxxxxxxx, guoren@xxxxxxxxxx, bcain@xxxxxxxxxxx, chenhuacai@xxxxxxxxxx, kernel@xxxxxxxxxx, geert@xxxxxxxxxxxxxx, sammy@xxxxxxxxx, monstr@xxxxxxxxx, tsbogend@xxxxxxxxxxxxxxxx, dinguyen@xxxxxxxxxx, jonas@xxxxxxxxxxxx, stefan.kristiansson@xxxxxxxxxxxxx, shorne@xxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, deller@xxxxxx, mpe@xxxxxxxxxxxxxx, npiggin@xxxxxxxxx, christophe.leroy@xxxxxxxxxx, paul.walmsley@xxxxxxxxxx, palmer@xxxxxxxxxxx, aou@xxxxxxxxxxxxxxxxx, hca@xxxxxxxxxxxxx, gor@xxxxxxxxxxxxx, agordeev@xxxxxxxxxxxxx, borntraeger@xxxxxxxxxxxxx, svens@xxxxxxxxxxxxx, ysato@xxxxxxxxxxxxx, dalias@xxxxxxxx, davem@xxxxxxxxxxxxx, richard@xxxxxx, anton.ivanov@xxxxxxxxxxxxxxxxxx, johannes@xxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, acme@xxxxxxxxxx, mark.rutland@xxxxxxx, alexander.shishkin@xxxxxxxxxxxxxxx, jolsa@xxxxxxxxxx, namhyung@xxxxxxxxxx, jgross@xxxxxxxx, srivatsa@xxxxxxxxxxxxx, amakhalov@xxxxxxxxxx, pv-drivers@xxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, chris@xxxxxxxxxx, jcmvbkbc@xxxxxxxxx, rafael@xxxxxxxxxx, lenb@xxxxxxxxxx, pavel@xxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, mturquette@xxxxxxxxxxxx, sboyd@xxxxxxxxxx, daniel.lezcano@xxxxxxxxxx, lpieralisi@xxxxxxxxxx, sudeep.holla@xxxxxxx, agross@xxxxxxxxxx, andersson@xxxxxxxxxx, konrad.dybcio@xxxxxxxxxx, anup@xxxxxxxxxxxxxx, thierry.reding@xxxxxxxxx, jonathanh@xxxxxxxxxx, jacob.jun.pan@xxxxxxxxxxxxxxx, atishp@xxxxxxxxxxxxxx, Arnd Bergmann <arnd@xxxxxxxx>, yury.norov@xxxxxxxxx, andriy.shevchenko@xxxxxxxxxxxxxxx, linux@xxxxxxxxxxxxxxxxxx, dennis@xxxxxxxxxx, tj@xxxxxxxxxx, cl@xxxxxxxxx, rostedt@xxxxxxxxxxx, mhiramat@xxxxxxxxxx, frederic@xxxxxxxxxx, paulmck@xxxxxxxxxx, pmladek@xxxxxxxx, senozhatsky@xxxxxxxxxxxx, john.ogness@xxxxxxxxxxxxx, juri.lelli@xxxxxxxxxx, vincent.guittot@xxxxxxxxxx, dietmar.eggemann@xxxxxxx, bsegall@xxxxxxxxxx, mgorman@xxxxxxx, bristot@xxxxxxxxxx, vschneid@xxxxxxxxxx, ryabinin.a.a@xxxxxxxxx, glider@xxxxxxxxxx, andreyknvl@xxxxxxxxx, dvyukov@xxxxxxxxxx, vincenzo.frascino@xxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, jpoimboe@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-omap@xxxxxxxxxxxxxxx, linux-samsung-soc@xxxxxxxxxxxxxxx, linux-csky@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, linux-perf-users@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-clk@xxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, linux-tegra@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, linux-trace-kernel@xxxxxxxxxxxxxxx, kasan-dev@xxxxxxxxxxxxxxxx
- References: <20230112194314.845371875@infradead.org>
- User-agent: quilt/0.66
vmlinux.o: warning: objtool: __ct_user_enter+0x72: call to __kasan_check_write() leaves .noinstr.text section
vmlinux.o: warning: objtool: __ct_user_exit+0x47: call to __kasan_check_write() leaves .noinstr.text section
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
kernel/context_tracking.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/kernel/context_tracking.c
+++ b/kernel/context_tracking.c
@@ -510,7 +510,7 @@ void noinstr __ct_user_enter(enum ctx_st
* In this we case we don't care about any concurrency/ordering.
*/
if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE))
- atomic_set(&ct->state, state);
+ arch_atomic_set(&ct->state, state);
} else {
/*
* Even if context tracking is disabled on this CPU, because it's outside
@@ -527,7 +527,7 @@ void noinstr __ct_user_enter(enum ctx_st
*/
if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE)) {
/* Tracking for vtime only, no concurrent RCU EQS accounting */
- atomic_set(&ct->state, state);
+ arch_atomic_set(&ct->state, state);
} else {
/*
* Tracking for vtime and RCU EQS. Make sure we don't race
@@ -535,7 +535,7 @@ void noinstr __ct_user_enter(enum ctx_st
* RCU only requires RCU_DYNTICKS_IDX increments to be fully
* ordered.
*/
- atomic_add(state, &ct->state);
+ arch_atomic_add(state, &ct->state);
}
}
}
@@ -630,12 +630,12 @@ void noinstr __ct_user_exit(enum ctx_sta
* In this we case we don't care about any concurrency/ordering.
*/
if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE))
- atomic_set(&ct->state, CONTEXT_KERNEL);
+ arch_atomic_set(&ct->state, CONTEXT_KERNEL);
} else {
if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE)) {
/* Tracking for vtime only, no concurrent RCU EQS accounting */
- atomic_set(&ct->state, CONTEXT_KERNEL);
+ arch_atomic_set(&ct->state, CONTEXT_KERNEL);
} else {
/*
* Tracking for vtime and RCU EQS. Make sure we don't race
@@ -643,7 +643,7 @@ void noinstr __ct_user_exit(enum ctx_sta
* RCU only requires RCU_DYNTICKS_IDX increments to be fully
* ordered.
*/
- atomic_sub(state, &ct->state);
+ arch_atomic_sub(state, &ct->state);
}
}
}
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]