Skip to content

Commit 01009b0

Browse files
author
Marc Zyngier
committed
arm64/sysreg: Get rid of TRFCR_ELx SysregFields
There is no such thing as TRFCR_ELx in the architecture. What we have is TRFCR_EL1, for which TRFCR_EL12 is an accessor. Rename TRFCR_ELx_* to TRFCR_EL1_*, and fix the bit of code using these names. Similarly, TRFCR_EL12 is redefined as a mapping to TRFCR_EL1. Reviewed-by: James Clark <james.clark@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/87cygsqgkh.wl-maz@kernel.org Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Mark Brown <broonie@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: Catalin Marinas <catalin.marinas@arm.com>
1 parent fa5e404 commit 01009b0

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

arch/arm64/tools/sysreg

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,7 +1999,7 @@ Field 17:16 ZEN
19991999
Res0 15:0
20002000
EndSysreg
20012001

2002-
SysregFields TRFCR_ELx
2002+
Sysreg TRFCR_EL1 3 0 1 2 1
20032003
Res0 63:7
20042004
UnsignedEnum 6:5 TS
20052005
0b0001 VIRTUAL
@@ -2011,10 +2011,6 @@ Field 1 ExTRE
20112011
Field 0 E0TRE
20122012
EndSysregFields
20132013

2014-
Sysreg TRFCR_EL1 3 0 1 2 1
2015-
Fields TRFCR_ELx
2016-
EndSysreg
2017-
20182014
Sysreg SMPRI_EL1 3 0 1 2 4
20192015
Res0 63:4
20202016
Field 3:0 PRIORITY
@@ -2991,7 +2987,7 @@ Mapping ZCR_EL1
29912987
EndSysreg
29922988

29932989
Sysreg TRFCR_EL12 3 5 1 2 1
2994-
Fields TRFCR_ELx
2990+
Mapping TRFCR_EL1
29952991
EndSysreg
29962992

29972993
Sysreg SMCR_EL12 3 5 1 2 6

drivers/hwtracing/coresight/coresight-etm4x-core.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static void etm4x_prohibit_trace(struct etmv4_drvdata *drvdata)
275275
if (!drvdata->trfcr)
276276
return;
277277

278-
trfcr = drvdata->trfcr & ~(TRFCR_ELx_ExTRE | TRFCR_ELx_E0TRE);
278+
trfcr = drvdata->trfcr & ~(TRFCR_EL1_ExTRE | TRFCR_EL1_E0TRE);
279279

280280
write_trfcr(trfcr);
281281
kvm_tracing_set_el1_configuration(trfcr);
@@ -286,9 +286,9 @@ static u64 etm4x_get_kern_user_filter(struct etmv4_drvdata *drvdata)
286286
u64 trfcr = drvdata->trfcr;
287287

288288
if (drvdata->config.mode & ETM_MODE_EXCL_KERN)
289-
trfcr &= ~TRFCR_ELx_ExTRE;
289+
trfcr &= ~TRFCR_EL1_ExTRE;
290290
if (drvdata->config.mode & ETM_MODE_EXCL_USER)
291-
trfcr &= ~TRFCR_ELx_E0TRE;
291+
trfcr &= ~TRFCR_EL1_E0TRE;
292292

293293
return trfcr;
294294
}
@@ -312,15 +312,15 @@ static void etm4x_allow_trace(struct etmv4_drvdata *drvdata)
312312
return;
313313

314314
if (drvdata->config.mode & ETM_MODE_EXCL_HOST)
315-
trfcr = drvdata->trfcr & ~(TRFCR_ELx_ExTRE | TRFCR_ELx_E0TRE);
315+
trfcr = drvdata->trfcr & ~(TRFCR_EL1_ExTRE | TRFCR_EL1_E0TRE);
316316
else
317317
trfcr = etm4x_get_kern_user_filter(drvdata);
318318

319319
write_trfcr(trfcr);
320320

321321
/* Set filters for guests and pass to KVM */
322322
if (drvdata->config.mode & ETM_MODE_EXCL_GUEST)
323-
guest_trfcr = drvdata->trfcr & ~(TRFCR_ELx_ExTRE | TRFCR_ELx_E0TRE);
323+
guest_trfcr = drvdata->trfcr & ~(TRFCR_EL1_ExTRE | TRFCR_EL1_E0TRE);
324324
else
325325
guest_trfcr = etm4x_get_kern_user_filter(drvdata);
326326

@@ -1176,9 +1176,9 @@ static void cpu_detect_trace_filtering(struct etmv4_drvdata *drvdata)
11761176
* tracing at the kernel EL and EL0, forcing to use the
11771177
* virtual time as the timestamp.
11781178
*/
1179-
trfcr = (TRFCR_ELx_TS_VIRTUAL |
1180-
TRFCR_ELx_ExTRE |
1181-
TRFCR_ELx_E0TRE);
1179+
trfcr = (TRFCR_EL1_TS_VIRTUAL |
1180+
TRFCR_EL1_ExTRE |
1181+
TRFCR_EL1_E0TRE);
11821182

11831183
/* If we are running at EL2, allow tracing the CONTEXTIDR_EL2. */
11841184
if (is_kernel_in_hyp_mode())

drivers/hwtracing/coresight/coresight-etm4x-sysfs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,11 +2319,11 @@ static ssize_t ts_source_show(struct device *dev,
23192319
goto out;
23202320
}
23212321

2322-
switch (drvdata->trfcr & TRFCR_ELx_TS_MASK) {
2323-
case TRFCR_ELx_TS_VIRTUAL:
2324-
case TRFCR_ELx_TS_GUEST_PHYSICAL:
2325-
case TRFCR_ELx_TS_PHYSICAL:
2326-
val = FIELD_GET(TRFCR_ELx_TS_MASK, drvdata->trfcr);
2322+
switch (drvdata->trfcr & TRFCR_EL1_TS_MASK) {
2323+
case TRFCR_EL1_TS_VIRTUAL:
2324+
case TRFCR_EL1_TS_GUEST_PHYSICAL:
2325+
case TRFCR_EL1_TS_PHYSICAL:
2326+
val = FIELD_GET(TRFCR_EL1_TS_MASK, drvdata->trfcr);
23272327
break;
23282328
default:
23292329
val = -1;

drivers/hwtracing/coresight/coresight-trbe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ static u64 cpu_prohibit_trace(void)
11181118
u64 trfcr = read_trfcr();
11191119

11201120
/* Prohibit tracing at EL0 & the kernel EL */
1121-
write_trfcr(trfcr & ~(TRFCR_ELx_ExTRE | TRFCR_ELx_E0TRE));
1121+
write_trfcr(trfcr & ~(TRFCR_EL1_ExTRE | TRFCR_EL1_E0TRE));
11221122
/* Return the original value of the TRFCR */
11231123
return trfcr;
11241124
}

0 commit comments

Comments
 (0)