diff --git a/repos/base-hw/src/bootstrap/spec/arm_64/cortex_a53_mmu.cc b/repos/base-hw/src/bootstrap/spec/arm_64/cortex_a53_mmu.cc index f8d9536e0..091e60dd0 100644 --- a/repos/base-hw/src/bootstrap/spec/arm_64/cortex_a53_mmu.cc +++ b/repos/base-hw/src/bootstrap/spec/arm_64/cortex_a53_mmu.cc @@ -158,6 +158,9 @@ unsigned Bootstrap::Platform::enable_mmu() /* enable performance counter for user-land */ Cpu::Pmuserenr_el0::write(0b1111); + Cpu::Pmcr_el0::access_t pmcr = Cpu::Pmcr_el0::read(); + Cpu::Pmcr_el0::write(pmcr | 1); + Cpu::Pmcntenset_el0::write(1 << 31); /* enable user-level access of physical/virtual counter */ Cpu::Cntkctl_el1::write(0b11); 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 5dee63eb5..4d195d4e1 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 @@ -137,6 +137,8 @@ struct Hw::Arm_64_cpu SYSTEM_REGISTER(64, Mpidr, mpidr_el1); + SYSTEM_REGISTER(32, Pmcr_el0, pmcr_el0); + SYSTEM_REGISTER(32, Pmcntenset_el0, pmcntenset_el0); SYSTEM_REGISTER(32, Pmuserenr_el0, pmuserenr_el0); SYSTEM_REGISTER(64, Scr, scr_el3,