Commit 956f97cf authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

KVM: Call kvm_vcpu_kick() inside pic spinlock

d5ecfdd25 moved it out because back than it was impossible to
call it inside spinlock. This restriction no longer exists.
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 3a34a881
...@@ -43,11 +43,9 @@ static void pic_unlock(struct kvm_pic *s) ...@@ -43,11 +43,9 @@ static void pic_unlock(struct kvm_pic *s)
{ {
struct kvm *kvm = s->kvm; struct kvm *kvm = s->kvm;
unsigned acks = s->pending_acks; unsigned acks = s->pending_acks;
bool wakeup = s->wakeup_needed;
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
s->pending_acks = 0; s->pending_acks = 0;
s->wakeup_needed = false;
spin_unlock(&s->lock); spin_unlock(&s->lock);
...@@ -56,12 +54,6 @@ static void pic_unlock(struct kvm_pic *s) ...@@ -56,12 +54,6 @@ static void pic_unlock(struct kvm_pic *s)
__ffs(acks)); __ffs(acks));
acks &= acks - 1; acks &= acks - 1;
} }
if (wakeup) {
vcpu = s->kvm->bsp_vcpu;
if (vcpu)
kvm_vcpu_kick(vcpu);
}
} }
static void pic_clear_isr(struct kvm_kpic_state *s, int irq) static void pic_clear_isr(struct kvm_kpic_state *s, int irq)
...@@ -527,7 +519,7 @@ static void pic_irq_request(void *opaque, int level) ...@@ -527,7 +519,7 @@ static void pic_irq_request(void *opaque, int level)
s->output = level; s->output = level;
if (vcpu && level && (s->pics[0].isr_ack & (1 << irq))) { if (vcpu && level && (s->pics[0].isr_ack & (1 << irq))) {
s->pics[0].isr_ack &= ~(1 << irq); s->pics[0].isr_ack &= ~(1 << irq);
s->wakeup_needed = true; kvm_vcpu_kick(vcpu);
} }
} }
......
...@@ -63,7 +63,6 @@ struct kvm_kpic_state { ...@@ -63,7 +63,6 @@ struct kvm_kpic_state {
struct kvm_pic { struct kvm_pic {
spinlock_t lock; spinlock_t lock;
bool wakeup_needed;
unsigned pending_acks; unsigned pending_acks;
struct kvm *kvm; struct kvm *kvm;
struct kvm_kpic_state pics[2]; /* 0 is master pic, 1 is slave pic */ struct kvm_kpic_state pics[2]; /* 0 is master pic, 1 is slave pic */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment