KVM: PPC: Book3S HV: Save/restore host PMU registers that are new in POWER8
authorPaul Mackerras <paulus@samba.org>
Mon, 24 Mar 2014 23:47:08 +0000 (10:47 +1100)
committerPaul Mackerras <paulus@samba.org>
Sat, 29 Mar 2014 08:58:52 +0000 (19:58 +1100)
commit72cde5a88d37ba88ad1d47aecf957a9e528636d7
tree0354d35ef6385dfb433f1ef565d9d01473afda0c
parentc5fb80d3b24f6280bd6f608d8f2a02139a0fabaf
KVM: PPC: Book3S HV: Save/restore host PMU registers that are new in POWER8

Currently we save the host PMU configuration, counter values, etc.,
when entering a guest, and restore it on return from the guest.
(We have to do this because the guest has control of the PMU while
it is executing.)  However, we missed saving/restoring the SIAR and
SDAR registers, as well as the registers which are new on POWER8,
namely SIER and MMCR2.

This adds code to save the values of these registers when entering
the guest and restore them on exit.  This also works around the bug
in POWER8 where setting PMAE with a counter already negative doesn't
generate an interrupt.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Scott Wood <scottwood@freescale.com>
arch/powerpc/include/asm/kvm_book3s_asm.h
arch/powerpc/kvm/book3s_hv_interrupts.S
arch/powerpc/kvm/book3s_hv_rmhandlers.S