|
@@ -610,20 +610,22 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
|
int r;
|
|
int r;
|
|
|
|
|
|
again:
|
|
again:
|
|
- preempt_disable();
|
|
|
|
- local_irq_disable();
|
|
|
|
-
|
|
|
|
if (signal_pending(current)) {
|
|
if (signal_pending(current)) {
|
|
- local_irq_enable();
|
|
|
|
- preempt_enable();
|
|
|
|
r = -EINTR;
|
|
r = -EINTR;
|
|
kvm_run->exit_reason = KVM_EXIT_INTR;
|
|
kvm_run->exit_reason = KVM_EXIT_INTR;
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * down_read() may sleep and return with interrupts enabled
|
|
|
|
+ */
|
|
|
|
+ down_read(&vcpu->kvm->slots_lock);
|
|
|
|
+
|
|
|
|
+ preempt_disable();
|
|
|
|
+ local_irq_disable();
|
|
|
|
+
|
|
vcpu->guest_mode = 1;
|
|
vcpu->guest_mode = 1;
|
|
kvm_guest_enter();
|
|
kvm_guest_enter();
|
|
- down_read(&vcpu->kvm->slots_lock);
|
|
|
|
r = vti_vcpu_run(vcpu, kvm_run);
|
|
r = vti_vcpu_run(vcpu, kvm_run);
|
|
if (r < 0) {
|
|
if (r < 0) {
|
|
local_irq_enable();
|
|
local_irq_enable();
|