aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-04-21 10:45:10 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:48 -0400
commit16d7a191170f0ca48c2c3277017b3e6d275e0711 (patch)
tree7ab5bdbe409e8c2f12de7b1064a0918804e8bc93 /arch/x86/kvm/x86.c
parent95ba82731374eb1c2af4dd442526c4b314f0e8b6 (diff)
KVM: Fix userspace IRQ chip migration
Re-put pending IRQ vector into interrupt_bitmap before migration. Otherwise it will be lost if migration happens in the wrong time. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 96e995c1dd76..63917216a051 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3566,17 +3566,17 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
3566 sregs->efer = vcpu->arch.shadow_efer; 3566 sregs->efer = vcpu->arch.shadow_efer;
3567 sregs->apic_base = kvm_get_apic_base(vcpu); 3567 sregs->apic_base = kvm_get_apic_base(vcpu);
3568 3568
3569 if (irqchip_in_kernel(vcpu->kvm)) { 3569 if (irqchip_in_kernel(vcpu->kvm))
3570 memset(sregs->interrupt_bitmap, 0, 3570 memset(sregs->interrupt_bitmap, 0,
3571 sizeof sregs->interrupt_bitmap); 3571 sizeof sregs->interrupt_bitmap);
3572 pending_vec = kvm_x86_ops->get_irq(vcpu); 3572 else
3573 if (pending_vec >= 0)
3574 set_bit(pending_vec,
3575 (unsigned long *)sregs->interrupt_bitmap);
3576 } else
3577 memcpy(sregs->interrupt_bitmap, vcpu->arch.irq_pending, 3573 memcpy(sregs->interrupt_bitmap, vcpu->arch.irq_pending,
3578 sizeof sregs->interrupt_bitmap); 3574 sizeof sregs->interrupt_bitmap);
3579 3575
3576 pending_vec = kvm_x86_ops->get_irq(vcpu);
3577 if (pending_vec >= 0)
3578 set_bit(pending_vec, (unsigned long *)sregs->interrupt_bitmap);
3579
3580 vcpu_put(vcpu); 3580 vcpu_put(vcpu);
3581 3581
3582 return 0; 3582 return 0;