diff --git a/repos/base-hw/src/bootstrap/spec/rpi3/platform.cc b/repos/base-hw/src/bootstrap/spec/rpi3/platform.cc index 3dd063e0f..75457ddf3 100644 --- a/repos/base-hw/src/bootstrap/spec/rpi3/platform.cc +++ b/repos/base-hw/src/bootstrap/spec/rpi3/platform.cc @@ -104,6 +104,9 @@ unsigned Bootstrap::Platform::enable_mmu() prepare_hypervisor(); } + /* enable performance counter for user-land */ + Cpu::Pmuserenr_el0::write(0b1111); + Cpu::Vbar_el1::write(Hw::Mm::supervisor_exception_vector().base); /* set memory attributes in indirection register */ diff --git a/repos/base-hw/src/include/hw/spec/arm_64/cpu.h b/repos/base-hw/src/include/hw/spec/arm_64/cpu.h index 969f416a2..a867dd0ba 100644 --- a/repos/base-hw/src/include/hw/spec/arm_64/cpu.h +++ b/repos/base-hw/src/include/hw/spec/arm_64/cpu.h @@ -97,6 +97,8 @@ struct Hw::Arm_64_cpu struct Attr3 : Bitfield<24, 8> {}; ); + SYSTEM_REGISTER(32, Pmuserenr_el0, pmuserenr_el0); + SYSTEM_REGISTER(64, Scr, scr_el3, struct Ns : Bitfield<0, 1> {}; struct Smd : Bitfield<7, 1> {};