mirror of
https://github.com/adulau/aha.git
synced 2025-01-03 22:53:18 +00:00
KVM: check injected pic irq within valid pic irqs
Check that an injected pic irq is between 0 and 15. Signed-off-by: Ben-Ami Yassour <benami@il.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
parent
19fdfa0d13
commit
c65bbfa1d6
2 changed files with 6 additions and 2 deletions
|
@ -130,8 +130,10 @@ void kvm_pic_set_irq(void *opaque, int irq, int level)
|
||||||
{
|
{
|
||||||
struct kvm_pic *s = opaque;
|
struct kvm_pic *s = opaque;
|
||||||
|
|
||||||
pic_set_irq1(&s->pics[irq >> 3], irq & 7, level);
|
if (irq >= 0 && irq < PIC_NUM_PINS) {
|
||||||
pic_update_irq(s);
|
pic_set_irq1(&s->pics[irq >> 3], irq & 7, level);
|
||||||
|
pic_update_irq(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "ioapic.h"
|
#include "ioapic.h"
|
||||||
#include "lapic.h"
|
#include "lapic.h"
|
||||||
|
|
||||||
|
#define PIC_NUM_PINS 16
|
||||||
|
|
||||||
struct kvm;
|
struct kvm;
|
||||||
struct kvm_vcpu;
|
struct kvm_vcpu;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue