[PATCH] x86/of: Don't log error on the missing IO-APIC unconditionally

From: Roman Kisel
Date: Thu Jan 09 2025 - 13:41:22 EST


The x86 OF code reports the missing IO-APIC wihtout any
checks whether the IO-APIC presence is required or not.
That is due to that part of the code being dovetailed to
the Intel MID platform.

Check if the IO-APIC must be available. Log the error only
when the IO-APIC is expected to be present.

Signed-off-by: Roman Kisel <romank@xxxxxxxxxxxxxxxxxxx>
---
arch/x86/kernel/devicetree.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 59d23cdf4ed0..5b3b47930d1c 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -47,6 +47,15 @@ static struct of_device_id __initdata ce4100_ids[] = {
{},
};

+static bool falconfalls_compatible(void)
+{
+ if (!of_have_populated_dt())
+ return false;
+
+ return of_flat_dt_is_compatible(
+ of_get_flat_dt_root(), "intel,falconfalls");
+}
+
static int __init add_bus_probe(void)
{
if (!of_have_populated_dt())
@@ -259,12 +268,20 @@ static void __init dtb_ioapic_setup(void)

for_each_compatible_node(dn, NULL, "intel,ce4100-ioapic")
dtb_add_ioapic(dn);
+ if (!nr_ioapics && falconfalls_compatible())
+ pr_err("Error: No information about IO-APIC in OF.\n");

- if (nr_ioapics) {
+ if (nr_ioapics)
of_ioapic = 1;
- return;
- }
- pr_err("Error: No information about IO-APIC in OF.\n");
+
+ /*
+ * At this point, it might so happen that no IO-APIC has been discovered.
+ *
+ * A general assumption would be that most x86 boards have IO-APIC,
+ * yet that is not something the kernel should report as a firmware
+ * bug unconditionally as there are setups (VMs would be an easy example)
+ * that are able to employ other means of interrupt routing.
+ */
}
#else
static void __init dtb_ioapic_setup(void) {}

base-commit: eea6e4b4dfb8859446177c32961c96726d0117be
--
2.34.1