aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_xive.h
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2019-05-24 15:20:30 +0200
committerPaul Mackerras <paulus@ozlabs.org>2019-05-30 13:53:33 +1000
commit7e10b9a6da619bcee243980d9c45112761a86e11 (patch)
tree59491b7497a405c12603e6b16a18dde174d36fa1 /arch/powerpc/kvm/book3s_xive.h
parentKVM: PPC: Book3S HV: XIVE: Fix the enforced limit on the vCPU identifier (diff)
downloadlinux-dev-7e10b9a6da619bcee243980d9c45112761a86e11.tar.xz
linux-dev-7e10b9a6da619bcee243980d9c45112761a86e11.zip
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>
Diffstat (limited to 'arch/powerpc/kvm/book3s_xive.h')
-rw-r--r--arch/powerpc/kvm/book3s_xive.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_xive.h b/arch/powerpc/kvm/book3s_xive.h
index 426146332984..862c2c9650ae 100644
--- a/arch/powerpc/kvm/book3s_xive.h
+++ b/arch/powerpc/kvm/book3s_xive.h
@@ -141,6 +141,7 @@ struct kvmppc_xive {
struct kvmppc_xive_ops *ops;
struct address_space *mapping;
struct mutex mapping_lock;
+ struct mutex lock;
};
#define KVMPPC_XIVE_Q_COUNT 8