• Cédric Le Goater's avatar
    KVM: PPC: Book3S HV: XIVE: Introduce a new mutex for the XIVE device · 7e10b9a6
    Cédric Le Goater authored
    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: default avatarGreg Kurz <groug@kaod.org>
    Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    7e10b9a6
book3s_xive.h 7.69 KB