diff options
Diffstat (limited to 'arch/ia64/kvm')
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index d0ad538f0083..d5e384641275 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -636,12 +636,9 @@ static void kvm_vcpu_post_transition(struct kvm_vcpu *vcpu) | |||
636 | static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | 636 | static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) |
637 | { | 637 | { |
638 | union context *host_ctx, *guest_ctx; | 638 | union context *host_ctx, *guest_ctx; |
639 | int r; | 639 | int r, idx; |
640 | 640 | ||
641 | /* | 641 | idx = srcu_read_lock(&vcpu->kvm->srcu); |
642 | * down_read() may sleep and return with interrupts enabled | ||
643 | */ | ||
644 | down_read(&vcpu->kvm->slots_lock); | ||
645 | 642 | ||
646 | again: | 643 | again: |
647 | if (signal_pending(current)) { | 644 | if (signal_pending(current)) { |
@@ -663,7 +660,7 @@ again: | |||
663 | if (r < 0) | 660 | if (r < 0) |
664 | goto vcpu_run_fail; | 661 | goto vcpu_run_fail; |
665 | 662 | ||
666 | up_read(&vcpu->kvm->slots_lock); | 663 | srcu_read_unlock(&vcpu->kvm->srcu, idx); |
667 | kvm_guest_enter(); | 664 | kvm_guest_enter(); |
668 | 665 | ||
669 | /* | 666 | /* |
@@ -687,7 +684,7 @@ again: | |||
687 | kvm_guest_exit(); | 684 | kvm_guest_exit(); |
688 | preempt_enable(); | 685 | preempt_enable(); |
689 | 686 | ||
690 | down_read(&vcpu->kvm->slots_lock); | 687 | idx = srcu_read_lock(&vcpu->kvm->srcu); |
691 | 688 | ||
692 | r = kvm_handle_exit(kvm_run, vcpu); | 689 | r = kvm_handle_exit(kvm_run, vcpu); |
693 | 690 | ||
@@ -697,10 +694,10 @@ again: | |||
697 | } | 694 | } |
698 | 695 | ||
699 | out: | 696 | out: |
700 | up_read(&vcpu->kvm->slots_lock); | 697 | srcu_read_unlock(&vcpu->kvm->srcu, idx); |
701 | if (r > 0) { | 698 | if (r > 0) { |
702 | kvm_resched(vcpu); | 699 | kvm_resched(vcpu); |
703 | down_read(&vcpu->kvm->slots_lock); | 700 | idx = srcu_read_lock(&vcpu->kvm->srcu); |
704 | goto again; | 701 | goto again; |
705 | } | 702 | } |
706 | 703 | ||