On Fri, 2 Jun 2023 16:41:46 +0800, Hao Zhang wrote:
> Introduction of Coresight Dummy subunit
> The Coresight Dummy subunit is for Coresight Dummy component, there are
> some specific Coresight devices that HLOS don't have permission to access.
> Such as some TPDMs, they would be configured in NON-HLOS side, but it's
> necessary to build Coresight path for it to debug. So there need driver to
> register dummy devices as Coresight devices.
>
> [...]
Applied, thanks!
[1/3] Coresight: Add coresight dummy driver
commit: 9d3ba0b6c056918355cf36094d6ed63cdd01a2ab
[2/3] dt-bindings: arm: Add support for Coresight dummy trace
commit: 5911ff4559e45532c1f67257c5731b5e13f5e7a3
[3/3] Documentation: trace: Add documentation for Coresight Dummy Trace
commit: 3b79104f80036231a40ba5d15c3e329985029a0f
Best regards,
--
Suzuki K Poulose <suzuki.poulose(a)arm.com>
This series converts TRBE registers to automatic generation, after renaming
their fields as per the auto-gen tools format. Although the following field
still renames in arch/arm64/include/asm/sysreg.h, as it cannot be converted
(shares bits with other fields) in the tools format.
#define TRBSR_EL1_BSC_MASK GENMASK(5, 0)
#define TRBSR_EL1_BSC_SHIFT 0
This series applies on v6.4-rc6.
Changes in V3:
- Defined enum for both PAS and SH fields in TRBMAR_EL1
- Defined enum for EA field in TRBIDR_EL1
Changes in V2:
https://lore.kernel.org/all/20230602062552.565992-1-anshuman.khandual@arm.c…
- Renamed each individual TRBE register fields as per auto-gen tools
- Converted each individual TRBE registers as per auto-gen tools
- Added new register fields as per DDI0601 2023-03
Changes in V1:
https://lore.kernel.org/all/20230531055524.16562-1-anshuman.khandual@arm.co…
Cc: Catalin Marinas <catalin.marinas(a)arm.com>
Cc: Will Deacon <will(a)kernel.org>
Cc: Marc Zyngier <maz(a)kernel.org>
Cc: Mark Brown <broonie(a)kernel.org>
Cc: Rob Herring <robh(a)kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose(a)arm.com>
Cc: James Morse <james.morse(a)arm.com>
Cc: kvmarm(a)lists.linux.dev
Cc: coresight(a)lists.linaro.org
Cc: linux-arm-kernel(a)lists.infradead.org
Cc: linux-kernel(a)vger.kernel.org
Anshuman Khandual (14):
arm64/sysreg: Rename TRBLIMITR_EL1 fields per auto-gen tools format
arm64/sysreg: Rename TRBPTR_EL1 fields per auto-gen tools format
arm64/sysreg: Rename TRBBASER_EL1 fields per auto-gen tools format
arm64/sysreg: Rename TRBSR_EL1 fields per auto-gen tools format
arm64/sysreg: Rename TRBMAR_EL1 fields per auto-gen tools format
arm64/sysreg: Rename TRBTRG_EL1 fields per auto-gen tools format
arm64/sysreg: Rename TRBIDR_EL1 fields per auto-gen tools format
arm64/sysreg: Convert TRBLIMITR_EL1 register to automatic generation
arm64/sysreg: Convert TRBPTR_EL1 register to automatic generation
arm64/sysreg: Convert TRBBASER_EL1 register to automatic generation
arm64/sysreg: Convert TRBSR_EL1 register to automatic generation
arm64/sysreg: Convert TRBMAR_EL1 register to automatic generation
arm64/sysreg: Convert TRBTRG_EL1 register to automatic generation
arm64/sysreg: Convert TRBIDR_EL1 register to automatic generation
arch/arm64/include/asm/el2_setup.h | 2 +-
arch/arm64/include/asm/sysreg.h | 50 +------------
arch/arm64/kvm/debug.c | 2 +-
arch/arm64/kvm/hyp/nvhe/debug-sr.c | 2 +-
arch/arm64/tools/sysreg | 77 ++++++++++++++++++++
drivers/hwtracing/coresight/coresight-trbe.c | 33 +++++----
drivers/hwtracing/coresight/coresight-trbe.h | 38 ++++------
7 files changed, 114 insertions(+), 90 deletions(-)
--
2.25.1
Changes since v2:
* Rename prev_thread -> prev_packet_thread and prev_el ->
prev_packet_el
* Add a comment about tracking the previous packet's thread
Changes since v1:
* Always assume host kernel when the trace was captured at EL1 (nVHE)
* Fix EL validation to work with ETMv3
* Add a commit to make PID format accessible from struct
cs_etm_auxtrace
======
Some fixes to support an issue reported by Denis Nikitin where decoding
trace that contains different EL1 and EL2 kernels can crash or go into
an infinite loop because the wrong kernel maps are used for the decode.
This still doesn't support distinguishing guest and host userspace,
we'd still have to fix the timestamps and do a bit more work to
correlate that. And I've removed PERF_RECORD_MISC_HYPERVISOR as a
possible outcome of cs_etm__cpu_mode(). As far as I know this could
never have been returned anyway because machine__is_host(machine) was
always true due to session.machines.host being hard coded. And I'm not
sure of the relevance of the difference between PERF_RECORD_MISC_KERNEL
and PERF_RECORD_MISC_HYPERVISOR in this scenario.
The first commit is a tidy up, second fixes a bug that I found when
comparing the exception level and thread of branch records, the third
is the main fix, and the last commit is some extra error checking.
Applies to acme/perf-tools-next (42713dafc)
James Clark (5):
perf cs-etm: Only track threads instead of PID and TIDs
perf cs-etm: Use previous thread for branch sample source IP
perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
perf cs-etm: Track exception level
perf cs-etm: Add exception level consistency check
.../perf/util/cs-etm-decoder/cs-etm-decoder.c | 33 +-
.../perf/util/cs-etm-decoder/cs-etm-decoder.h | 4 +-
tools/perf/util/cs-etm.c | 282 ++++++++++--------
tools/perf/util/cs-etm.h | 13 +-
4 files changed, 184 insertions(+), 148 deletions(-)
--
2.34.1
On 6/8/23 23:09, Catalin Marinas wrote:
> Hi Anshuman,
>
> On Fri, Jun 02, 2023 at 11:55:38AM +0530, Anshuman Khandual wrote:
>> Changes in V2:
>>
>> - Renamed each individual TRBE register fields as per auto-gen tools
>> - Converted each individual TRBE registers as per auto-gen tools
>> - Added new register fields as per DDI0601 2023-03
>
> Mark had some comments about using Enum for some bitfields. While not
> essential, it would be nice to have those fixed. It's probably easier to
> do an incremental patch fixing those, so please post one (or repost the
> whole series, whatever is easier for you).
Sure, will fold in those suggested changes and re-post the series soon.
On 6/2/23 17:42, Mark Brown wrote:
> On Fri, Jun 02, 2023 at 11:55:52AM +0530, Anshuman Khandual wrote:
>> This converts TRBIDR_EL1 register to automatic generation without
>> causing any functional change.
>
>> +Sysreg TRBIDR_EL1 3 0 9 11 7
>> +Res0 63:12
>> +Field 11:8 EA
>
> EA is another field which looks like it should be an enum, as with the
> others this shouldn't be a blocker and could be done incrementally.
Will fold the following changes in this patch.
--- a/arch/arm64/tools/sysreg
+++ b/arch/arm64/tools/sysreg
@@ -2267,7 +2267,11 @@ EndSysreg
Sysreg TRBIDR_EL1 3 0 9 11 7
Res0 63:12
-Field 11:8 EA
+Enum 11:8 EA
+ 0b0000 NON_DESC
+ 0b0001 IGNORE
+ 0b0010 SERROR
+EndEnum
Res0 7:6
Field 5 F
Field 4 P
>
>> +Res0 7:6
>> +Field 5 F
>> +Field 4 P
>> +Field 3:0 Align
>
> Align arguably too though really it's just encoding the relevant power
> of 2 with the enum coming from the fact that it's limited to at most 2KB
> alignment so a Field may well make more sense.
Can fold the following changes in this patch (if required) unless the Field
looks better than Enum.
--- a/arch/arm64/tools/sysreg
+++ b/arch/arm64/tools/sysreg
@@ -2275,5 +2275,18 @@ EndEnum
Res0 7:6
Field 5 F
Field 4 P
-Field 3:0 Align
+Enum 3:0 Align
+ 0b0000 BYTE
+ 0b0001 HALF_WORD
+ 0b0010 WORD
+ 0b0011 DOUBLE_WORD
+ 0b0100 16_BYTES
+ 0b0101 32_BYTES
+ 0b0110 64_BYTES
+ 0b0111 128_BYTES
+ 0b1000 156_BYTES
+ 0b1001 512_BYTES
+ 0b1010 1_KB
+ 0b1011 2_KB
+EndEnum
EndSysreg
>
> Reviewed-by: Mark Brown <broonie(a)kernel.org>
On 6/2/23 17:35, Mark Brown wrote:
> On Fri, Jun 02, 2023 at 11:55:50AM +0530, Anshuman Khandual wrote:
>
>> +Sysreg TRBMAR_EL1 3 0 9 11 4
>> +Res0 63:12
>> +Field 11:10 PAS
>> +Field 9:8 SH
>> +Field 7:0 Attr
>> +EndSysreg
>
> PAS and SH look like they should be enums, Attr is a bit more complex so
> Field is probably a good fit there. Adding the enum information could
> be done incrementally though so:
Will fold the following changes in this patch.
--- a/arch/arm64/tools/sysreg
+++ b/arch/arm64/tools/sysreg
@@ -2246,8 +2246,17 @@ EndSysreg
Sysreg TRBMAR_EL1 3 0 9 11 4
Res0 63:12
-Field 11:10 PAS
-Field 9:8 SH
+Enum 11:10 PAS
+ 0b00 SECURE
+ 0b01 NON_SECURE
+ 0b10 ROOT
+ 0b11 REALM
+EndEnum
+Enum 9:8 SH
+ 0b00 NON_SHAREABLE
+ 0b10 OUTER_SHAREABLE
+ 0b11 INNER_SHAREABLE
+EndEnum
Field 7:0 Attr
EndSysreg
>
> Reviewed-by: Mark Brown <broonie(a)kernel.org>
James has made significant contributions to the CoreSight subsystem
both with code and reviews. Add James to the Reviewer for the subsystem.
Cc: James Clark <james.clark(a)arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 250518fc70ff..c01a70ed2a36 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2097,6 +2097,7 @@ N: digicolor
ARM/CORESIGHT FRAMEWORK AND DRIVERS
M: Suzuki K Poulose <suzuki.poulose(a)arm.com>
R: Mike Leach <mike.leach(a)linaro.org>
+R: James Clark <james.clark(a)arm.com>
R: Leo Yan <leo.yan(a)linaro.org>
L: coresight(a)lists.linaro.org (moderated for non-subscribers)
L: linux-arm-kernel(a)lists.infradead.org (moderated for non-subscribers)
--
2.34.1
Changes since v1:
* Always assume host kernel when the trace was captured at EL1 (nVHE)
* Fix EL validation to work with ETMv3
* Add a commit to make PID format accessible from struct
cs_etm_auxtrace
======
Some fixes to support an issue reported by Denis Nikitin where decoding
trace that contains different EL1 and EL2 kernels can crash or go into
an infinite loop because the wrong kernel maps are used for the decode.
This still doesn't support distinguishing guest and host userspace,
we'd still have to fix the timestamps and do a bit more work to
correlate that. And I've removed PERF_RECORD_MISC_HYPERVISOR as a
possible outcome of cs_etm__cpu_mode(). As far as I know this could
never have been returned anyway because machine__is_host(machine) was
always true due to session.machines.host being hard coded. And I'm not
sure of the relevance of the difference between PERF_RECORD_MISC_KERNEL
and PERF_RECORD_MISC_HYPERVISOR in this scenario.
The first commit is a tidy up, second fixes a bug that I found when
comparing the exception level and thread of branch records, the third
is the main fix, and the last commit is some extra error checking.
Applies to acme/perf-tools (48b1320a67)
James Clark (5):
perf cs-etm: Only track threads instead of PID and TIDs
perf cs-etm: Use previous thread for branch sample source IP
perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
perf cs-etm: Track exception level
perf cs-etm: Add exception level consistency check
.../perf/util/cs-etm-decoder/cs-etm-decoder.c | 33 +--
.../perf/util/cs-etm-decoder/cs-etm-decoder.h | 4 +-
tools/perf/util/cs-etm.c | 273 ++++++++++--------
tools/perf/util/cs-etm.h | 13 +-
4 files changed, 175 insertions(+), 148 deletions(-)
--
2.34.1
Some fixes to support an issue reported by Denis Nikitin where decoding
trace that contains different EL1 and EL2 kernels can crash or go into
an infinite loop because the wrong kernel maps are used for the decode.
This still doesn't support distinguishing guest and host userspace,
we'd still have to fix the timestamps and do a bit more work to
correlate that. And I've removed PERF_RECORD_MISC_HYPERVISOR as a
possible outcome of cs_etm__cpu_mode(). As far as I know this could
never have been returned anyway because machine__is_host(machine) was
always true due to session.machines.host being hard coded. And I'm not
sure of the relevance of the difference between PERF_RECORD_MISC_KERNEL
and PERF_RECORD_MISC_HYPERVISOR in this scenario.
The first commit is a tidy up, second fixes a bug that I found when
comparing the exception level and thread of branch records, the third
is the main fix, and the last commit is some extra error checking.
Applies to acme/perf-tools (4e111f0cf0)
James Clark (4):
perf cs-etm: Only track threads instead of PID and TIDs
perf cs-etm: Use previous thread for branch sample source IP
perf cs-etm: Track exception level
perf cs-etm: Add exception level consistency check
.../perf/util/cs-etm-decoder/cs-etm-decoder.c | 13 +-
.../perf/util/cs-etm-decoder/cs-etm-decoder.h | 4 +-
tools/perf/util/cs-etm.c | 220 +++++++++---------
tools/perf/util/cs-etm.h | 5 +-
4 files changed, 126 insertions(+), 116 deletions(-)
--
2.34.1