]> git.karo-electronics.de Git - mv-sheeva.git/commit
oprofile/fsl emb: Don't set MSR[PMM] until after clearing the interrupt.
authorScott Wood <scottwood@freescale.com>
Wed, 19 May 2010 20:32:21 +0000 (15:32 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 14 Oct 2010 05:53:05 +0000 (00:53 -0500)
commit4267ea72bb09dc58f006df26c8d3e897489fabca
tree558bd1e7ce1d8d42dca5ce0a2e0cc2886e28d124
parent4f0e332239e2b5f79757cb8f8f3db16c66f5d220
oprofile/fsl emb: Don't set MSR[PMM] until after clearing the interrupt.

On an arch 2.06 hypervisor, a pending perfmon interrupt will be delivered
to the hypervisor at any point the guest is running, regardless of
MSR[EE].  In order to reflect this interrupt, the hypervisor has to mask
the interrupt in PMGC0 -- and set MSRP[PMMP] to intercept futher guest
accesses to the PMRs to detect when to unmask (and prevent the guest from
unmasking early, or seeing inconsistent state).

This has the side effect of ignoring any changes the guest makes to
MSR[PMM], so wait until after the interrupt is clear, and thus the
hypervisor should have cleared MSRP[PMMP], before setting MSR[PMM].  The
counters wil not actually run until PMGC0[FAC] is cleared in
pmc_start_ctrs(), so this will not reduce the effectiveness of PMM.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/oprofile/op_model_fsl_emb.c