Skip to content

Commit

Permalink
iommu/hyper-v: Remove I/O-APIC ID check from hyperv_irq_remapping_sel…
Browse files Browse the repository at this point in the history
…ect()

commit a491bb1 ("iommu/hyper-v: Implement select() method on remapping
irqdomain") restricted the irq_domain_ops::select() callback to match on
I/O-APIC index 0, which was correct until the parameter was changed to
carry the I/O APIC ID in commit f36a74b.

If the ID is not 0 then the match fails. Therefore I/O-APIC init fails to
retrieve the parent irqdomain for the I/O-APIC resulting in a boot panic:

    kernel BUG at arch/x86/kernel/apic/io_apic.c:2408!

Fix it by matching the I/O-APIC independent of the ID as there is only one
I/O APIC emulated by Hyper-V.

[ tglx: Amended changelog ]

Fixes: f36a74b ("x86/ioapic: Use I/O-APIC ID for finding irqdomain, not index")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Link: https://lore.kernel.org/r/20201202004510.1818-1-decui@microsoft.com
  • Loading branch information
Dexuan Cui authored and Thomas Gleixner committed Dec 2, 2020
1 parent d1adcfb commit 26ab12b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iommu/hyperv-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ 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;
/* Claim the only I/O APIC emulated by Hyper-V */
return x86_fwspec_is_ioapic(fwspec);
}

static const struct irq_domain_ops hyperv_ir_domain_ops = {
Expand Down

0 comments on commit 26ab12b

Please sign in to comment.