Hi James,
-----Original Message----- From: James Clark james.clark@arm.com Sent: Friday, September 1, 2023 7:24 PM To: Linu Cherian lcherian@marvell.com Cc: coresight@lists.linaro.org; Anil Kumar Reddy H areddy3@marvell.com; Tanmay Jagdale tanmay@marvell.com; George Cherian gcherian@marvell.com; suzuki.poulose@arm.com; mike.leach@linaro.org; mathieu.poirier@linaro.org Subject: [EXT] Re: [RFC PATCH v2 0/7]Extending Coresight for Kernel panic and watchdog reset
External Email
On 13/07/2023 14:47, Linu Cherian wrote:
Changelog from v1:
- V2 is a complete patchset with kernel panic trace tested on Linux 6.4. Details on testing with relevant console logs has been added for
reference.
- Two additional patches(patch 6 & 7) has been included to manage
stopping of trace
at the time of kernel panic.
- Few bug fixes.
TODO:
- Add support to prevent overwriting of trace data captured in previous boot. (Suggested by James)
- DTS properties for reserved memory might need some refinements, since Linux arm64 kernel has limitation on the number of reserved regions it supports(ie. 64).
I assume you already thought about this given the note, but you could have a single region for both metadata and trace, as presumably the metadata is a known fixed size so it can be placed at the beginning or end.
Yeah. Didn’t take that option so as to avoid dependency between the two regions(trace buffer and metadata). By the way, this got resolved by rearranging the reserved regions in DT. Please see below.
But from a quick look at the other device tree files I don't see anything close to 64 regions being used anywhere. It doesn't seem like it would be an issue as this feature may not be widely used either.
Initially was using a DT arrangement like this, Note: Please ignore the values of reg property.
DT arrangement that creates multiple reserved regions in Linux: ------------------------------------------------------------------------------------- reserved-memory { #address-cells = <2>; #size-cells = <2>;
tmc_etr_trace: tmc_etr_trace@0 { reg = <0 0 0 0>; no-map; };
tmc_etr_metadata: tmc_etr_metadata@0 { reg = <0 0 0 0>; no-map; };
etf0_trace: etf0_trace@0 { reg = <0 0 0 0>; no-map; };
etf0_metadata: etf0_metadata@0 { reg = <0 0 0 0>; no-map; }; };
Now all the above nodes are rearranged under a common parent, so that Linux sees that a single reserved region.
DT arrangement that creates a single reserved region for Coresight: ------------------------------------------------------------------------------------------ reserved-memory { #address-cells = <2>; #size-cells = <2>;
coresight_preserv: coresight_preserv@0 { reg = <0 0 0 0>; no-map;
ranges = < 0 0 0 0 0 0>;
tmc_etr_trace: tmc_etr_trace@0 { reg = <0 0 0 0>; no-map; };
tmc_etr_metadata: tmc_etr_metadata@0 { reg = <0 0 0 0>; no-map; };
etf0_trace: etf0_trace@0 { reg = <0 0 0 0>; no-map; };
etf0_metadata: etf0_metadata@0 { reg = <0 0 0 0>; no-map; }; }; };