]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: XIVE: Add support for automatic save-restore
authorCédric Le Goater <clg@kaod.org>
Tue, 20 Jul 2021 13:42:09 +0000 (15:42 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 10 Aug 2021 13:15:02 +0000 (23:15 +1000)
commit32260e3797bf814e837147fc3d5e3fc54f41309a
treef11b8cfb23d59ceec4cc6718721f09d278481237
parent4607fdbda479e4b7aba653f6c9b7707483efd45b
KVM: PPC: Book3S HV: XIVE: Add support for automatic save-restore

On P10, the feature doing an automatic "save & restore" of a VCPU
interrupt context is set by default in OPAL. When a VP context is
pulled out, the state of the interrupt registers are saved by the XIVE
interrupt controller under the internal NVP structure representing the
VP. This saves a costly store/load in guest entries and exits.

If OPAL advertises the "save & restore" feature in the device tree,
it should also have set the 'H' bit in the CAM line. Check that when
vCPUs are connected to their ICP in KVM before going any further.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210720134209.256133-3-clg@kaod.org
arch/powerpc/include/asm/xive-regs.h
arch/powerpc/include/asm/xive.h
arch/powerpc/kvm/book3s_xive.c
arch/powerpc/kvm/book3s_xive.h
arch/powerpc/kvm/book3s_xive_native.c
arch/powerpc/sysdev/xive/native.c