[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201013081139.1558200-6-dwmw2@infradead.org>
Date: Tue, 13 Oct 2020 09:11:35 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: x86@...nel.org
Cc: kvm <kvm@...r.kernel.org>, iommu@...ts.linux-foundation.org,
joro@...tes.org, Thomas Gleixner <tglx@...utronix.de>,
Paolo Bonzini <pbonzini@...hat.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-hyperv@...r.kernel.org, maz@...terjones.org
Subject: [PATCH 5/9] iommu/hyper-v: Implement select() method on remapping irqdomain
From: David Woodhouse <dwmw@...zon.co.uk>
Signed-off-by: David Woodhouse <dwmw@...zon.co.uk>
---
drivers/iommu/hyperv-iommu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c
index 37dd485a5640..6a8966fbc3bd 100644
--- a/drivers/iommu/hyperv-iommu.c
+++ b/drivers/iommu/hyperv-iommu.c
@@ -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,
};
--
2.26.2
Powered by blists - more mailing lists