OSDN Git Service

KVM: PPC: Book3S HV: Make sure we don't re-enter guest without XIVE loaded
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 11 Jan 2018 03:31:43 +0000 (14:31 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Wed, 17 Jan 2018 00:18:48 +0000 (11:18 +1100)
commit43ff3f65234061e08d234bdef5a9aadc19832b74
tree803b7bfef4591b2c978e767746307b4ab16453cd
parent5855564c8ab2d9cefca7b2933bd19818eb795e40
KVM: PPC: Book3S HV: Make sure we don't re-enter guest without XIVE loaded

This fixes a bug where it is possible to enter a guest on a POWER9
system without having the XIVE (interrupt controller) context loaded.
This can happen because we unload the XIVE context from the CPU
before doing the real-mode handling for machine checks.  After the
real-mode handler runs, it is possible that we re-enter the guest
via a fast path which does not load the XIVE context.

To fix this, we move the unloading of the XIVE context to come after
the real-mode machine check handler is called.

Fixes: 5af50993850a ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller")
Cc: stable@vger.kernel.org # v4.11+
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_hv_rmhandlers.S