From baca640c15ba51d502a6f731bb10a1e67045d6d2 Mon Sep 17 00:00:00 2001 From: jmatthew Date: Thu, 24 Nov 2022 04:04:39 +0000 Subject: [PATCH] Don't report unknown apic structure types if they're in the OEM reserved 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 | 9 ++++++--- sys/dev/acpi/acpireg.h | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c index 9d09935a4d3..3faed32b355 100644 --- a/sys/dev/acpi/acpimadt.c +++ b/sys/dev/acpi/acpimadt.c @@ -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 * @@ -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; diff --git a/sys/dev/acpi/acpireg.h b/sys/dev/acpi/acpireg.h index 37357a265f9..4f743773bc9 100644 --- a/sys/dev/acpi/acpireg.h +++ b/sys/dev/acpi/acpireg.h @@ -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 * Copyright (c) 2005 Marco Peereboom @@ -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; -- 2.20.1