x86/apic/msi: Use DOMAIN_BUS_GENERIC_MSI for HPET/IO-APIC domain search
authorThomas Gleixner <tglx@linutronix.de>
Sun, 25 Feb 2024 15:56:12 +0000 (16:56 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 25 Feb 2024 17:53:08 +0000 (18:53 +0100)
The recent restriction to invoke irqdomain_ops::select() only when the
domain bus token is not DOMAIN_BUS_ANY breaks the search for the parent MSI
domain of HPET and IO-APIC. The latter causes a full boot fail.

The restriction itself makes sense to avoid adding DOMAIN_BUS_ANY matches
into the various ARM specific select() callbacks. Reverting this change
would obviously break ARM platforms again and require DOMAIN_BUS_ANY
matches added to various places.

A simpler solution is to use the DOMAIN_BUS_GENERIC_MSI token for the HPET
and IO-APIC parent domain search. This works out of the box because the
affected parent domains check only for the firmware specification content
and not for the bus token.

Fixes: 5aa3c0cf5bba ("genirq/irqdomain: Don't call ops->select for DOMAIN_BUS_ANY tokens")
Reported-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/878r38cy8n.ffs@tglx
arch/x86/kernel/apic/io_apic.c
arch/x86/kernel/hpet.c

index 40c7cf180c2031d1b8fbe357aca6c464004fa0bf..e66c77529ca9dbc2ec5f5436441edebbb2c8b084 100644 (file)
@@ -2354,7 +2354,7 @@ static int mp_irqdomain_create(int ioapic)
        fwspec.param_count = 1;
        fwspec.param[0] = mpc_ioapic_id(ioapic);
 
-       parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY);
+       parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_GENERIC_MSI);
        if (!parent) {
                if (!cfg->dev)
                        irq_domain_free_fwnode(fn);
index a38d0c93a66e825a38987a65fdd09ad97bbae2ec..c96ae8fee95e443b262c1083fe0a9f96e4e6a67c 100644 (file)
@@ -568,7 +568,7 @@ static struct irq_domain *hpet_create_irq_domain(int hpet_id)
        fwspec.param_count = 1;
        fwspec.param[0] = hpet_id;
 
-       parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY);
+       parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_GENERIC_MSI);
        if (!parent) {
                irq_domain_free_fwnode(fn);
                kfree(domain_info);