aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/interrupt.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2014-12-17 04:36:04 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-01-23 07:25:37 -0500
commit69a8d456263849152826542c7cb0a164b90e68a8 (patch)
tree91df244d7b1e0ccd855f952ca2ea4597b74f8671 /arch/s390/kvm/interrupt.c
parent2444b352c3acf54897b0e2803a7c4e66699f9f43 (diff)
KVM: s390: no need to hold the kvm->mutex for floating interrupts
The kvm mutex was (probably) used to protect against cpu hotplug. The current code no longer needs to protect against that, as we only rely on CPU data structures that are guaranteed to be available if we can access the CPU. (e.g. vcpu_create will put the cpu in the array AFTER the cpu is ready). Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r--arch/s390/kvm/interrupt.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 0ad1f7500abd..8ebae298a24d 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -1182,7 +1182,6 @@ struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm,
1182 1182
1183 if ((!schid && !cr6) || (schid && cr6)) 1183 if ((!schid && !cr6) || (schid && cr6))
1184 return NULL; 1184 return NULL;
1185 mutex_lock(&kvm->lock);
1186 fi = &kvm->arch.float_int; 1185 fi = &kvm->arch.float_int;
1187 spin_lock(&fi->lock); 1186 spin_lock(&fi->lock);
1188 inti = NULL; 1187 inti = NULL;
@@ -1210,7 +1209,6 @@ struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm,
1210 if (list_empty(&fi->list)) 1209 if (list_empty(&fi->list))
1211 atomic_set(&fi->active, 0); 1210 atomic_set(&fi->active, 0);
1212 spin_unlock(&fi->lock); 1211 spin_unlock(&fi->lock);
1213 mutex_unlock(&kvm->lock);
1214 return inti; 1212 return inti;
1215} 1213}
1216 1214
@@ -1223,7 +1221,6 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
1223 int sigcpu; 1221 int sigcpu;
1224 int rc = 0; 1222 int rc = 0;
1225 1223
1226 mutex_lock(&kvm->lock);
1227 fi = &kvm->arch.float_int; 1224 fi = &kvm->arch.float_int;
1228 spin_lock(&fi->lock); 1225 spin_lock(&fi->lock);
1229 if (fi->irq_count >= KVM_S390_MAX_FLOAT_IRQS) { 1226 if (fi->irq_count >= KVM_S390_MAX_FLOAT_IRQS) {
@@ -1274,7 +1271,6 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
1274 kvm_s390_vcpu_wakeup(kvm_get_vcpu(kvm, sigcpu)); 1271 kvm_s390_vcpu_wakeup(kvm_get_vcpu(kvm, sigcpu));
1275unlock_fi: 1272unlock_fi:
1276 spin_unlock(&fi->lock); 1273 spin_unlock(&fi->lock);
1277 mutex_unlock(&kvm->lock);
1278 return rc; 1274 return rc;
1279} 1275}
1280 1276
@@ -1444,7 +1440,6 @@ void kvm_s390_clear_float_irqs(struct kvm *kvm)
1444 struct kvm_s390_float_interrupt *fi; 1440 struct kvm_s390_float_interrupt *fi;
1445 struct kvm_s390_interrupt_info *n, *inti = NULL; 1441 struct kvm_s390_interrupt_info *n, *inti = NULL;
1446 1442
1447 mutex_lock(&kvm->lock);
1448 fi = &kvm->arch.float_int; 1443 fi = &kvm->arch.float_int;
1449 spin_lock(&fi->lock); 1444 spin_lock(&fi->lock);
1450 list_for_each_entry_safe(inti, n, &fi->list, list) { 1445 list_for_each_entry_safe(inti, n, &fi->list, list) {
@@ -1454,7 +1449,6 @@ void kvm_s390_clear_float_irqs(struct kvm *kvm)
1454 fi->irq_count = 0; 1449 fi->irq_count = 0;
1455 atomic_set(&fi->active, 0); 1450 atomic_set(&fi->active, 0);
1456 spin_unlock(&fi->lock); 1451 spin_unlock(&fi->lock);
1457 mutex_unlock(&kvm->lock);
1458} 1452}
1459 1453
1460static inline int copy_irq_to_user(struct kvm_s390_interrupt_info *inti, 1454static inline int copy_irq_to_user(struct kvm_s390_interrupt_info *inti,
@@ -1494,7 +1488,6 @@ static int get_all_floating_irqs(struct kvm *kvm, __u8 *buf, __u64 len)
1494 int ret = 0; 1488 int ret = 0;
1495 int n = 0; 1489 int n = 0;
1496 1490
1497 mutex_lock(&kvm->lock);
1498 fi = &kvm->arch.float_int; 1491 fi = &kvm->arch.float_int;
1499 spin_lock(&fi->lock); 1492 spin_lock(&fi->lock);
1500 1493
@@ -1513,7 +1506,6 @@ static int get_all_floating_irqs(struct kvm *kvm, __u8 *buf, __u64 len)
1513 } 1506 }
1514 1507
1515 spin_unlock(&fi->lock); 1508 spin_unlock(&fi->lock);
1516 mutex_unlock(&kvm->lock);
1517 1509
1518 return ret < 0 ? ret : n; 1510 return ret < 0 ? ret : n;
1519} 1511}