Skip to content

Commit

Permalink
KVM: Call kvm_vcpu_kick() inside pic spinlock
Browse files Browse the repository at this point in the history
d5ecfdd25 moved it out because back than it was impossible to
call it inside spinlock. This restriction no longer exists.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Gleb Natapov authored and Avi Kivity committed Sep 10, 2009
1 parent 3a34a88 commit 956f97c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 1 addition & 9 deletions arch/x86/kvm/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ static void pic_unlock(struct kvm_pic *s)
{
struct kvm *kvm = s->kvm;
unsigned acks = s->pending_acks;
bool wakeup = s->wakeup_needed;
struct kvm_vcpu *vcpu;

s->pending_acks = 0;
s->wakeup_needed = false;

spin_unlock(&s->lock);

Expand All @@ -56,12 +54,6 @@ static void pic_unlock(struct kvm_pic *s)
__ffs(acks));
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)
Expand Down Expand Up @@ -527,7 +519,7 @@ static void pic_irq_request(void *opaque, int level)
s->output = level;
if (vcpu && level && (s->pics[0].isr_ack & (1 << irq))) {
s->pics[0].isr_ack &= ~(1 << irq);
s->wakeup_needed = true;
kvm_vcpu_kick(vcpu);
}
}

Expand Down
1 change: 0 additions & 1 deletion arch/x86/kvm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ struct kvm_kpic_state {

struct kvm_pic {
spinlock_t lock;
bool wakeup_needed;
unsigned pending_acks;
struct kvm *kvm;
struct kvm_kpic_state pics[2]; /* 0 is master pic, 1 is slave pic */
Expand Down

0 comments on commit 956f97c

Please sign in to comment.