-
Notifications
You must be signed in to change notification settings - Fork 39
Description
I have been testing RPi4B recently both in AArch64 and AArch32 modes and found out that while for the 64-bit variant sel4bench works fine it fails to pass for 32-bits.
The problem stems from having different numbers of performance counters reported by the PMCR register (0 for 32 and 6 for 64). The places where we implicitly rely on them being greater than 0 are:
In scheduler:
void benchmark_set_prio_average(ccnt_t results[N_RUNS][NUM_AVERAGE_EVENTS], seL4_CPtr auth)
and void benchmark_yield_average(ccnt_t results[N_RUNS][NUM_AVERAGE_EVENTS]).
In signal: void high_prio_signal_fn(int argc, char **argv)
Whereas in the scheduler there is an assert that fires, in the two other places we pass the 0 as the divisor to the DIV_ROUND_UP function that returns 1 from the division (due to an UB?).
The docs quote:
Indicates the number of event counters implemented. This value is in the range of 0b00000-0b11111. If the value is 0b00000, then only PMCCNTR is implemented. If the value is 0b11111, then PMCCNTR and 31 event counters are implemented.
Maybe we can rely on this value being 0 and the asserts are unnecessary?