]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated
authorGreg Kurz <groug@kaod.org>
Fri, 27 Sep 2019 11:53:38 +0000 (13:53 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 16 Dec 2019 15:32:33 +0000 (09:32 -0600)
commit1e90ef5fd5372061d0063c4146b4af5551861408
treec1d7fc962cde1d56a1e041e63238927d4a33cfd6
parent589d9aaa540ca8fdb5cd8df8f58e9de68bb447fc
KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated

BugLink: https://bugs.launchpad.net/bugs/1856583
commit e7d71c943040c23f2fd042033d319f56e84f845b upstream.

If we cannot allocate the XIVE VPs in OPAL, the creation of a XIVE or
XICS-on-XIVE device is aborted as expected, but we leave kvm->arch.xive
set forever since the release method isn't called in this case. Any
subsequent tentative to create a XIVE or XICS-on-XIVE for this VM will
thus always fail (DoS). This is a problem for QEMU since it destroys
and re-creates these devices when the VM is reset: the VM would be
restricted to using the much slower emulated XIVE or XICS forever.

As an alternative to adding rollback, do not assign kvm->arch.xive before
making sure the XIVE VPs are allocated in OPAL.

Cc: stable@vger.kernel.org # v5.2
Fixes: 5422e95103cf ("KVM: PPC: Book3S HV: XIVE: Replace the 'destroy' method by a 'release' method")
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/powerpc/kvm/book3s_xive.c
arch/powerpc/kvm/book3s_xive_native.c