[PATCH sched_ext/for-7.5] selftests/sched_ext: Fix enable_cmask load failure on older clangs
From: Tejun Heo
Date: Mon Nov 09 2026 - 11:28:53 EST
enable_cmask casts the u64 arena address of the task's cmask to an __arena
pointer without cast_kern(). Older clangs without
__BPF_FEATURE_ADDR_SPACE_CAST need the explicit cast, so the test fails to
load there. Add it.
Reported-by: Zhijian Han <hanzhijian1991@xxxxxxxxx>
Closes: https://lore.kernel.org/all/6af1e5f2.a438010f.130489.ab94@xxxxxxxxxxxxx/
Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
---
Applied to sched_ext/for-7.5.
tools/testing/selftests/sched_ext/enable_cmask.bpf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/sched_ext/enable_cmask.bpf.c b/tools/testing/selftests/sched_ext/enable_cmask.bpf.c
index 0068f3c7ab3c..081be5861424 100644
--- a/tools/testing/selftests/sched_ext/enable_cmask.bpf.c
+++ b/tools/testing/selftests/sched_ext/enable_cmask.bpf.c
@@ -104,6 +104,7 @@ void BPF_STRUCT_OPS(enable_cmask_enable, struct task_struct *p, struct scx_enabl
int ret;
asm volatile("" :: "r"(&arena));
+ cast_kern(m);
tctx = lookup_task_ctx(p);
if (!tctx)
return;
--
2.56.0