summaryrefslogtreecommitdiff
path: root/drivers/iommu/hyperv-iommu.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2020-10-24 22:35:26 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-10-28 20:26:28 +0100
commita491bb19f728cdb8cc1f4734ecc57c0afa099fac (patch)
tree8aa32f81805f58a6396dbb49684846fe3f38001c /drivers/iommu/hyperv-iommu.c
parenta87fb465ffe8eacd0d69032da33455e4f6fd8b41 (diff)
iommu/hyper-v: Implement select() method on remapping irqdomain
Preparatory for removing irq_remapping_get_irq_domain() Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201024213535.443185-27-dwmw2@infradead.org
Diffstat (limited to 'drivers/iommu/hyperv-iommu.c')
-rw-r--r--drivers/iommu/hyperv-iommu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c
index 37dd485a5640..78a264ad9405 100644
--- a/drivers/iommu/hyperv-iommu.c
+++ b/drivers/iommu/hyperv-iommu.c
@@ -101,7 +101,16 @@ static void hyperv_irq_remapping_free(struct irq_domain *domain,
irq_domain_free_irqs_common(domain, virq, nr_irqs);
}
+static int hyperv_irq_remapping_select(struct irq_domain *d,
+ struct irq_fwspec *fwspec,
+ enum irq_domain_bus_token bus_token)
+{
+ /* Claim only the first (and only) I/OAPIC */
+ return x86_fwspec_is_ioapic(fwspec) && fwspec->param[0] == 0;
+}
+
static const struct irq_domain_ops hyperv_ir_domain_ops = {
+ .select = hyperv_irq_remapping_select,
.alloc = hyperv_irq_remapping_alloc,
.free = hyperv_irq_remapping_free,
};