Skip to content

[csr/scounteren] fix privilege violation logic

Created by: acaldaya

This PR fixes a privilege violation check when accessing the counter CSR from U-mode. According to the spec:

...U-mode may only access a counter if the corresponding bits in scounteren and mcounteren are both set.

Before this fix, the violation only happens if both are set.

Tested on Linux 5.19 while using rdcycle from U-mode.

Merge request reports

Loading