Skip to contentSkip to conversation

coresight: Use new autogenerated sysreg definitions

PATCH In review James Clark 3 participants 9 messages Sep 20, 2022 – Sep 21, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coresight: Use new autogenerated sysreg definitions

Fix the build by updating registers to use the new autogenerated format.

Fixes c0357a73fa4a ("arm64/sysreg: Align field names in ID_AA64DFR0_EL1 with architecture")
---
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 4 ++--
 drivers/hwtracing/coresight/coresight-trbe.h       | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/hwtracing/coresight/coresight-etm4x-core.c +2 -2
index d39660a3e50c..80fefaba58ee 100644
@@ -966,7 +966,7 @@ static inline bool cpu_supports_sysreg_trace(void)
 {
 	u64 dfr0 = read_sysreg_s(SYS_ID_AA64DFR0_EL1);
 
-	return ((dfr0 >> ID_AA64DFR0_TRACEVER_SHIFT) & 0xfUL) > 0;
+	return ((dfr0 >> ID_AA64DFR0_EL1_TraceVer_SHIFT) & 0xfUL) > 0;
 }
 
 static bool etm4_init_sysreg_access(struct etmv4_drvdata *drvdata,
@@ -1054,7 +1054,7 @@ static void cpu_detect_trace_filtering(struct etmv4_drvdata *drvdata)
 	u64 trfcr;
 
 	drvdata->trfcr = 0;
-	if (!cpuid_feature_extract_unsigned_field(dfr0, ID_AA64DFR0_TRACE_FILT_SHIFT))
+	if (!cpuid_feature_extract_unsigned_field(dfr0, ID_AA64DFR0_EL1_TraceFilt_SHIFT))
 		return;
 
 	/*
drivers/hwtracing/coresight/coresight-trbe.h +2 -1
index 30e4d7db4f8e..98ff1b17ad07 100644
@@ -20,7 +20,8 @@
 static inline bool is_trbe_available(void)
 {
 	u64 aa64dfr0 = read_sysreg_s(SYS_ID_AA64DFR0_EL1);
-	unsigned int trbe = cpuid_feature_extract_unsigned_field(aa64dfr0, ID_AA64DFR0_TRBE_SHIFT);
+	unsigned int trbe = cpuid_feature_extract_unsigned_field(aa64dfr0,
+								 ID_AA64DFR0_EL1_TraceBuffer_SHIFT);
 
 	return trbe >= 0b0001;
 }
Signature · 1 line
2.28.0
#1 lore raw
Quoted 4 lines · James Clark

Fix the build by updating registers to use the new autogenerated format.

Fixes c0357a73fa4a ("arm64/sysreg: Align field names in ID_AA64DFR0_EL1 with architecture")

In general it's better to add the build error in the commit log. I'll add one as I can reproduce it.

Since it's broken by the arm64 tree, I plan to add it to the same branch (for-next/sysreg).

BTW, for some reason we don't have CoreSight enabled in defconfig, not even as a module. Would you mind sending a patch for this and enable (as modules) all the relevant drivers? We miss any test coverage here.

Thanks.

Signature · 1 line
Catalin
#2 lore raw
Quoted 3 lines · Catalin Marinas

BTW, for some reason we don't have CoreSight enabled in defconfig, not even as a module. Would you mind sending a patch for this and enable (as modules) all the relevant drivers? We miss any test coverage here.

The PMU counters are in the same camp. Enabling them breaks the kernel build. I wonder whether we should go for changing the default in Kconfig directly rather than defconfig.

Signature · 1 line
Catalin
#3 lore raw
Quoted 8 lines · Catalin Marinas
Quoted 3 lines · Catalin Marinas

BTW, for some reason we don't have CoreSight enabled in defconfig, not even as a module. Would you mind sending a patch for this and enable (as modules) all the relevant drivers? We miss any test coverage here.

The PMU counters are in the same camp. Enabling them breaks the kernel build. I wonder whether we should go for changing the default in Kconfig directly rather than defconfig.

I sent a patch for the PMU counters defconfig yesterday.

#4 lore raw
Quoted 11 lines · Mark Brown
Quoted 8 lines · Catalin Marinas
Quoted 3 lines · Catalin Marinas

BTW, for some reason we don't have CoreSight enabled in defconfig, not even as a module. Would you mind sending a patch for this and enable (as modules) all the relevant drivers? We miss any test coverage here.

The PMU counters are in the same camp. Enabling them breaks the kernel build. I wonder whether we should go for changing the default in Kconfig directly rather than defconfig.

I sent a patch for the PMU counters defconfig yesterday.

The defconfig patches tend to fall through the cracks. I'll try to pick some of them up.

BTW, do you plan to send a patch for the arm_spe_pmu build failures (unless you did already and I missed it):

linux/drivers/perf/arm_spe_pmu.c: In function 'arm_spe_pmsevfr_res0':
linux/drivers/perf/arm_spe_pmu.c:677:14: error: 'ID_AA64DFR0_PMSVER_8_2' undeclared (first use in this function); did you mean 'ID_AA64DFR0_EL1_PMSVer_IMP'?

  677 |         case ID_AA64DFR0_PMSVER_8_2:
      |              ^~~~~~~~~~~~~~~~~~~~~~
      |              ID_AA64DFR0_EL1_PMSVer_IMP
linux/drivers/perf/arm_spe_pmu.c:677:14: note: each undeclared identifier is reported only once for each function it appears in
linux/drivers/perf/arm_spe_pmu.c:679:14: error: 'ID_AA64DFR0_PMSVER_8_3' undeclared (first use in this function); did you mean 'ID_AA64DFR0_EL1_PMSVer_IMP'?
  679 |         case ID_AA64DFR0_PMSVER_8_3:
      |              ^~~~~~~~~~~~~~~~~~~~~~
      |              ID_AA64DFR0_EL1_PMSVer_IMP
linux/drivers/perf/arm_spe_pmu.c: In function '__arm_spe_pmu_dev_probe':
linux/drivers/perf/arm_spe_pmu.c:961:52: error: 'ID_AA64DFR0_PMSVER_SHIFT' undeclared (first use in this function); did you mean 'ID_AA64DFR0_EL1_PMSVer_SHIFT'?
  961 |                                                    ID_AA64DFR0_PMSVER_SHIFT);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    ID_AA64DFR0_EL1_PMSVer_SHIFT
Signature · 1 line
Catalin
#5 lore raw
Quoted 2 lines · Catalin Marinas

BTW, do you plan to send a patch for the arm_spe_pmu build failures (unless you did already and I missed it):

Nathan sent a patch for that yesterday, I was a bit surprised you didn't pick it up yet TBH.

#6 lore raw
Quoted 7 lines · Mark Brown
Quoted 2 lines · Catalin Marinas

BTW, do you plan to send a patch for the arm_spe_pmu build failures (unless you did already and I missed it):

Nathan sent a patch for that yesterday, I was a bit surprised you didn't pick it up yet TBH.

That's [email protected] ("arm64/sysreg:
Fix a few missed conversions).

#7 lore raw
Quoted 11 lines · Mark Brown
Quoted 7 lines · Mark Brown
Quoted 2 lines · Catalin Marinas

BTW, do you plan to send a patch for the arm_spe_pmu build failures (unless you did already and I missed it):

Nathan sent a patch for that yesterday, I was a bit surprised you didn't pick it up yet TBH.

That's [email protected] ("arm64/sysreg:
Fix a few missed conversions).

Ah, yes. I flagged it up in my inbox but forgot about it. Thanks for the reminder. I'll queue it shortly.

Signature · 1 line
Catalin
#8 lore raw
In reply to James Clark
Quoted 1 line · James Clark

Fix the build by updating registers to use the new autogenerated format.

Nathan Chancellor already sent a patch for this and the PMU yesterday.