[PATCH v2 05/15] lib: sbi: Disable m/scounteren & enable mcountinhibit
Atish Patra
atishp at atishpatra.org
Thu May 27 15:06:47 PDT 2021
On Wed, May 26, 2021 at 5:36 PM Jessica Clarke <jrtc27 at jrtc27.com> wrote:
>
> On 27 May 2021, at 01:30, Atish Patra <atish.patra at wdc.com> wrote:
> >
> > Currently, all bits in mcountern are enabled unconditionally at
> > boot time. With SBI PMU extension, this should enabled only during
> > performance monitoring for a particular event except the TM bit. 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 pmu counters. Disable all bits in scounteren in M-mode.
>
> Turning off CY or IR seems like a bad idea to me. Similarly, all of CY, IR and
> TM should be enabled in scounteren by default, this is just needlessly hostile.
This happens only if the platform supports mcountinhibit. As per the
priv spec, no counter should run unless the corresponding bit in
mcountinhibit
is cleared. This patch just follows the spec.
> IMO both mcounteren and scounteren should be initialised to 7 on boot.
>
> Jess
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
--
Regards,
Atish
More information about the opensbi
mailing list