-
Notifications
You must be signed in to change notification settings - Fork 33
pmu: initial support #472
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
pmu: initial support #472
Conversation
bokdeuk-jeong
commented
Nov 4, 2025
- Add pmu related registers in lib/armv9.
- Define pmu context for realm.
- Re-enable PMU tests in tf-a-tests.
1. Add pmu related registers in lib/armv9. 2. Define pmu context for realm. Signed-off-by: Bokdeuk Jeong <[email protected]>
Signed-off-by: Bokdeuk Jeong <[email protected]>
Signed-off-by: Bokdeuk Jeong <[email protected]>
a0a3723 to
2e8bd3f
Compare
| exception_non_emulatable_da_2 | ||
| exception_rec_exit_irq | ||
| gic_timer_nsel2_trig | ||
| gic_timer_rel1_trig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does gic_timer_rel1_trig not work which was working before updating rustc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall exactly.
I don't know the purpose of skipped-tests.txt. Did you intend to list all of failed/skipped/sim error cases in that file? Currently we have 7 such cases out of 102 when testing all cases without the skipped-tests.txt.
TOTAL TESTS : 102
TOTAL PASSED : 95
TOTAL FAILED : 0
TOTAL SKIPPED : 4
TOTAL SIM ERROR : 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the skipped-tests.txt to include all the cases with skipped and sim errors.
| mm_hipas_assigned_ripas_empty_da_ia | ||
| mm_ripas_destroyed_da_ia | ||
| mm_hipas_unassigned_ripas_empty_da_ia | ||
| mm_hipas_unassigned_ripas_ram_da_ia | ||
| mm_rtt_fold_assigned | ||
| mm_rtt_fold_unassigned | ||
| mm_rtt_fold_unassigned_ns | ||
| mm_rtt_fold_assigned_ns | ||
| exception_non_emulatable_da_2 | ||
| exception_rec_exit_irq | ||
| gic_timer_nsel2_trig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see that so many test cases now work without skipping!
I think that EXPECTED=71 in scripts/tests/acs.sh can be updated as well, as many tests can pass now.
| define_pmu_register!(pmevcntr0_el0, PMEVCNTR0_EL0, "PMEVCNTR0_EL0"); | ||
| define_pmu_register!(pmevcntr1_el0, PMEVCNTR1_EL0, "PMEVCNTR1_EL0"); | ||
| define_pmu_register!(pmevcntr2_el0, PMEVCNTR2_EL0, "PMEVCNTR2_EL0"); | ||
| define_pmu_register!(pmevcntr3_el0, PMEVCNTR3_EL0, "PMEVCNTR3_EL0"); | ||
| define_pmu_register!(pmevcntr4_el0, PMEVCNTR4_EL0, "PMEVCNTR4_EL0"); | ||
| define_pmu_register!(pmevcntr5_el0, PMEVCNTR5_EL0, "PMEVCNTR5_EL0"); | ||
| define_pmu_register!(pmevcntr6_el0, PMEVCNTR6_EL0, "PMEVCNTR6_EL0"); | ||
| define_pmu_register!(pmevcntr7_el0, PMEVCNTR7_EL0, "PMEVCNTR7_EL0"); | ||
| define_pmu_register!(pmevcntr8_el0, PMEVCNTR8_EL0, "PMEVCNTR8_EL0"); | ||
| define_pmu_register!(pmevcntr9_el0, PMEVCNTR9_EL0, "PMEVCNTR9_EL0"); | ||
| define_pmu_register!(pmevcntr10_el0, PMEVCNTR10_EL0, "PMEVCNTR10_EL0"); | ||
| define_pmu_register!(pmevcntr11_el0, PMEVCNTR11_EL0, "PMEVCNTR11_EL0"); | ||
| define_pmu_register!(pmevcntr12_el0, PMEVCNTR12_EL0, "PMEVCNTR12_EL0"); | ||
| define_pmu_register!(pmevcntr13_el0, PMEVCNTR13_EL0, "PMEVCNTR13_EL0"); | ||
| define_pmu_register!(pmevcntr14_el0, PMEVCNTR14_EL0, "PMEVCNTR14_EL0"); | ||
| define_pmu_register!(pmevcntr15_el0, PMEVCNTR15_EL0, "PMEVCNTR15_EL0"); | ||
| define_pmu_register!(pmevcntr16_el0, PMEVCNTR16_EL0, "PMEVCNTR16_EL0"); | ||
| define_pmu_register!(pmevcntr17_el0, PMEVCNTR17_EL0, "PMEVCNTR17_EL0"); | ||
| define_pmu_register!(pmevcntr18_el0, PMEVCNTR18_EL0, "PMEVCNTR18_EL0"); | ||
| define_pmu_register!(pmevcntr19_el0, PMEVCNTR19_EL0, "PMEVCNTR19_EL0"); | ||
| define_pmu_register!(pmevcntr20_el0, PMEVCNTR20_EL0, "PMEVCNTR20_EL0"); | ||
| define_pmu_register!(pmevcntr21_el0, PMEVCNTR21_EL0, "PMEVCNTR21_EL0"); | ||
| define_pmu_register!(pmevcntr22_el0, PMEVCNTR22_EL0, "PMEVCNTR22_EL0"); | ||
| define_pmu_register!(pmevcntr23_el0, PMEVCNTR23_EL0, "PMEVCNTR23_EL0"); | ||
| define_pmu_register!(pmevcntr24_el0, PMEVCNTR24_EL0, "PMEVCNTR24_EL0"); | ||
| define_pmu_register!(pmevcntr25_el0, PMEVCNTR25_EL0, "PMEVCNTR25_EL0"); | ||
| define_pmu_register!(pmevcntr26_el0, PMEVCNTR26_EL0, "PMEVCNTR26_EL0"); | ||
| define_pmu_register!(pmevcntr27_el0, PMEVCNTR27_EL0, "PMEVCNTR27_EL0"); | ||
| define_pmu_register!(pmevcntr28_el0, PMEVCNTR28_EL0, "PMEVCNTR28_EL0"); | ||
| define_pmu_register!(pmevcntr29_el0, PMEVCNTR29_EL0, "PMEVCNTR29_EL0"); | ||
| define_pmu_register!(pmevcntr30_el0, PMEVCNTR30_EL0, "PMEVCNTR30_EL0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that these code can be refactored with an additional macro like some_macro!(pcmevcntr, el0, 0, 30).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried, but I am not good with handling macro functions. I will leave this out of this PR's scope.
| pub use pmevcntr0_el0::PMEVCNTR0_EL0; | ||
| pub use pmevcntr10_el0::PMEVCNTR10_EL0; | ||
| pub use pmevcntr11_el0::PMEVCNTR11_EL0; | ||
| pub use pmevcntr12_el0::PMEVCNTR12_EL0; | ||
| pub use pmevcntr13_el0::PMEVCNTR13_EL0; | ||
| pub use pmevcntr14_el0::PMEVCNTR14_EL0; | ||
| pub use pmevcntr15_el0::PMEVCNTR15_EL0; | ||
| pub use pmevcntr16_el0::PMEVCNTR16_EL0; | ||
| pub use pmevcntr17_el0::PMEVCNTR17_EL0; | ||
| pub use pmevcntr18_el0::PMEVCNTR18_EL0; | ||
| pub use pmevcntr19_el0::PMEVCNTR19_EL0; | ||
| pub use pmevcntr1_el0::PMEVCNTR1_EL0; | ||
| pub use pmevcntr20_el0::PMEVCNTR20_EL0; | ||
| pub use pmevcntr21_el0::PMEVCNTR21_EL0; | ||
| pub use pmevcntr22_el0::PMEVCNTR22_EL0; | ||
| pub use pmevcntr23_el0::PMEVCNTR23_EL0; | ||
| pub use pmevcntr24_el0::PMEVCNTR24_EL0; | ||
| pub use pmevcntr25_el0::PMEVCNTR25_EL0; | ||
| pub use pmevcntr26_el0::PMEVCNTR26_EL0; | ||
| pub use pmevcntr27_el0::PMEVCNTR27_EL0; | ||
| pub use pmevcntr28_el0::PMEVCNTR28_EL0; | ||
| pub use pmevcntr29_el0::PMEVCNTR29_EL0; | ||
| pub use pmevcntr2_el0::PMEVCNTR2_EL0; | ||
| pub use pmevcntr30_el0::PMEVCNTR30_EL0; | ||
| pub use pmevcntr3_el0::PMEVCNTR3_EL0; | ||
| pub use pmevcntr4_el0::PMEVCNTR4_EL0; | ||
| pub use pmevcntr5_el0::PMEVCNTR5_EL0; | ||
| pub use pmevcntr6_el0::PMEVCNTR6_EL0; | ||
| pub use pmevcntr7_el0::PMEVCNTR7_EL0; | ||
| pub use pmevcntr8_el0::PMEVCNTR8_EL0; | ||
| pub use pmevcntr9_el0::PMEVCNTR9_EL0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be refactored as well.
nook1208
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to support pmu for realm !
1. Remove 'sme' from the build features. Otherwise, rustc tries to utilize simd registers in rmm and it results in corrupting both rmm and realm states since Islet doesn't maintain simd register contexts for its own by choice. 2. Call sve registers by op codes instead of their mnemonics, since compiler does not understand the names anymore. Signed-off-by: Bokdeuk Jeong <[email protected]>
1. Update the number of passed (EXPECTED) count in scripts/tests/acs.sh. 2. Update the skipped-list.txt Include skipped and Sim error cases. Signed-off-by: Bokdeuk Jeong <[email protected]>