From: Matthew Dillon Date: Mon, 11 Jun 2018 20:21:53 +0000 (-0700) Subject: kernel - Improve ACPI compatibility with older BIOSes X-Git-Tag: v5.5.0~505 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/dd62cb1009be64311a6460315301e1a6f3a88e04 kernel - Improve ACPI compatibility with older BIOSes * ACPI alignment field in ACPI resources can sometimes be 0, leading to passing 0 for 'align' to acpi_res_set_iorange() which panics the box with a division-by-zero fault. * Relax handling of this argument by setting it to 1 if it is found to be 0. * Fixes DFly panics with certain older BIOSes. Reported-by: myu --- diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index e689932448..6730524f7c 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -527,6 +527,8 @@ acpi_res_set_iorange(device_t dev, void *context, uint64_t low, if (cp == NULL) return; + if (align == 0) /* broken acpi resources might pass align == 0 */ + align = 1; base = roundup(low, align); if (base + length - 1 <= high) {