2023-12-13 15:32:28

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v5 07/16] RISC-V: Move T-Head PMU to CPU feature alternative framework

On Wed, Dec 13, 2023 at 03:02:52PM +0800, Yu Chien Peter Lin wrote:
> The custom PMU extension aims to support perf event sampling prior
> to the ratification of Sscofpmf. Instead of diverting the bits and
> register reserved for future standard, a set of custom registers is
> added. Hence, we may consider it as a CPU feature rather than an
> erratum.
>
> T-Head cores need to append "xtheadpmu" to the riscv,isa-extensions
> for each cpu node in device tree, and enable CONFIG_THEAD_CUSTOM_PMU
> for proper functioning as of this commit.
>
> Signed-off-by: Yu Chien Peter Lin <[email protected]>
> Reviewed-by: Guo Ren <[email protected]>

Reviewed-by: Conor Dooley <[email protected]>

Cheers,
Conor.


Attachments:
(No filename) (740.00 B)
signature.asc (235.00 B)
Download all attachments

2023-12-13 15:35:48

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v5 07/16] RISC-V: Move T-Head PMU to CPU feature alternative framework

On Wed, Dec 13, 2023 at 03:27:25PM +0000, Conor Dooley wrote:
> On Wed, Dec 13, 2023 at 03:02:52PM +0800, Yu Chien Peter Lin wrote:
> > The custom PMU extension aims to support perf event sampling prior
> > to the ratification of Sscofpmf. Instead of diverting the bits and
> > register reserved for future standard, a set of custom registers is
> > added. Hence, we may consider it as a CPU feature rather than an
> > erratum.
> >
> > T-Head cores need to append "xtheadpmu" to the riscv,isa-extensions
> > for each cpu node in device tree, and enable CONFIG_THEAD_CUSTOM_PMU
> > for proper functioning as of this commit.
> >
> > Signed-off-by: Yu Chien Peter Lin <[email protected]>
> > Reviewed-by: Guo Ren <[email protected]>
>
> Reviewed-by: Conor Dooley <[email protected]>

I think it is also worth mentioning that the only SoC, to my knowledge,
that works with a mainline kernel, and supports the SBI PMU is the D1,
and only recently has the OpenSBI port for the SoC been fixed to
actually work correctly, and that has apparently not yet made it to
a release of OpenSBI, making the "damage" caused by requiring a DT
property for PMU support not all that bad since the firmware needs to be
changed anyway.

Thanks for your work on this,
Conor.


Attachments:
(No filename) (1.27 kB)
signature.asc (235.00 B)
Download all attachments