[PATCH 06/19] coresight: trbe: Refactor syndrome decoding

Leo Yan leo.yan at arm.com
Tue Dec 9 08:06:10 PST 2025


On Tue, Dec 09, 2025 at 01:17:50PM +0000, James Clark wrote:

[...]

> > > +    pr_err_ratelimited("%s on CPU %d [TRBSR=0x%016llx,
> > > TRBPTR=0x%016llx, TRBLIMITR=0x%016llx]\n",
> > > +               err_str, smp_processor_id(), trbsr,
> > > +               read_sysreg_s(SYS_TRBPTR_EL1),
> > > +               read_sysreg_s(SYS_TRBLIMITR_EL1));
> 
> Don't you need to use %p to not leak pointers?

I will use "%pK" instead for debugging purpose when set
kptr_restrict=0.

> > > +    return TRBE_FAULT_ACT_FATAL;
> > >   }
> > >   static unsigned long trbe_get_trace_size(struct perf_output_handle
> > > *handle,
> > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.h b/drivers/
> > > hwtracing/coresight/coresight-trbe.h
> > > index 45202c48accec7c86ba56130e2737bc2d1830fae..d7f7cd763c0c7139cf322b7336ee563073e3bea0
> > > 100644
> > > --- a/drivers/hwtracing/coresight/coresight-trbe.h
> > > +++ b/drivers/hwtracing/coresight/coresight-trbe.h
> > > @@ -35,9 +35,11 @@ static inline bool is_trbe_enabled(void)
> > >       return trblimitr & TRBLIMITR_EL1_E;
> > >   }
> > > -#define TRBE_EC_OTHERS        0
> > > -#define TRBE_EC_STAGE1_ABORT    36
> > > -#define TRBE_EC_STAGE2_ABORT    37
> > > +#define TRBE_EC_OTHERS            0x0
> > > +#define TRBE_EC_GP_CHECK_FAULT        0X1e
> > > +#define TRBE_EC_BUF_MGMT_IMPL        0x1f
> > > +#define TRBE_EC_STAGE1_ABORT        0x24
> > > +#define TRBE_EC_STAGE2_ABORT        0x25
> 
> I know some were already defined here, but this should probably be an enum
> in sysreg.

Good point.  Will do.

Thanks,
Leo



More information about the linux-arm-kernel mailing list