Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356783
b: refs/heads/master
c: f3200d0
h: refs/heads/master
i:
  356781: 3416044
  356779: 71e0341
  356775: 7e2109a
  356767: cabfdb0
v: v3
  • Loading branch information
Gleb Natapov authored and Marcelo Tosatti committed Dec 14, 2012
1 parent d93fe80 commit 3df1df6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e2c688351f4aee9981918661b6c1679f4155f06
refs/heads/master: f3200d00ea42e485772ff92d6d649aa8eeb640c0
2 changes: 2 additions & 0 deletions trunk/arch/x86/kvm/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ int kvm_pic_read_irq(struct kvm *kvm)
int irq, irq2, intno;
struct kvm_pic *s = pic_irqchip(kvm);

s->output = 0;

pic_lock(s);
irq = pic_get_irq(&s->pics[0]);
if (irq >= 0) {
Expand Down
26 changes: 8 additions & 18 deletions trunk/arch/x86/kvm/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *v)
if (!irqchip_in_kernel(v->kvm))
return v->arch.interrupt.pending;

if (kvm_apic_has_interrupt(v) == -1) { /* LAPIC */
if (kvm_apic_accept_pic_intr(v)) {
s = pic_irqchip(v->kvm); /* PIC */
return s->output;
} else
return 0;
}
return 1;
if (kvm_apic_accept_pic_intr(v) && pic_irqchip(v->kvm)->output)
return pic_irqchip(v->kvm)->output; /* PIC */

return kvm_apic_has_interrupt(v) != -1; /* LAPIC */
}
EXPORT_SYMBOL_GPL(kvm_cpu_has_interrupt);

Expand All @@ -65,20 +61,14 @@ EXPORT_SYMBOL_GPL(kvm_cpu_has_interrupt);
int kvm_cpu_get_interrupt(struct kvm_vcpu *v)
{
struct kvm_pic *s;
int vector;

if (!irqchip_in_kernel(v->kvm))
return v->arch.interrupt.nr;

vector = kvm_get_apic_interrupt(v); /* APIC */
if (vector == -1) {
if (kvm_apic_accept_pic_intr(v)) {
s = pic_irqchip(v->kvm);
s->output = 0; /* PIC */
vector = kvm_pic_read_irq(v->kvm);
}
}
return vector;
if (kvm_apic_accept_pic_intr(v) && pic_irqchip(v->kvm)->output)
return kvm_pic_read_irq(v->kvm); /* PIC */

return kvm_get_apic_interrupt(v); /* APIC */
}
EXPORT_SYMBOL_GPL(kvm_cpu_get_interrupt);

Expand Down

0 comments on commit 3df1df6

Please sign in to comment.