diff options
-rw-r--r-- | arch/x86/kvm/i8259.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index bc10f0bd3819..819b748a33f9 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c | |||
@@ -46,16 +46,25 @@ static void pic_unlock(struct kvm_pic *s) | |||
46 | __releases(&s->lock) | 46 | __releases(&s->lock) |
47 | { | 47 | { |
48 | bool wakeup = s->wakeup_needed; | 48 | bool wakeup = s->wakeup_needed; |
49 | struct kvm_vcpu *vcpu; | 49 | struct kvm_vcpu *vcpu, *found = NULL; |
50 | int i; | ||
50 | 51 | ||
51 | s->wakeup_needed = false; | 52 | s->wakeup_needed = false; |
52 | 53 | ||
53 | raw_spin_unlock(&s->lock); | 54 | raw_spin_unlock(&s->lock); |
54 | 55 | ||
55 | if (wakeup) { | 56 | if (wakeup) { |
56 | vcpu = s->kvm->bsp_vcpu; | 57 | kvm_for_each_vcpu(i, vcpu, s->kvm) { |
57 | if (vcpu) | 58 | if (kvm_apic_accept_pic_intr(vcpu)) { |
58 | kvm_vcpu_kick(vcpu); | 59 | found = vcpu; |
60 | break; | ||
61 | } | ||
62 | } | ||
63 | |||
64 | if (!found) | ||
65 | found = s->kvm->bsp_vcpu; | ||
66 | |||
67 | kvm_vcpu_kick(found); | ||
59 | } | 68 | } |
60 | } | 69 | } |
61 | 70 | ||