Re: [PATCH v3] drivers/perf: riscv_pmu_sbi: add support for PMU variant on T-Head C9xx cores

From: Heiko Stübner
Date: Mon Sep 05 2022 - 15:00:18 EST


Hi Andreas,

Am Montag, 5. September 2022, 16:30:48 CEST schrieb Andreas Schwab:
> On Sep 05 2022, Heiko Stuebner wrote:
> > To work properly, this requires a matching change in SBI, though the actual
> > interface between kernel and SBI does not change.
>
> What happens if you mix different kernel and SBI versions?

The interface kernel <-> sbi itself is not changed at all and this of
course only matters to t-head c9xx cpu cores, so I guess we have
the cases:

- non-t-head core:
no behaviour change independent of versions


- t-head core with everything "old":
would just uses the regular sbi pmu setup, but as the necessary
sbi-side pmu config for the c9xx isn't set from u-boot
(dt-properties mapping sbi-events to the values needed to be written
to mhpmevent*), this is broken anyway with standard sbi


- t-head core with "old" kernel, "new" sbi:
kernel does not detect the extended features, so should fall back
to just use the standard pmu features


- t-head core with "new" kernel", "old" sbi:
Same as everything "old", pmu isn't setup correctly in sbi anyway
for the c9xx at the moment


Heiko