hv_exc: Remove PMC0 CNT enable shadowing from fast sysreg path

This is outside the hv_exc_entry/hv_exc_exit bracketing now, so modify
the register directly. We only stop the PMCs when we go into the
slowpath.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-05-22 00:27:08 +09:00
parent db598aa4cf
commit 2c531aa7ae

View file

@ -283,13 +283,11 @@ static bool hv_handle_msr_unlocked(struct exc_info *ctx, u64 iss)
case SYSREG_ISS(SYS_IMP_APL_PMCR0):
if (is_read) {
u64 val = (mrs(SYS_IMP_APL_PMCR0) & ~PMCR0_IMODE_MASK) | PERCPU(pmc_irq_mode);
regs[rt] =
val | (PERCPU(pmc_pending) ? PMCR0_IACT : 0) | PERCPU(exc_entry_pmcr0_cnt);
regs[rt] = val | (PERCPU(pmc_pending) ? PMCR0_IACT : 0);
} else {
PERCPU(pmc_pending) = !!(regs[rt] & PMCR0_IACT);
PERCPU(pmc_irq_mode) = regs[rt] & PMCR0_IMODE_MASK;
PERCPU(exc_entry_pmcr0_cnt) = regs[rt] & PMCR0_CNT_MASK;
msr(SYS_IMP_APL_PMCR0, regs[rt] & ~PERCPU(exc_entry_pmcr0_cnt));
msr(SYS_IMP_APL_PMCR0, regs[rt]);
}
return true;