diff options
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/irq.h | 2 | ||||
-rw-r--r-- | drivers/kvm/kvm_main.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h index 4034f6576cd9..30adddcb182d 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h @@ -61,7 +61,7 @@ int kvm_cpu_get_interrupt(struct kvm_vcpu *v); int kvm_cpu_has_interrupt(struct kvm_vcpu *v); void kvm_pic_update_irq(struct kvm_pic *s); -#define IOAPIC_NUM_PINS 24 +#define IOAPIC_NUM_PINS KVM_IOAPIC_NUM_PINS #define IOAPIC_VERSION_ID 0x11 /* IOAPIC version */ #define IOAPIC_EDGE_TRIG 0 #define IOAPIC_LEVEL_TRIG 1 diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index c270e4afd3fd..61dff55f137e 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -913,6 +913,11 @@ static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip) &pic_irqchip(kvm)->pics[1], sizeof(struct kvm_pic_state)); break; + case KVM_IRQCHIP_IOAPIC: + memcpy (&chip->chip.ioapic, + ioapic_irqchip(kvm), + sizeof(struct kvm_ioapic_state)); + break; default: r = -EINVAL; break; @@ -936,6 +941,11 @@ static int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip) &chip->chip.pic, sizeof(struct kvm_pic_state)); break; + case KVM_IRQCHIP_IOAPIC: + memcpy (ioapic_irqchip(kvm), + &chip->chip.ioapic, + sizeof(struct kvm_ioapic_state)); + break; default: r = -EINVAL; break; |