]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
iommu/hyper-v: Implement select() method on remapping irqdomain
authorDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 12 Oct 2020 15:46:18 +0000 (16:46 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 23 Oct 2020 16:56:05 +0000 (17:56 +0100)
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
drivers/iommu/hyperv-iommu.c

index 3a674262cc915ce54fdb2f656ce0cb4b61e990cd..9e5f36e5e94df59e08b660391fac651464dc3af8 100644 (file)
@@ -61,6 +61,14 @@ static struct irq_chip hyperv_ir_chip = {
        .irq_set_affinity       = hyperv_ir_set_affinity,
 };
 
+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 int hyperv_irq_remapping_alloc(struct irq_domain *domain,
                                     unsigned int virq, unsigned int nr_irqs,
                                     void *arg)
@@ -102,6 +110,7 @@ static void hyperv_irq_remapping_free(struct irq_domain *domain,
 }
 
 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,
 };