* [avpatel:riscv_sbi_watchdog_v1 94/98] drivers/perf/riscv_ctr.c:435:18: sparse: sparse: incorrect type in assignment (different address spaces)
@ 2026-11-08 19:10 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-08 19:10 UTC (permalink / raw)
To: Vikram Singh; +Cc: oe-kbuild-all, Anup Patel, Rajnesh Kanwal
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-08 19:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08 19:10 [avpatel:riscv_sbi_watchdog_v1 94/98] drivers/perf/riscv_ctr.c:435:18: sparse: sparse: incorrect type in assignment (different address spaces) kernel test robot
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.