xuantie: pmu: Support cycles&instructions overflow interrupt #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Sscofpmf spec does not define overflow interrupts for cycles & instructions [1]. But this is indispensable in performance profiling.
Xuantie added registers mhpmevent0 and mhpmevent2, with addresses 0x7E0 and 0x7E1 respectively, which are used to configure cycles & instructions.
At the same time, mxstatus[8] is newly defined as ofint to control whether the cycles and instructions events of HPCP can generate interrupt 13 (lcofip). When it is 1, an interrupt can be generated, and when it is 0, an interrupt cannot be generated.
This patch is used to support the above functions. Changes to mxstatus will be committed in zsb [2].
[1] riscvarchive/riscv-count-overflow#5
[2] https://github.com/XUANTIE-RV/zero_stage_boot