]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI/IORT: work around num_ids ambiguity
authorArd Biesheuvel <ardb@kernel.org>
Fri, 1 May 2020 16:10:14 +0000 (18:10 +0200)
committerWill Deacon <will@kernel.org>
Mon, 4 May 2020 11:07:41 +0000 (12:07 +0100)
commit40b546193b52f52b7fe7d8fe42782a755d517ba7
treef0b9057cc2206da6cbb8494fd9aac549f2a889d4
parente54ec17ef16415a15d0c9410e247aa46166e91fe
ACPI/IORT: work around num_ids ambiguity

The ID mapping table structure of the IORT table describes the size of
a range using a num_ids field carrying the number of IDs in the region
minus one. This has been misinterpreted in the past in the parsing code,
and firmware is known to have shipped where this results in an ambiguity,
where regions that should be adjacent have an overlap of one value.

So let's work around this by detecting this case specifically: when
resolving an ID translation, allow one that matches right at the end of
a multi-ID region to be superseded by a subsequent one.

To prevent potential regressions on broken firmware that happened to
work before, only take the subsequent match into account if it occurs
at the start of a mapping region.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Link: https://lore.kernel.org/r/20200501161014.5935-3-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
drivers/acpi/arm64/iort.c