[PATCH] mcfg: fix MMIO config space checking

Ivan Hu ivan.hu at canonical.com
Tue Oct 23 10:22:16 UTC 2018


On the newer kernel, string "reserved" from /sys/firmware/memmap/x/type is
changed with capital "R", this causes the mcfg test got the false alarm result:
Low failures: 1
 mcfg: MCFG MMIO config space at 0xe0000000 is not reserved in the memory map table

Modify with checking both "reserved" and "Reserve"

Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
 src/lib/src/fwts_memorymap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
index 26750bd..8c96f9d 100644
--- a/src/lib/src/fwts_memorymap.c
+++ b/src/lib/src/fwts_memorymap.c
@@ -56,7 +56,7 @@ static int fwts_memory_map_str_to_type(const char *str)
 
 	if (strstr(str, "System RAM"))
 		return FWTS_MEMORY_MAP_USABLE;
-	if (strstr(str, "reserved"))
+	if (strstr(str, "reserved") || strstr(str, "Reserved"))
 		return FWTS_MEMORY_MAP_RESERVED;
 	if (strstr(str, "ACPI Non-volatile Storage"))
 		return FWTS_MEMORY_MAP_ACPI;
@@ -81,7 +81,7 @@ static char *fwts_memory_map_type_to_str(const int type)
 {
 	switch (type) {
 	case FWTS_MEMORY_MAP_RESERVED:
-		return "(reserved)";
+		return "(Reserved)";
 	case FWTS_MEMORY_MAP_ACPI:
 		return "(ACPI Non-volatile Storage)";
 	case FWTS_MEMORY_MAP_USABLE:
-- 
2.7.4




More information about the fwts-devel mailing list