Skip to content

Commit

Permalink
KVM: Clear assigned guest IRQ on release
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
jan-kiszka authored and avikivity committed Jan 12, 2011
1 parent 945ee35 commit 0c106b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions virt/kvm/assigned-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0c106b5

Please sign in to comment.