<feed xmlns='http://www.w3.org/2005/Atom'>
<title>starfive-tech/linux.git/drivers/hwtracing, branch visionfive</title>
<subtitle>StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)</subtitle>
<id>https://git.radix-linux.su/starfive-tech/linux.git/atom?h=visionfive</id>
<link rel='self' href='https://git.radix-linux.su/starfive-tech/linux.git/atom?h=visionfive'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/'/>
<updated>2025-07-10T05:42:19+00:00</updated>
<entry>
<title>mm: remove callers of pfn_t functionality</title>
<updated>2025-07-10T05:42:19+00:00</updated>
<author>
<name>Alistair Popple</name>
<email>apopple@nvidia.com</email>
</author>
<published>2025-06-19T08:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=21aa65bf82a78c1e70447a45a85e533689b7f1a7'/>
<id>urn:sha1:21aa65bf82a78c1e70447a45a85e533689b7f1a7</id>
<content type='text'>
All PFN_* pfn_t flags have been removed.  Therefore there is no longer a
need for the pfn_t type and all uses can be replaced with normal pfns.

Link: https://lkml.kernel.org/r/bbedfa576c9822f8032494efbe43544628698b1f.1750323463.git-series.apopple@nvidia.com
Signed-off-by: Alistair Popple &lt;apopple@nvidia.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
Cc: Balbir Singh &lt;balbirs@nvidia.com&gt;
Cc: Björn Töpel &lt;bjorn@kernel.org&gt;
Cc: Björn Töpel &lt;bjorn@rivosinc.com&gt;
Cc: Chunyan Zhang &lt;zhang.lyra@gmail.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Cc: Gerald Schaefer &lt;gerald.schaefer@linux.ibm.com&gt;
Cc: Inki Dae &lt;m.szyprowski@samsung.com&gt;
Cc: John Groves &lt;john@groves.net&gt;
Cc: John Hubbard &lt;jhubbard@nvidia.com&gt;
Cc: Lorenzo Stoakes &lt;lorenzo.stoakes@oracle.com&gt;
Cc: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'coresight-next-v6.16' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next</title>
<updated>2025-05-22T16:04:43+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2025-05-22T16:04:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=bdc319f1c9bf9d8c41467ab7e2ecb1a73f86a6fd'/>
<id>urn:sha1:bdc319f1c9bf9d8c41467ab7e2ecb1a73f86a6fd</id>
<content type='text'>
Suzuki writes:

coresight: updates for Linux v6.16

CoreSight self-hosted trace driver subsystem updates for Linux v6.16 includes:
 - Clear CLAIM tags on device probe if self-hosted tags are set.
 - Support for perf AUX pause/resume for CoreSight ETM PMU driver, with trace
   collection at pause.
 - Miscellaneous fixes for the subsystem

Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;

* tag 'coresight-next-v6.16' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/coresight/linux: (27 commits)
  coresight: prevent deactivate active config while enabling the config
  coresight: holding cscfg_csdev_lock while removing cscfg from csdev
  coresight/etm4: fix missing disable active config
  coresight: etm4x: Fix timestamp bit field handling
  coresight: tmc: fix failure to disable/enable ETF after reading
  Documentation: coresight: Document AUX pause and resume
  coresight: perf: Update buffer on AUX pause
  coresight: tmc: Re-enable sink after buffer update
  coresight: perf: Support AUX trace pause and resume
  coresight: etm4x: Hook pause and resume callbacks
  coresight: Introduce pause and resume APIs for source
  coresight: etm4x: Extract the trace unit controlling
  coresight: cti: Replace inclusion by struct fwnode_handle forward declaration
  coresight: Disable MMIO logging for coresight stm driver
  coresight: replicator: Fix panic for clearing claim tag
  coresight: Add a KUnit test for coresight_find_default_sink()
  coresight: Remove extern from function declarations
  coresight: Remove inlines from static function definitions
  coresight: Clear self hosted claim tag on probe
  coresight: etm3x: Convert raw base pointer to struct coresight access
  ...
</content>
</entry>
<entry>
<title>coresight: prevent deactivate active config while enabling the config</title>
<updated>2025-05-20T15:38:54+00:00</updated>
<author>
<name>Yeoreum Yun</name>
<email>yeoreum.yun@arm.com</email>
</author>
<published>2025-05-14T16:19:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=408c97c4a5e0b634dcd15bf8b8808b382e888164'/>
<id>urn:sha1:408c97c4a5e0b634dcd15bf8b8808b382e888164</id>
<content type='text'>
While enable active config via cscfg_csdev_enable_active_config(),
active config could be deactivated via configfs' sysfs interface.
This could make UAF issue in below scenario:

CPU0                                          CPU1
(sysfs enable)                                load module
                                              cscfg_load_config_sets()
                                              activate config. // sysfs
                                              (sys_active_cnt == 1)
...
cscfg_csdev_enable_active_config()
lock(csdev-&gt;cscfg_csdev_lock)
// here load config activate by CPU1
unlock(csdev-&gt;cscfg_csdev_lock)

                                              deactivate config // sysfs
                                              (sys_activec_cnt == 0)
                                              cscfg_unload_config_sets()
                                              unload module

// access to config_desc which freed
// while unloading module.
cscfg_csdev_enable_config

To address this, use cscfg_config_desc's active_cnt as a reference count
 which will be holded when
    - activate the config.
    - enable the activated config.
and put the module reference when config_active_cnt == 0.

Fixes: f8cce2ff3c04 ("coresight: syscfg: Add API to activate and enable configurations")
Suggested-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Signed-off-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250514161951.3427590-4-yeoreum.yun@arm.com
</content>
</entry>
<entry>
<title>coresight: holding cscfg_csdev_lock while removing cscfg from csdev</title>
<updated>2025-05-20T15:38:48+00:00</updated>
<author>
<name>Yeoreum Yun</name>
<email>yeoreum.yun@arm.com</email>
</author>
<published>2025-05-14T16:19:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=53b9e2659719b04f5ba7593f2af0f2335f75e94a'/>
<id>urn:sha1:53b9e2659719b04f5ba7593f2af0f2335f75e94a</id>
<content type='text'>
There'll be possible race scenario for coresight config:

CPU0                                          CPU1
(perf enable)                                 load module
                                              cscfg_load_config_sets()
                                              activate config. // sysfs
                                              (sys_active_cnt == 1)
...
cscfg_csdev_enable_active_config()
  lock(csdev-&gt;cscfg_csdev_lock)
                                              deactivate config // sysfs
                                              (sys_activec_cnt == 0)
                                              cscfg_unload_config_sets()
  &lt;iterating config_csdev_list&gt;               cscfg_remove_owned_csdev_configs()
  // here load config activate by CPU1
  unlock(csdev-&gt;cscfg_csdev_lock)

iterating config_csdev_list could be raced with config_csdev_list's
entry delete.

To resolve this race , hold csdev-&gt;cscfg_csdev_lock() while
cscfg_remove_owned_csdev_configs()

Fixes: 02bd588e12df ("coresight: configuration: Update API to permit dynamic load/unload")
Signed-off-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250514161951.3427590-3-yeoreum.yun@arm.com
</content>
</entry>
<entry>
<title>coresight/etm4: fix missing disable active config</title>
<updated>2025-05-20T15:38:47+00:00</updated>
<author>
<name>Yeoreum Yun</name>
<email>yeoreum.yun@arm.com</email>
</author>
<published>2025-05-14T16:19:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=895b12b7d7b8c651f73f57a1ea040d35aa7048cb'/>
<id>urn:sha1:895b12b7d7b8c651f73f57a1ea040d35aa7048cb</id>
<content type='text'>
When etm4 device is disabled via sysfs, it should disable its active
count.

Fixes: 7ebd0ec6cf94 ("coresight: configfs: Allow configfs to activate configuration")
Signed-off-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250514161951.3427590-2-yeoreum.yun@arm.com
</content>
</entry>
<entry>
<title>coresight: etm4x: Fix timestamp bit field handling</title>
<updated>2025-05-20T15:16:15+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-05-19T17:49:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=ee811bc733be5c57a2bfecdf2f6f5d4db466200a'/>
<id>urn:sha1:ee811bc733be5c57a2bfecdf2f6f5d4db466200a</id>
<content type='text'>
Timestamps in the trace data appear as all zeros on recent kernels,
although the feature works correctly on old kernels (e.g., v6.12).

Since commit c382ee674c8b ("arm64/sysreg/tools: Move TRFCR definitions
to sysreg"), the TRFCR_ELx_TS_{VIRTUAL|GUEST_PHYSICAL|PHYSICAL} macros
were updated to remove the bit shift. As a result, the driver no longer
shifts bits when operates the timestamp field.

Fix this by using the FIELD_PREP() and FIELD_GET() helpers.

Reported-by: Tamas Zsoldos &lt;tamas.zsoldos@arm.com&gt;
Fixes: c382ee674c8b ("arm64/sysreg/tools: Move TRFCR definitions to sysreg")
Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250519174945.2245271-2-leo.yan@arm.com
</content>
</entry>
<entry>
<title>coresight: tmc: fix failure to disable/enable ETF after reading</title>
<updated>2025-05-14T10:56:17+00:00</updated>
<author>
<name>Mao Jinlong</name>
<email>quic_jinlmao@quicinc.com</email>
</author>
<published>2025-05-07T06:37:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=d23bc38e8aa4efbd617bf660bb1a25fee9f6c177'/>
<id>urn:sha1:d23bc38e8aa4efbd617bf660bb1a25fee9f6c177</id>
<content type='text'>
ETF may fail to re-enable after reading, and driver-&gt;reading will
not be set to false, this will cause failure to enable/disable to ETF.
This change set driver-&gt;reading to false even if re-enabling fail.

Fixes: 669c4614236a ("coresight: tmc: Don't enable TMC when it's not ready.")
Co-developed-by: Yuanfang Zhang &lt;quic_yuanfang@quicinc.com&gt;
Signed-off-by: Yuanfang Zhang &lt;quic_yuanfang@quicinc.com&gt;
Signed-off-by: Mao Jinlong &lt;quic_jinlmao@quicinc.com&gt;
[ Added a comment to explain why we ignore the error ]
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250507063716.1945213-1-quic_jinlmao@quicinc.com
</content>
</entry>
<entry>
<title>coresight: perf: Update buffer on AUX pause</title>
<updated>2025-05-14T10:56:17+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-04-01T18:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=973f47a9886ac45525985790dffbf5ddeb5097a9'/>
<id>urn:sha1:973f47a9886ac45525985790dffbf5ddeb5097a9</id>
<content type='text'>
Due to sinks like ETR and ETB don't support interrupt handling, the
hardware trace data might be lost for continuous running tasks.

This commit takes advantage of the AUX pause for updating trace buffer
to mitigate the trace data losing issue.

The per CPU sink has its own interrupt handling.  Thus, there will be a
race condition between the updating buffer in NMI and sink's interrupt
handler.  To avoid the race condition, this commit disallows updating
buffer on AUX pause for the per CPU sink.  Currently, this is only
applied for TRBE.

Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250401180708.385396-7-leo.yan@arm.com
</content>
</entry>
<entry>
<title>coresight: tmc: Re-enable sink after buffer update</title>
<updated>2025-05-14T10:56:17+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-04-01T18:07:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=d5f7e4bea90f2e0630b0c76b0f6cf64304c5b514'/>
<id>urn:sha1:d5f7e4bea90f2e0630b0c76b0f6cf64304c5b514</id>
<content type='text'>
The buffer update callbacks disable the sink before syncing data but
misses to re-enable it afterward.  This is fine in the general flow,
because the sink will be re-enabled the next time the PMU event is
activated.

However, during AUX pause and resume, if the sink is disabled in the
buffer update callback, there is no chance to re-enable it when AUX
resumes.

To address this, the callbacks now check the event state
'event-&gt;hw.state'.  If the event is an active state (0), the sink is
re-enabled.

For the TMC ETR driver, buffer updates are not fully protected by
the driver's spinlock.  In this case, the sink is not re-enabled if its
reference counter is 0, in order to avoid race conditions where the sink
may have been completely disabled.

Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250401180708.385396-6-leo.yan@arm.com
</content>
</entry>
<entry>
<title>coresight: perf: Support AUX trace pause and resume</title>
<updated>2025-05-14T10:56:17+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-04-01T18:07:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=abffe22e93d7a25b69a8884fda6a50ed81d7ae06'/>
<id>urn:sha1:abffe22e93d7a25b69a8884fda6a50ed81d7ae06</id>
<content type='text'>
This commit supports AUX trace pause and resume in a perf session for
Arm CoreSight.

First, we need to decide which flag can indicate the CoreSight PMU event
has started.  The 'event-&gt;hw.state' cannot be used for this purpose
because its initial value and the value after hardware trace enabling
are both 0.

On the other hand, the context value 'ctxt-&gt;event_data' stores the ETM
private info.  This pointer is valid only when the PMU event has been
enabled. It is safe to permit AUX trace pause and resume operations only
when it is not a NULL pointer.

To achieve fine-grained control of the pause and resume, only the tracer
is disabled and enabled.  This avoids the unnecessary complexity and
latency caused by manipulating the entire link path.

Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250401180708.385396-5-leo.yan@arm.com
</content>
</entry>
</feed>
