diff options
author | Atish Patra <atish.patra@wdc.com> | 2021-07-10 19:18:06 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-07-11 07:44:26 +0300 |
commit | 9c9b4ad24bf5891272679a6e994c64463db8ca03 (patch) | |
tree | c16842683e501f499693201a4884c338bb81c558 /lib/sbi/sbi_ecall_hsm.c | |
parent | 0829f2bc284c07576a0dc9a569beea2a2d68dc3d (diff) | |
download | opensbi-9c9b4ad24bf5891272679a6e994c64463db8ca03.tar.xz |
lib: sbi: Disable m/scounteren & enable mcountinhibit
Currently, all bits in mcountern are enabled unconditionally at boot time.
With SBI PMU extension, all the programmable counters should enabled only
during performance monitoring for a particular event. However, this is done
only if mcountinhibit is implemented because the supervisor mode can not
start/stop any event without mcountinhibit.
Similarly, supervisor should take care enabling scounteren which allows
U-mode to access programmable pmu counters. All the non-programmable ones
(CY, TM, IR) should be enabled in M-mode because some userspace may rely on
builtins such as __builtin_readcyclecounter. Supervisor OS can still disable
them during initial configuration.
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_ecall_hsm.c')
0 files changed, 0 insertions, 0 deletions