From: kernel test robot <lkp@intel.com>
To: Vikram Singh <vikram.singh3@oss.qualcomm.com>
Cc: oe-kbuild-all@lists.linux.dev, Anup Patel <anup@brainfault.org>,
Rajnesh Kanwal <rajnesh.kanwal49@gmail.com>
Subject: [avpatel:riscv_sbi_watchdog_v1 94/98] drivers/perf/riscv_ctr.c:435:18: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Sun, 08 Nov 2026 20:10:41 +0100 [thread overview]
Message-ID: <202611082009.K7RVG572-lkp@intel.com> (raw)
tree: https://github.com/avpatel/linux.git riscv_sbi_watchdog_v1
head: 929bf13433e242a3f255f463b2fb44633e102e0d
commit: b4cc5b9ca0cada8221e31b647640bbae515000a1 [94/98] riscv: pmu: Add driver for Control Transfer Records Ext
config: riscv-randconfig-r2304-20261108 (https://download.01.org/0day-ci/archive/20261108/202611082009.K7RVG572-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 11.5.0
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261108/202611082009.K7RVG572-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202611082009.K7RVG572-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/perf/riscv_ctr.c:435:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *task_ctx @@ got struct perf_ctx_data [noderef] __rcu * @@
drivers/perf/riscv_ctr.c:435:18: sparse: expected void *task_ctx
drivers/perf/riscv_ctr.c:435:18: sparse: got struct perf_ctx_data [noderef] __rcu *
>> drivers/perf/riscv_ctr.c:462:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ctx @@ got struct perf_ctx_data [noderef] __rcu *perf_ctx_data @@
drivers/perf/riscv_ctr.c:462:46: sparse: expected void *ctx
drivers/perf/riscv_ctr.c:462:46: sparse: got struct perf_ctx_data [noderef] __rcu *perf_ctx_data
drivers/perf/riscv_ctr.c:477:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ctx @@ got struct perf_ctx_data [noderef] __rcu *perf_ctx_data @@
drivers/perf/riscv_ctr.c:477:46: sparse: expected void *ctx
drivers/perf/riscv_ctr.c:477:46: sparse: got struct perf_ctx_data [noderef] __rcu *perf_ctx_data
vim +435 drivers/perf/riscv_ctr.c
416
417 /*
418 * On context switch in, we need to make sure no samples from previous tasks
419 * are left in the CTR.
420 *
421 * On ctxswin, sched_in = true, called after the PMU has started
422 * On ctxswout, sched_in = false, called before the PMU is stopped
423 */
424 void riscv_pmu_ctr_sched_task(struct perf_event_pmu_context *pmu_ctx, struct task_struct *task,
425 bool sched_in)
426 {
427 struct riscv_pmu *rvpmu = to_riscv_pmu(pmu_ctx->pmu);
428 struct cpu_hw_events *cpuc = this_cpu_ptr(rvpmu->hw_events);
429 void *task_ctx;
430
431 if (!cpuc->ctr_users)
432 return;
433
434 /* Save branch records in task_ctx on sched out */
> 435 task_ctx = pmu_ctx ? task->perf_ctx_data : NULL;
436 if (task_ctx) {
437 if (sched_in)
438 riscv_pmu_ctr_restore(task_ctx);
439 else
440 riscv_pmu_ctr_save(task_ctx, rvpmu->ctr_depth);
441 return;
442 }
443
444 /* Reset branch records on sched in */
445 if (sched_in)
446 riscv_pmu_ctr_reset();
447 }
448
449 static inline bool branch_user_callstack(unsigned int br_type)
450 {
451 return (br_type & PERF_SAMPLE_BRANCH_USER) &&
452 (br_type & PERF_SAMPLE_BRANCH_CALL_STACK);
453 }
454
455 void riscv_pmu_ctr_add(struct perf_event *event)
456 {
457 struct riscv_pmu *rvpmu = to_riscv_pmu(event->pmu);
458 struct cpu_hw_events *cpuc = this_cpu_ptr(rvpmu->hw_events);
459
460 if (branch_user_callstack(event->attr.branch_sample_type) &&
461 event->ctx->task->perf_ctx_data)
> 462 task_context(event->ctx->task->perf_ctx_data)->callstack_users++;
463
464 perf_sched_cb_inc(event->pmu);
465
466 if (!cpuc->ctr_users++)
467 riscv_pmu_ctr_reset();
468 }
469
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-11-08 19:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202611082009.K7RVG572-lkp@intel.com \
--to=lkp@intel.com \
--cc=anup@brainfault.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rajnesh.kanwal49@gmail.com \
--cc=vikram.singh3@oss.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.