|
@@ -513,6 +513,14 @@ static void cntvct_read_handler(unsigned int esr, struct pt_regs *regs)
|
|
|
regs->pc += 4;
|
|
|
}
|
|
|
|
|
|
+static void cntfrq_read_handler(unsigned int esr, struct pt_regs *regs)
|
|
|
+{
|
|
|
+ int rt = (esr & ESR_ELx_SYS64_ISS_RT_MASK) >> ESR_ELx_SYS64_ISS_RT_SHIFT;
|
|
|
+
|
|
|
+ pt_regs_write_reg(regs, rt, read_sysreg(cntfrq_el0));
|
|
|
+ regs->pc += 4;
|
|
|
+}
|
|
|
+
|
|
|
struct sys64_hook {
|
|
|
unsigned int esr_mask;
|
|
|
unsigned int esr_val;
|
|
@@ -537,6 +545,12 @@ static struct sys64_hook sys64_hooks[] = {
|
|
|
.esr_val = ESR_ELx_SYS64_ISS_SYS_CNTVCT,
|
|
|
.handler = cntvct_read_handler,
|
|
|
},
|
|
|
+ {
|
|
|
+ /* Trap read access to CNTFRQ_EL0 */
|
|
|
+ .esr_mask = ESR_ELx_SYS64_ISS_SYS_OP_MASK,
|
|
|
+ .esr_val = ESR_ELx_SYS64_ISS_SYS_CNTFRQ,
|
|
|
+ .handler = cntfrq_read_handler,
|
|
|
+ },
|
|
|
{},
|
|
|
};
|
|
|
|