KVM: Clear assigned guest IRQ on release
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 16 Nov 2010 21:30:02 +0000 (22:30 +0100)
committerAvi Kivity <avi@redhat.com>
Wed, 12 Jan 2011 09:29:19 +0000 (11:29 +0200)
When we deassign a guest IRQ, clear the potentially asserted guest line.
There might be no chance for the guest to do this, specifically if we
switch from INTx to MSI mode.

Acked-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
virt/kvm/assigned-dev.c

index 7c98928b09d92a9b7930bb84c9f291bfe569870d..ecc4419fadca2f92a37b3e9e3ee4d2acde687479 100644 (file)
@@ -141,6 +141,9 @@ static void deassign_guest_irq(struct kvm *kvm,
        kvm_unregister_irq_ack_notifier(kvm, &assigned_dev->ack_notifier);
        assigned_dev->ack_notifier.gsi = -1;
 
+       kvm_set_irq(assigned_dev->kvm, assigned_dev->irq_source_id,
+                   assigned_dev->guest_irq, 0);
+
        if (assigned_dev->irq_source_id != -1)
                kvm_free_irq_source_id(kvm, assigned_dev->irq_source_id);
        assigned_dev->irq_source_id = -1;