From patchwork Fri Feb 8 03:23:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1038465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43wgWX73Rgz9sBZ; Fri, 8 Feb 2019 14:23:52 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1grwla-0004Y0-D3; Fri, 08 Feb 2019 03:23:50 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1grwlT-0004VS-9N for fwts-devel@lists.ubuntu.com; Fri, 08 Feb 2019 03:23:43 +0000 Received: from 1.general.alexhung.us.vpn ([10.172.65.254] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1grwlS-0003fv-LZ; Fri, 08 Feb 2019 03:23:43 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 09/14] acpi/hmat: update for hmat revision 2 (mantis 1914 for ACPI 6.3) Date: Thu, 7 Feb 2019 19:23:09 -0800 Message-Id: <20190208032314.15215-10-alex.hung@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190208032314.15215-1-alex.hung@canonical.com> References: <20190208032314.15215-1-alex.hung@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" According to discussion in ASWG, revision 1 is not in field due to its lacks of usability. That's also the reason for major changes in HMAT in ACPI spec. As a result, fwts also depreciates revision 1 completely. Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/acpi/hmat/hmat.c | 31 ++++++++++++++++++++----------- src/lib/include/fwts_acpi.h | 10 +++++----- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/acpi/hmat/hmat.c b/src/acpi/hmat/hmat.c index fa70c186..758bb59c 100644 --- a/src/acpi/hmat/hmat.c +++ b/src/acpi/hmat/hmat.c @@ -39,24 +39,26 @@ static int hmat_init(fwts_framework *fw) return FWTS_OK; } -static void hmat_addr_range_test(fwts_framework *fw, const fwts_acpi_table_hmat_addr_range *entry, bool *passed) +static void hmat_proximity_domain_test(fwts_framework *fw, const fwts_acpi_table_hmat_proximity_domain *entry, bool *passed) { - fwts_log_info_verbatim(fw, " Memory Subsystem Address Range (Type 0):"); + fwts_log_info_verbatim(fw, " Memory Proximity Domain Attributes (Type 0):"); fwts_log_info_verbatim(fw, " Type: 0x%4.4" PRIx16, entry->header.type); fwts_log_info_verbatim(fw, " Reserved: 0x%4.4" PRIx16, entry->header.reserved); fwts_log_info_verbatim(fw, " Length: 0x%8.8" PRIx32, entry->header.length); fwts_log_info_verbatim(fw, " Flags: 0x%4.4" PRIx16, entry->flags); fwts_log_info_verbatim(fw, " Reserved: 0x%4.4" PRIx16, entry->reserved1); - fwts_log_info_verbatim(fw, " Processor Proximity Domain: 0x%8.8" PRIx32, entry->processor_proximity_domain); - fwts_log_info_verbatim(fw, " Memory Proximity Domain: 0x%8.8" PRIx32, entry->memory_proximity_domain); + fwts_log_info_verbatim(fw, " Proximity Domain for Initiator: 0x%8.8" PRIx32, entry->initiator_proximity_domain); + fwts_log_info_verbatim(fw, " Proximity Domain for Memory: 0x%8.8" PRIx32, entry->memory_proximity_domain); fwts_log_info_verbatim(fw, " Reserved: 0x%8.8" PRIx32, entry->reserved2); - fwts_log_info_verbatim(fw, " System Phy Addr Range Base: 0x%16.16" PRIx64, entry->phy_addr_base); - fwts_log_info_verbatim(fw, " System Phy Addr Range Length: 0x%16.16" PRIx64, entry->phy_addr_length); + fwts_log_info_verbatim(fw, " Reserved: 0x%16.16" PRIx64, entry->reserved3); + fwts_log_info_verbatim(fw, " Reserved: 0x%16.16" PRIx64, entry->reserved4); fwts_acpi_reserved_zero_check(fw, "HMAT", "Reserved", entry->header.reserved, sizeof(entry->header.reserved), passed); - fwts_acpi_reserved_bits_check(fw, "HMAT", "Flags", entry->flags, sizeof(entry->flags), 3, 15, passed); + fwts_acpi_reserved_bits_check(fw, "HMAT", "Flags", entry->flags, sizeof(entry->flags), 1, 15, passed); fwts_acpi_reserved_zero_check(fw, "HMAT", "Reserved", entry->reserved1, sizeof(entry->reserved1), passed); fwts_acpi_reserved_zero_check(fw, "HMAT", "Reserved", entry->reserved2, sizeof(entry->reserved2), passed); + fwts_acpi_reserved_zero_check(fw, "HMAT", "Reserved", entry->reserved3, sizeof(entry->reserved3), passed); + fwts_acpi_reserved_zero_check(fw, "HMAT", "Reserved", entry->reserved4, sizeof(entry->reserved4), passed); } static void hmat_locality_test(fwts_framework *fw, const fwts_acpi_table_hmat_locality *entry, bool *passed) @@ -97,6 +99,13 @@ static void hmat_locality_test(fwts_framework *fw, const fwts_acpi_table_hmat_lo "HMATBadNumProximityDomain", "HMAT length does not match to the number of Proximity Domains "); } + + if (!entry->entry_base_unit) { + *passed = false; + fwts_failed(fw, LOG_LEVEL_CRITICAL, + "HMATBadBaseUnit", + "HMAT Type 1 Entry Base Unit must be non-zero"); + } } static void hmat_cache_test(fwts_framework *fw, const fwts_acpi_table_hmat_cache *entry, bool *passed) @@ -105,7 +114,7 @@ static void hmat_cache_test(fwts_framework *fw, const fwts_acpi_table_hmat_cache fwts_log_info_verbatim(fw, " Type: 0x%4.4" PRIx16, entry->header.type); fwts_log_info_verbatim(fw, " Reserved: 0x%4.4" PRIx16, entry->header.reserved); fwts_log_info_verbatim(fw, " Length: 0x%8.8" PRIx32, entry->header.length); - fwts_log_info_verbatim(fw, " Memory Proximity Domain: 0x%8.8" PRIx32, entry->memory_proximity_domain); + fwts_log_info_verbatim(fw, " Proximity Domain for Memory: 0x%8.8" PRIx32, entry->memory_proximity_domain); fwts_log_info_verbatim(fw, " Reserved: 0x%8.8" PRIx32, entry->reserved1); fwts_log_info_verbatim(fw, " Memory Side Cache Size: 0x%16.16" PRIx64, entry->cache_size); fwts_log_info_verbatim(fw, " Cache Attributes: 0x%8.8" PRIx32, entry->cache_attr); @@ -163,9 +172,9 @@ static int hmat_test1(fwts_framework *fw) break; } - if (entry->type == FWTS_ACPI_HMAT_TYPE_ADDRESS_RANGE) { - hmat_addr_range_test(fw, (fwts_acpi_table_hmat_addr_range *) entry, &passed); - type_length = sizeof(fwts_acpi_table_hmat_addr_range); + if (entry->type == FWTS_ACPI_HMAT_TYPE_PROXIMITY_DOMAIN) { + hmat_proximity_domain_test(fw, (fwts_acpi_table_hmat_proximity_domain *) entry, &passed); + type_length = sizeof(fwts_acpi_table_hmat_proximity_domain); } else if (entry->type == FWTS_ACPI_HMAT_TYPE_LOCALITY) { fwts_acpi_table_hmat_locality *locality = (fwts_acpi_table_hmat_locality *) entry; hmat_locality_test(fw, (fwts_acpi_table_hmat_locality *) entry, &passed); diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index 5204744d..1767ba1f 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -1355,7 +1355,7 @@ typedef struct { } __attribute__ ((packed)) fwts_acpi_table_hmat; typedef enum { - FWTS_ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, + FWTS_ACPI_HMAT_TYPE_PROXIMITY_DOMAIN = 0, FWTS_ACPI_HMAT_TYPE_LOCALITY = 1, FWTS_ACPI_HMAT_TYPE_CACHE = 2, } fwts_acpi_hmat_type; @@ -1370,12 +1370,12 @@ typedef struct { fwts_acpi_table_hmat_header header; uint16_t flags; uint16_t reserved1; - uint32_t processor_proximity_domain; + uint32_t initiator_proximity_domain; uint32_t memory_proximity_domain; uint32_t reserved2; - uint64_t phy_addr_base; - uint64_t phy_addr_length; -} __attribute__ ((packed)) fwts_acpi_table_hmat_addr_range; + uint64_t reserved3; + uint64_t reserved4; +} __attribute__ ((packed)) fwts_acpi_table_hmat_proximity_domain; typedef struct { fwts_acpi_table_hmat_header header;