Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xuantie: pmu: Support cycles&instructions overflow interrupt #1

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

cp0613
Copy link
Collaborator

@cp0613 cp0613 commented Nov 16, 2024

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

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.

[1] riscvarchive/riscv-count-overflow#5

Signed-off-by: Chen Pei <[email protected]>
@guoren83 guoren83 merged commit ad40f17 into XUANTIE-RV:linux-6.6 Nov 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants