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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to