mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-08 18:21:29 +01:00
Currently, REFERENCE_CTR and DELIVERED_CTR are always read by sending an RPMI message to the controller. This does not scale well since these registers are typically polled frequently by CPU frequency governors. The reference counter can be simply the TIME csr, so it can be read locally without going over RPMI. If the fast channel is supported, the delivered counter can also be emulated locally: the fast channel exposes the current frequency, which is multiplied by the elapsed TIME csr ticks since the last read to calculate the delivered performance counter. Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260703050530.2460037-3-sunilvl@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>