Public bug reported:

[Impact]

The Resolute upstream stable patchset 2026-10-05 (LP: #2169638) included

  077d4d8d3115 coresight: etm4x: Set active path on target CPU
               (upstream b6d54a94dcf42d405ed6de502c42572b2a462445)

backported as a prerequisite for "coresight: etm4x: missing
cscfg_csdev_disable_active_config() in perf enable" (upstream 0a47f0be6557).

That commit assigns csdev->path in coresight-etm4x-core.c, but the member
is introduced by the preceding upstream commit

  ac8eac9062ee coresight: Save active path for system tracers

which was not backported. Any kernel built with
CONFIG_CORESIGHT_SOURCE_ETM4X fails to compile:

  drivers/hwtracing/coresight/coresight-etm4x-core.c:642:14: error:
    'struct coresight_device' has no member named 'path'
  (also at lines 916, 1096 and 1126)

The generic resolute/linux arm64 config has CONFIG_CORESIGHT=n, so the
main kernel is unaffected. Derivatives that enable CoreSight (e.g.
linux-nvidia-bos, CONFIG_CORESIGHT_SOURCE_ETM4X=m "Required for Grace
enablement") fail to build on top of the 7.0.0-44.44 base.

[Fix]

Backport upstream commit ac8eac9062eefc33f5e97e526eef69bc98ecbdbc
("coresight: Save active path for system tracers").

It does not apply cleanly: it changes coresight_enable_source(), which was
added by upstream a18e877b0491 ("coresight: Introduce
coresight_enable_source() helper"), not present in Resolute. The backport
adds the same 'path' member to struct coresight_device, clears it in
coresight_disable_source() for non per-CPU sources, and sets it in
coresight_enable_source_sysfs() right after a successful source enable.
That is the only place that enables non per-CPU sources (e.g. STM). Per-CPU
ETM sources already set the path on the target CPU via 077d4d8d3115.

[Test Plan]

1. Build an arm64 kernel with CONFIG_CORESIGHT=m and
   CONFIG_CORESIGHT_SOURCE_ETM4X=m; it fails without the fix and succeeds
   with it.
2. On CoreSight-capable arm64 hardware (e.g. NVIDIA Grace), load
   coresight-etm4x and run a perf trace session
   (perf record -e cs_etm// -- ls), and a sysfs ETM/STM enable/disable
   cycle. Check that no warnings or oopses appear and that CPU idle
   (PM notifier) save/restore still works while tracing.

[Where problems could occur]

Only the CoreSight subsystem is affected, and only on kernels that enable
it. A mistake in when csdev->path is set or cleared could make the CPU PM
notifier skip or misapply ETM save/restore while a trace session is active
across CPU idle, which would show up as lost or corrupted trace data, or a
NULL dereference in coresight-etm4x during PM transitions. Kernels with
CONFIG_CORESIGHT=n, including generic resolute/linux, are unaffected.

** Affects: linux-nvidia (Ubuntu)
     Importance: Undecided
         Status: Invalid

** Affects: linux-nvidia-bos (Ubuntu)
     Importance: Undecided
         Status: Invalid

** Affects: linux-nvidia (Ubuntu Resolute)
     Importance: Undecided
     Assignee: Jacob Martin (jacobmartin)
         Status: In Progress

** Affects: linux-nvidia-bos (Ubuntu Resolute)
     Importance: Undecided
     Assignee: Jacob Martin (jacobmartin)
         Status: In Progress

** Also affects: linux-nvidia (Ubuntu Resolute)
   Importance: Undecided
       Status: New

** Changed in: linux-nvidia (Ubuntu)
       Status: New => Invalid

** Changed in: linux-nvidia (Ubuntu Resolute)
       Status: New => In Progress

** Changed in: linux-nvidia (Ubuntu Resolute)
     Assignee: (unassigned) => Jacob Martin (jacobmartin)

** Also affects: linux-nvidia-bos (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: linux-nvidia-bos (Ubuntu)
       Status: New => Invalid

** Changed in: linux-nvidia-bos (Ubuntu Resolute)
       Status: New => In Progress

** Changed in: linux-nvidia-bos (Ubuntu Resolute)
     Assignee: (unassigned) => Jacob Martin (jacobmartin)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174422

Title:
  coresight etm4x build failure after stable backport of "Set active
  path on target CPU"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-nvidia/+bug/2174422/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to