Skip non-MSI interrupt controllers when looking for one matching the ITS id
authorjmatthew <jmatthew@openbsd.org>
Sat, 16 Sep 2023 23:25:16 +0000 (23:25 +0000)
committerjmatthew <jmatthew@openbsd.org>
Sat, 16 Sep 2023 23:25:16 +0000 (23:25 +0000)
given in the IORT node.  Using a non-MSI interrupt controller here will
crash as ic->ic_establish_msi will be NULL.

tested by phessler@
ok phessler@ patrick@

sys/arch/arm64/dev/acpipci.c

index 937b2c5..dc2cba6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: acpipci.c,v 1.40 2023/09/12 08:32:58 jmatthew Exp $   */
+/*     $OpenBSD: acpipci.c,v 1.41 2023/09/16 23:25:16 jmatthew Exp $   */
 /*
  * Copyright (c) 2018 Mark Kettenis
  *
@@ -844,7 +844,8 @@ acpipci_iort_map(struct acpi_iort *iort, uint32_t offset, uint32_t id,
                itsn = (struct acpi_iort_its_node *)&node[1];
                LIST_FOREACH(icl, &interrupt_controllers, ic_list) {
                        for (i = 0; i < itsn->number_of_itss; i++) {
-                               if (icl->ic_gic_its_id == itsn->its_ids[i]) {
+                               if (icl->ic_establish_msi != NULL &&
+                                   icl->ic_gic_its_id == itsn->its_ids[i]) {
                                        *ic = icl;
                                        break;
                                }