Date: Sat, 22 Aug 2020 14:39:14 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364484 - head/sys/arm64/acpica Message-ID: <202008221439.07MEdEqJ000249@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Sat Aug 22 14:39:14 2020 New Revision: 364484 URL: https://svnweb.freebsd.org/changeset/base/364484 Log: acpi_iort: fix mapping end calculation According to the ARM Design Document "IO Remapping Table Platform" (DEN 0049D), the "Number of IDs" field of the ID mapping format means "The number of IDs in the range minus one". Submitted by: Greg V <greg@unrelenting.technology> Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D25179 Modified: head/sys/arm64/acpica/acpi_iort.c Modified: head/sys/arm64/acpica/acpi_iort.c ============================================================================== --- head/sys/arm64/acpica/acpi_iort.c Sat Aug 22 14:24:17 2020 (r364483) +++ head/sys/arm64/acpica/acpi_iort.c Sat Aug 22 14:39:14 2020 (r364484) @@ -234,7 +234,11 @@ iort_copy_data(struct iort_node *node, ACPI_IORT_NODE node->entries.mappings = mapping; for (i = 0; i < node->nentries; i++, mapping++, map_entry++) { mapping->base = map_entry->InputBase; - mapping->end = map_entry->InputBase + map_entry->IdCount - 1; + /* + * IdCount means "The number of IDs in the range minus one" (ARM DEN 0049D). + * We use <= for comparison against this field, so don't add one here. + */ + mapping->end = map_entry->InputBase + map_entry->IdCount; mapping->outbase = map_entry->OutputBase; mapping->out_node_offset = map_entry->OutputReference; mapping->flags = map_entry->Flags;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008221439.07MEdEqJ000249>