From 2dd9ec86121df8dc760cd85953d9c5d6c61ddf01 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Fri, 6 Aug 2021 15:50:28 +0800 Subject: [PATCH] board_inspector: do not use _MAX as the end of a memory region According to the specification, the _MAX of memory address space resource descriptors may not necessarily be _MIN + _LEN - 1. Typically the resource locates at the low end of the region specified by _MIN and _MAX. This patch makes the ACPI extractor always calculating the end of a memory region using _MIN and _LEN instead. Tracked-On: #6287 Signed-off-by: Junjie Mao --- misc/config_tools/board_inspector/extractors/50-acpi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/config_tools/board_inspector/extractors/50-acpi.py b/misc/config_tools/board_inspector/extractors/50-acpi.py index 051fb3b93..df7869239 100644 --- a/misc/config_tools/board_inspector/extractors/50-acpi.py +++ b/misc/config_tools/board_inspector/extractors/50-acpi.py @@ -103,7 +103,7 @@ def parse_address_space_resource(idx, item, elem): typ = "bus_number" else: typ = "custom" - add_child(elem, "resource", id=f"res{idx}", type=typ, min=hex(item._MIN), max=hex(item._MAX), len=hex(item._LEN)) + add_child(elem, "resource", id=f"res{idx}", type=typ, min=hex(item._MIN), max=hex(item._MIN + item._LEN - 1), len=hex(item._LEN)) def parse_extended_irq(idx, item, elem): irqs = ", ".join(map(str, item._INT)) @@ -195,7 +195,7 @@ class CollectDependencyVisitor(Visitor): LARGE_RESOURCE_ITEM_WORD_ADDRESS_SPACE, LARGE_RESOURCE_ITEM_QWORD_ADDRESS_SPACE, LARGE_RESOURCE_ITEM_EXTENDED_ADDRESS_SPACE]: - if item._MIN <= region_base and region_base + region_length - 1 <= item._MAX: + if item._MIN <= region_base and region_base + region_length - 1 <= item._MIN + item._LEN - 1: op_region_is_exposed = True break elif op_region_type == 0x02: # PCI configuration space is always exposed