diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-11-16 16:30:02 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:29:19 -0500 |
commit | 0c106b5aaa727c7f508828e94cff4a98874f930c (patch) | |
tree | 24bcd4ff350c34e86ee76bdcac006d7c96de2719 /virt/kvm | |
parent | 945ee35e0764a834bc5bc5d572085d5b6409902a (diff) |
KVM: Clear assigned guest IRQ on release
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>
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/assigned-dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index 7c98928b09d9..ecc4419fadca 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c | |||
@@ -141,6 +141,9 @@ static void deassign_guest_irq(struct kvm *kvm, | |||
141 | kvm_unregister_irq_ack_notifier(kvm, &assigned_dev->ack_notifier); | 141 | kvm_unregister_irq_ack_notifier(kvm, &assigned_dev->ack_notifier); |
142 | assigned_dev->ack_notifier.gsi = -1; | 142 | assigned_dev->ack_notifier.gsi = -1; |
143 | 143 | ||
144 | kvm_set_irq(assigned_dev->kvm, assigned_dev->irq_source_id, | ||
145 | assigned_dev->guest_irq, 0); | ||
146 | |||
144 | if (assigned_dev->irq_source_id != -1) | 147 | if (assigned_dev->irq_source_id != -1) |
145 | kvm_free_irq_source_id(kvm, assigned_dev->irq_source_id); | 148 | kvm_free_irq_source_id(kvm, assigned_dev->irq_source_id); |
146 | assigned_dev->irq_source_id = -1; | 149 | assigned_dev->irq_source_id = -1; |