Skip to content

Conversation

@bokdeuk-jeong
Copy link
Collaborator

  1. Add pmu related registers in lib/armv9.
  2. Define pmu context for realm.
  3. 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]>
@bokdeuk-jeong bokdeuk-jeong force-pushed the pmu branch 2 times, most recently from a0a3723 to 2e8bd3f Compare November 10, 2025 08:57
@bokdeuk-jeong bokdeuk-jeong marked this pull request as ready for review November 10, 2025 09:39
exception_non_emulatable_da_2
exception_rec_exit_irq
gic_timer_nsel2_trig
gic_timer_rel1_trig
Copy link
Collaborator

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?

Copy link
Collaborator Author

@bokdeuk-jeong bokdeuk-jeong Nov 12, 2025

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

Copy link
Collaborator Author

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.

Comment on lines -15 to -25
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
Copy link
Collaborator

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.

Comment on lines +44 to +74
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");
Copy link
Collaborator

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).

Copy link
Collaborator Author

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.

Comment on lines +111 to +141
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;
Copy link
Collaborator

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.

Copy link
Collaborator

@nook1208 nook1208 left a 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]>
@bokdeuk-jeong bokdeuk-jeong merged commit 7e23b24 into main Nov 12, 2025
8 checks passed
@bokdeuk-jeong bokdeuk-jeong deleted the pmu branch November 12, 2025 07:06
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.

3 participants