KVM: PPC: Work around POWER7 DABR corruption problem
authorPaul Mackerras <paulus@samba.org>
Fri, 2 Mar 2012 01:38:23 +0000 (01:38 +0000)
committerAvi Kivity <avi@redhat.com>
Sun, 8 Apr 2012 11:01:36 +0000 (14:01 +0300)
commit8943633cf9b87980d261a022e90d94bc2c55df35
tree84ab3cd65cc67149efeb75020ecc75a50c6f1c10
parent7657f4089b097846cc37bfa2b74fc0bd2bd60e30
KVM: PPC: Work around POWER7 DABR corruption problem

It turns out that on POWER7, writing to the DABR can cause a corrupted
value to be written if the PMU is active and updating SDAR in continuous
sampling mode.  To work around this, we make sure that the PMU is inactive
and SDAR updates are disabled (via MMCRA) when we are context-switching
DABR.

When the guest sets DABR via the H_SET_DABR hypercall, we use a slightly
different workaround, which is to read back the DABR and write it again
if it got corrupted.

While we are at it, make it consistent that the saving and restoring
of the guest's non-volatile GPRs and the FPRs are done with the guest
setup of the PMU active.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/book3s_hv_interrupts.S
arch/powerpc/kvm/book3s_hv_rmhandlers.S