aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/assigned-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/assigned-dev.c')
-rw-r--r--virt/kvm/assigned-dev.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c
index b1e091ae2f37..23a41a9f8db9 100644
--- a/virt/kvm/assigned-dev.c
+++ b/virt/kvm/assigned-dev.c
@@ -334,6 +334,11 @@ static int assigned_device_enable_host_intx(struct kvm *kvm,
334} 334}
335 335
336#ifdef __KVM_HAVE_MSI 336#ifdef __KVM_HAVE_MSI
337static irqreturn_t kvm_assigned_dev_msi(int irq, void *dev_id)
338{
339 return IRQ_WAKE_THREAD;
340}
341
337static int assigned_device_enable_host_msi(struct kvm *kvm, 342static int assigned_device_enable_host_msi(struct kvm *kvm,
338 struct kvm_assigned_dev_kernel *dev) 343 struct kvm_assigned_dev_kernel *dev)
339{ 344{
@@ -346,7 +351,7 @@ static int assigned_device_enable_host_msi(struct kvm *kvm,
346 } 351 }
347 352
348 dev->host_irq = dev->dev->irq; 353 dev->host_irq = dev->dev->irq;
349 if (request_threaded_irq(dev->host_irq, NULL, 354 if (request_threaded_irq(dev->host_irq, kvm_assigned_dev_msi,
350 kvm_assigned_dev_thread_msi, 0, 355 kvm_assigned_dev_thread_msi, 0,
351 dev->irq_name, dev)) { 356 dev->irq_name, dev)) {
352 pci_disable_msi(dev->dev); 357 pci_disable_msi(dev->dev);
@@ -358,6 +363,11 @@ static int assigned_device_enable_host_msi(struct kvm *kvm,
358#endif 363#endif
359 364
360#ifdef __KVM_HAVE_MSIX 365#ifdef __KVM_HAVE_MSIX
366static irqreturn_t kvm_assigned_dev_msix(int irq, void *dev_id)
367{
368 return IRQ_WAKE_THREAD;
369}
370
361static int assigned_device_enable_host_msix(struct kvm *kvm, 371static int assigned_device_enable_host_msix(struct kvm *kvm,
362 struct kvm_assigned_dev_kernel *dev) 372 struct kvm_assigned_dev_kernel *dev)
363{ 373{
@@ -374,7 +384,8 @@ static int assigned_device_enable_host_msix(struct kvm *kvm,
374 384
375 for (i = 0; i < dev->entries_nr; i++) { 385 for (i = 0; i < dev->entries_nr; i++) {
376 r = request_threaded_irq(dev->host_msix_entries[i].vector, 386 r = request_threaded_irq(dev->host_msix_entries[i].vector,
377 NULL, kvm_assigned_dev_thread_msix, 387 kvm_assigned_dev_msix,
388 kvm_assigned_dev_thread_msix,
378 0, dev->irq_name, dev); 389 0, dev->irq_name, dev);
379 if (r) 390 if (r)
380 goto err; 391 goto err;