Don't report unknown apic structure types if they're in the OEM reserved
authorjmatthew <jmatthew@openbsd.org>
Thu, 24 Nov 2022 04:04:39 +0000 (04:04 +0000)
committerjmatthew <jmatthew@openbsd.org>
Thu, 24 Nov 2022 04:04:39 +0000 (04:04 +0000)
range (0x80 to 0xff).  We're not going to understand OEM specific
structures, and some machines such as the Dell R6515 have significant
numbers of them.

ok kettenis@

sys/dev/acpi/acpimadt.c
sys/dev/acpi/acpireg.h

index 9d09935..3faed32 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpimadt.c,v 1.38 2022/04/06 18:59:27 naddy Exp $ */
+/* $OpenBSD: acpimadt.c,v 1.39 2022/11/24 04:04:39 jmatthew Exp $ */
 /*
  * Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
  *
@@ -418,8 +418,11 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
                        break;
 
                default:
-                       printf("%s: unknown apic structure type %x\n",
-                           self->dv_xname, entry->madt_lapic.apic_type);
+                       if (entry->madt_lapic.apic_type < ACPI_MADT_OEM_RSVD) {
+                               printf("%s: unknown apic structure type %x\n",
+                                   self->dv_xname,
+                                   entry->madt_lapic.apic_type);
+                       }
                }
 
                addr += entry->madt_lapic.length;
index 37357a2..4f74377 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: acpireg.h,v 1.58 2022/01/09 05:42:37 jsg Exp $        */
+/*     $OpenBSD: acpireg.h,v 1.59 2022/11/24 04:04:39 jmatthew Exp $   */
 /*
  * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
  * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
@@ -352,6 +352,8 @@ struct acpi_madt_x2apic_nmi {
        uint8_t         reserved[3];
 } __packed;
 
+#define ACPI_MADT_OEM_RSVD     128
+
 union acpi_madt_entry {
        struct acpi_madt_lapic          madt_lapic;
        struct acpi_madt_ioapic         madt_ioapic;