aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/kvm_host.h3
-rw-r--r--virt/kvm/irq_comm.c8
-rw-r--r--virt/kvm/kvm_main.c2
3 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index bb92be2153bc..3a0fb77d1f6a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -316,8 +316,7 @@ void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
316void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); 316void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi);
317void kvm_register_irq_ack_notifier(struct kvm *kvm, 317void kvm_register_irq_ack_notifier(struct kvm *kvm,
318 struct kvm_irq_ack_notifier *kian); 318 struct kvm_irq_ack_notifier *kian);
319void kvm_unregister_irq_ack_notifier(struct kvm *kvm, 319void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian);
320 struct kvm_irq_ack_notifier *kian);
321int kvm_request_irq_source_id(struct kvm *kvm); 320int kvm_request_irq_source_id(struct kvm *kvm);
322void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); 321void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
323 322
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index 55ad76ee2d09..9fbbdea3d1d5 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -58,12 +58,16 @@ void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi)
58void kvm_register_irq_ack_notifier(struct kvm *kvm, 58void kvm_register_irq_ack_notifier(struct kvm *kvm,
59 struct kvm_irq_ack_notifier *kian) 59 struct kvm_irq_ack_notifier *kian)
60{ 60{
61 /* Must be called with in-kernel IRQ chip, otherwise it's nonsense */
62 ASSERT(irqchip_in_kernel(kvm));
63 ASSERT(kian);
61 hlist_add_head(&kian->link, &kvm->arch.irq_ack_notifier_list); 64 hlist_add_head(&kian->link, &kvm->arch.irq_ack_notifier_list);
62} 65}
63 66
64void kvm_unregister_irq_ack_notifier(struct kvm *kvm, 67void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian)
65 struct kvm_irq_ack_notifier *kian)
66{ 68{
69 if (!kian)
70 return;
67 hlist_del(&kian->link); 71 hlist_del(&kian->link);
68} 72}
69 73
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index a87f45edfae8..4f43abe198e4 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -143,7 +143,7 @@ static void kvm_free_assigned_device(struct kvm *kvm,
143 if (irqchip_in_kernel(kvm) && assigned_dev->irq_requested) 143 if (irqchip_in_kernel(kvm) && assigned_dev->irq_requested)
144 free_irq(assigned_dev->host_irq, (void *)assigned_dev); 144 free_irq(assigned_dev->host_irq, (void *)assigned_dev);
145 145
146 kvm_unregister_irq_ack_notifier(kvm, &assigned_dev->ack_notifier); 146 kvm_unregister_irq_ack_notifier(&assigned_dev->ack_notifier);
147 kvm_free_irq_source_id(kvm, assigned_dev->irq_source_id); 147 kvm_free_irq_source_id(kvm, assigned_dev->irq_source_id);
148 148
149 if (cancel_work_sync(&assigned_dev->interrupt_work)) 149 if (cancel_work_sync(&assigned_dev->interrupt_work))