mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Zhijian Han <hanzhijian1991@gmail.com>
Cc: David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	David Dai <david.dai@linux.dev>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, daniel@iogearbox.net, ast@kernel.org,
	Tejun Heo <tj@kernel.org>
Subject: [PATCH sched_ext/for-7.5] selftests/sched_ext: Fix enable_cmask load failure on older clangs
Date: Mon,  9 Nov 2026 06:26:23 -1000	[thread overview]
Message-ID: <20261109162623.674441-1-tj@kernel.org> (raw)
In-Reply-To: <6af1e5f2.a438010f.130489.ab94@mx.google.com>

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@gmail.com>
Closes: https://lore.kernel.org/all/6af1e5f2.a438010f.130489.ab94@mx.google.com/
Signed-off-by: Tejun Heo <tj@kernel.org>
---
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


      reply	other threads:[~2026-11-09 16:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 15:25 sched_ext selftest enable_cmask fails to load on 7.4-rc2: verifier rejects arena pointer cast from scx_enable_args.cmask_arena_addr Zhijian Han
2026-11-09 16:26 ` Tejun Heo [this message]

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=20261109162623.674441-1-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=changwoo@igalia.com \
    --cc=daniel@iogearbox.net \
    --cc=david.dai@linux.dev \
    --cc=emil@etsalapatis.com \
    --cc=hanzhijian1991@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=void@manifault.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

all inboxes | Powered by JetHome®