]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Enable guests to use large decrementer mode on POWER9
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 22 May 2017 06:55:16 +0000 (16:55 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 19 Jun 2017 04:02:04 +0000 (14:02 +1000)
commit71713bba21dbae046d32b7773bcd9f363d64fc53
tree9ebed7c173b556ce8434da58b09d7794faca9508
parentf000b8cb76ac93a5eb7f470fa1ca9f5cb88df5a1
KVM: PPC: Book3S HV: Enable guests to use large decrementer mode on POWER9

This allows userspace (e.g. QEMU) to enable large decrementer mode for
the guest when running on a POWER9 host, by setting the LPCR_LD bit in
the guest LPCR value.  With this, the guest exit code saves 64 bits of
the guest DEC value on exit.  Other places that use the guest DEC
value check the LPCR_LD bit in the guest LPCR value, and if it is set,
omit the 32-bit sign extension that would otherwise be done.

This doesn't change the DEC emulation used by PR KVM because PR KVM
is not supported on POWER9 yet.

This is partly based on an earlier patch by Oliver O'Halloran.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_rmhandlers.S
arch/powerpc/kvm/emulate.c