Skip to content

Commit 92b1efc

Browse files
Anshuman Khandualctmarinas
authored andcommitted
arm64/sysreg: Rename TRBLIMITR_EL1 fields per auto-gen tools format
This renames TRBLIMITR_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Mark Brown <[email protected]> Cc: Rob Herring <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: James Morse <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Anshuman Khandual <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 175cea6 commit 92b1efc

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

arch/arm64/include/asm/sysreg.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@
238238
#define SYS_TRBTRG_EL1 sys_reg(3, 0, 9, 11, 6)
239239
#define SYS_TRBIDR_EL1 sys_reg(3, 0, 9, 11, 7)
240240

241-
#define TRBLIMITR_LIMIT_MASK GENMASK_ULL(51, 0)
242-
#define TRBLIMITR_LIMIT_SHIFT 12
243-
#define TRBLIMITR_NVM BIT(5)
244-
#define TRBLIMITR_TRIG_MODE_MASK GENMASK(1, 0)
245-
#define TRBLIMITR_TRIG_MODE_SHIFT 3
246-
#define TRBLIMITR_FILL_MODE_MASK GENMASK(1, 0)
247-
#define TRBLIMITR_FILL_MODE_SHIFT 1
248-
#define TRBLIMITR_ENABLE BIT(0)
241+
#define TRBLIMITR_EL1_LIMIT_MASK GENMASK_ULL(63, 12)
242+
#define TRBLIMITR_EL1_LIMIT_SHIFT 12
243+
#define TRBLIMITR_EL1_nVM BIT(5)
244+
#define TRBLIMITR_EL1_TM_MASK GENMASK(4, 3)
245+
#define TRBLIMITR_EL1_TM_SHIFT 3
246+
#define TRBLIMITR_EL1_FM_MASK GENMASK(2, 1)
247+
#define TRBLIMITR_EL1_FM_SHIFT 1
248+
#define TRBLIMITR_EL1_E BIT(0)
249249
#define TRBPTR_PTR_MASK GENMASK_ULL(63, 0)
250250
#define TRBPTR_PTR_SHIFT 0
251251
#define TRBBASER_BASE_MASK GENMASK_ULL(51, 0)

arch/arm64/kvm/hyp/nvhe/debug-sr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static void __debug_save_trace(u64 *trfcr_el1)
5656
*trfcr_el1 = 0;
5757

5858
/* Check if the TRBE is enabled */
59-
if (!(read_sysreg_s(SYS_TRBLIMITR_EL1) & TRBLIMITR_ENABLE))
59+
if (!(read_sysreg_s(SYS_TRBLIMITR_EL1) & TRBLIMITR_EL1_E))
6060
return;
6161
/*
6262
* Prohibit trace generation while we are in guest.

drivers/hwtracing/coresight/coresight-trbe.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static inline void set_trbe_enabled(struct trbe_cpudata *cpudata, u64 trblimitr)
218218
* Enable the TRBE without clearing LIMITPTR which
219219
* might be required for fetching the buffer limits.
220220
*/
221-
trblimitr |= TRBLIMITR_ENABLE;
221+
trblimitr |= TRBLIMITR_EL1_E;
222222
write_sysreg_s(trblimitr, SYS_TRBLIMITR_EL1);
223223

224224
/* Synchronize the TRBE enable event */
@@ -236,7 +236,7 @@ static inline void set_trbe_disabled(struct trbe_cpudata *cpudata)
236236
* Disable the TRBE without clearing LIMITPTR which
237237
* might be required for fetching the buffer limits.
238238
*/
239-
trblimitr &= ~TRBLIMITR_ENABLE;
239+
trblimitr &= ~TRBLIMITR_EL1_E;
240240
write_sysreg_s(trblimitr, SYS_TRBLIMITR_EL1);
241241

242242
if (trbe_needs_drain_after_disable(cpudata))
@@ -596,13 +596,13 @@ static void set_trbe_limit_pointer_enabled(struct trbe_buf *buf)
596596
u64 trblimitr = read_sysreg_s(SYS_TRBLIMITR_EL1);
597597
unsigned long addr = buf->trbe_limit;
598598

599-
WARN_ON(!IS_ALIGNED(addr, (1UL << TRBLIMITR_LIMIT_SHIFT)));
599+
WARN_ON(!IS_ALIGNED(addr, (1UL << TRBLIMITR_EL1_LIMIT_SHIFT)));
600600
WARN_ON(!IS_ALIGNED(addr, PAGE_SIZE));
601601

602-
trblimitr &= ~TRBLIMITR_NVM;
603-
trblimitr &= ~(TRBLIMITR_FILL_MODE_MASK << TRBLIMITR_FILL_MODE_SHIFT);
604-
trblimitr &= ~(TRBLIMITR_TRIG_MODE_MASK << TRBLIMITR_TRIG_MODE_SHIFT);
605-
trblimitr &= ~(TRBLIMITR_LIMIT_MASK << TRBLIMITR_LIMIT_SHIFT);
602+
trblimitr &= ~TRBLIMITR_EL1_nVM;
603+
trblimitr &= ~TRBLIMITR_EL1_FM_MASK;
604+
trblimitr &= ~TRBLIMITR_EL1_TM_MASK;
605+
trblimitr &= ~TRBLIMITR_EL1_LIMIT_MASK;
606606

607607
/*
608608
* Fill trace buffer mode is used here while configuring the
@@ -613,14 +613,15 @@ static void set_trbe_limit_pointer_enabled(struct trbe_buf *buf)
613613
* trace data in the interrupt handler, before reconfiguring
614614
* the TRBE.
615615
*/
616-
trblimitr |= (TRBE_FILL_MODE_FILL & TRBLIMITR_FILL_MODE_MASK) << TRBLIMITR_FILL_MODE_SHIFT;
616+
trblimitr |= (TRBLIMITR_EL1_FM_FILL << TRBLIMITR_EL1_FM_SHIFT) &
617+
TRBLIMITR_EL1_FM_MASK;
617618

618619
/*
619620
* Trigger mode is not used here while configuring the TRBE for
620621
* the trace capture. Hence just keep this in the ignore mode.
621622
*/
622-
trblimitr |= (TRBE_TRIG_MODE_IGNORE & TRBLIMITR_TRIG_MODE_MASK) <<
623-
TRBLIMITR_TRIG_MODE_SHIFT;
623+
trblimitr |= (TRBLIMITR_EL1_TM_IGNR << TRBLIMITR_EL1_TM_SHIFT) &
624+
TRBLIMITR_EL1_TM_MASK;
624625
trblimitr |= (addr & PAGE_MASK);
625626
set_trbe_enabled(buf->cpudata, trblimitr);
626627
}

drivers/hwtracing/coresight/coresight-trbe.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static inline bool is_trbe_enabled(void)
3030
{
3131
u64 trblimitr = read_sysreg_s(SYS_TRBLIMITR_EL1);
3232

33-
return trblimitr & TRBLIMITR_ENABLE;
33+
return trblimitr & TRBLIMITR_EL1_E;
3434
}
3535

3636
#define TRBE_EC_OTHERS 0
@@ -86,8 +86,9 @@ static inline bool is_trbe_running(u64 trbsr)
8686

8787
#define TRBE_TRIG_MODE_STOP 0
8888
#define TRBE_TRIG_MODE_IRQ 1
89-
#define TRBE_TRIG_MODE_IGNORE 3
89+
#define TRBLIMITR_EL1_TM_IGNR 3
9090

91+
#define TRBLIMITR_EL1_FM_FILL 0
9192
#define TRBE_FILL_MODE_FILL 0
9293
#define TRBE_FILL_MODE_WRAP 1
9394
#define TRBE_FILL_MODE_CIRCULAR_BUFFER 3
@@ -121,7 +122,7 @@ static inline void set_trbe_write_pointer(unsigned long addr)
121122
static inline unsigned long get_trbe_limit_pointer(void)
122123
{
123124
u64 trblimitr = read_sysreg_s(SYS_TRBLIMITR_EL1);
124-
unsigned long addr = trblimitr & (TRBLIMITR_LIMIT_MASK << TRBLIMITR_LIMIT_SHIFT);
125+
unsigned long addr = trblimitr & TRBLIMITR_EL1_LIMIT_MASK;
125126

126127
WARN_ON(!IS_ALIGNED(addr, PAGE_SIZE));
127128
return addr;

0 commit comments

Comments
 (0)