]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Don't push XIVE context when not using XIVE device
authorPaul Mackerras <paulus@ozlabs.org>
Tue, 13 Aug 2019 10:01:00 +0000 (20:01 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 16 Aug 2019 04:16:08 +0000 (14:16 +1000)
commite541ec626fa9c4c177876196092353758d383c28
treeef7a3207280b812c9ce915caac667455aa0084f3
parenta89ed4ac4b93454270c98e8fb26eaa49467f8b6e
KVM: PPC: Book3S HV: Don't push XIVE context when not using XIVE device

At present, when running a guest on POWER9 using HV KVM but not using
an in-kernel interrupt controller (XICS or XIVE), for example if QEMU
is run with the kernel_irqchip=off option, the guest entry code goes
ahead and tries to load the guest context into the XIVE hardware, even
though no context has been set up.

To fix this, we check that the "CAM word" is non-zero before pushing
it to the hardware.  The CAM word is initialized to a non-zero value
in kvmppc_xive_connect_vcpu() and kvmppc_xive_native_connect_vcpu(),
and is now cleared in kvmppc_xive_{,native_}cleanup_vcpu.

Fixes: e5481c5e884e ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller")
Cc: stable@vger.kernel.org # v4.12+
Reported-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190813100100.GC9567@blackberry
arch/powerpc/kvm/book3s_hv_rmhandlers.S
arch/powerpc/kvm/book3s_xive.c
arch/powerpc/kvm/book3s_xive_native.c