]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: XIVE: Introduce a new mutex for the XIVE device
authorCédric Le Goater <clg@kaod.org>
Fri, 24 May 2019 13:20:30 +0000 (15:20 +0200)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 30 May 2019 03:53:33 +0000 (13:53 +1000)
commit91f9a239e4b73f8144cf64117d34c568d0a65fcd
tree59491b7497a405c12603e6b16a18dde174d36fa1
parentd39a12c485fae0f78a01fa8b77e7509630d6c195
KVM: PPC: Book3S HV: XIVE: Introduce a new mutex for the XIVE device

The XICS-on-XIVE KVM device needs to allocate XIVE event queues when a
priority is used by the OS. This is referred as EQ provisioning and it
is done under the hood when :

  1. a CPU is hot-plugged in the VM
  2. the "set-xive" is called at VM startup
  3. sources are restored at VM restore

The kvm->lock mutex is used to protect the different XIVE structures
being modified but in some contexts, kvm->lock is taken under the
vcpu->mutex which is not permitted by the KVM locking rules.

Introduce a new mutex 'lock' for the KVM devices for them to
synchronize accesses to the XIVE device structures.

Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_xive.c
arch/powerpc/kvm/book3s_xive.h
arch/powerpc/kvm/book3s_xive_native.c