diff options
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 187aa8d984a7..e0fb0988a3fe 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -1392,6 +1392,18 @@ static long kvm_vcpu_ioctl(struct file *filp, | |||
1392 | 1392 | ||
1393 | if (vcpu->kvm->mm != current->mm) | 1393 | if (vcpu->kvm->mm != current->mm) |
1394 | return -EIO; | 1394 | return -EIO; |
1395 | |||
1396 | #if defined(CONFIG_S390) || defined(CONFIG_PPC) | ||
1397 | /* | ||
1398 | * Special cases: vcpu ioctls that are asynchronous to vcpu execution, | ||
1399 | * so vcpu_load() would break it. | ||
1400 | */ | ||
1401 | if (ioctl == KVM_S390_INTERRUPT || ioctl == KVM_INTERRUPT) | ||
1402 | return kvm_arch_vcpu_ioctl(filp, ioctl, arg); | ||
1403 | #endif | ||
1404 | |||
1405 | |||
1406 | vcpu_load(vcpu); | ||
1395 | switch (ioctl) { | 1407 | switch (ioctl) { |
1396 | case KVM_RUN: | 1408 | case KVM_RUN: |
1397 | r = -EINVAL; | 1409 | r = -EINVAL; |
@@ -1566,9 +1578,12 @@ out_free2: | |||
1566 | break; | 1578 | break; |
1567 | } | 1579 | } |
1568 | default: | 1580 | default: |
1581 | vcpu_put(vcpu); | ||
1569 | r = kvm_arch_vcpu_ioctl(filp, ioctl, arg); | 1582 | r = kvm_arch_vcpu_ioctl(filp, ioctl, arg); |
1583 | vcpu_load(vcpu); | ||
1570 | } | 1584 | } |
1571 | out: | 1585 | out: |
1586 | vcpu_put(vcpu); | ||
1572 | kfree(fpu); | 1587 | kfree(fpu); |
1573 | kfree(kvm_sregs); | 1588 | kfree(kvm_sregs); |
1574 | return r; | 1589 | return r; |