From patchwork Thu Apr 28 10:12:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1623563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=pqcsuj90; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4KpryX4VB6z9s0B for ; Thu, 28 Apr 2022 20:12:19 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nk189-0002tW-SR; Thu, 28 Apr 2022 10:12:13 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nk187-0002sL-L8 for fwts-devel@lists.ubuntu.com; Thu, 28 Apr 2022 10:12:11 +0000 Received: from canonical.com (unknown [106.104.72.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 730FA3F84B for ; Thu, 28 Apr 2022 10:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1651140731; bh=qSJ43KwkUa9PtVuCkQXWLWKKJ+deUjUZaf4PZ1YDWoQ=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=pqcsuj90ecbBB8VxREp62TcNCP6AqhkKzbRv2MWtbytbHvpTlEPMsm1e5hIRH43RA 3h4cYXa26QCcTnIj7zNzjqauzk+5uTg7+p+uCjVVLG61wlTQY63zVwOg/x3bFW/rkT 4m5h5f9E7KtHhGegZtbxQZP/hs5F/ZVkDnIZvGuCaJSbLPhx3F8FJ/lQldbELBHB9O 1bVmsayik43ZjTwVMZaE5vOUh7SNOTAV+TUyxU17q4YtNpw/Hh5xGLK7rDJxpy4+y3 m7Gk560JrMXiyMr/PNKd9PICLC4VGJdwSz4w6U55EqhgOtieytEGGQwc8/B1ELt5kc lyAqmG95Yn3+Q== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: iort: update IORT test to specification version E.d Date: Thu, 28 Apr 2022 18:12:00 +0800 Message-Id: <20220428101200.36663-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" https://developer.arm.com/documentation/den0049/ed/ Signed-off-by: Ivan Hu --- src/acpi/iort/iort.c | 31 +++++++++++++++++++++---------- src/lib/include/fwts_acpi.h | 8 +++++++- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/acpi/iort/iort.c b/src/acpi/iort/iort.c index 45c80f1b..e3a0c08c 100644 --- a/src/acpi/iort/iort.c +++ b/src/acpi/iort/iort.c @@ -494,21 +494,29 @@ static void iort_check_pci_root_complex( fwts_log_info_simp_int(fw, " Memory Access Flags ", node->properties.memory_access_flags); fwts_log_info_simp_int(fw, " ATS Attribute: ", node->ats_attribute); fwts_log_info_simp_int(fw, " PCI Segment Number: ", node->pci_segment_number); - + fwts_log_info_simp_int(fw, " Memory addr. size limit: ", node->memory_addr_size_limit); + fwts_log_info_simp_int(fw, " PASID capabilities: ", node->pasid_cap); + fwts_log_info_simp_int(fw, " Reserved: ", node->reserved); + fwts_log_info_simp_int(fw, " Flags: ", node->flags); + iort_id_mappings_dump(fw, data, node_end); iort_node_check(fw, data, false, false, passed); + + iort_memory_access_properties_check(fw, "PCI Root Complex Node", &node->properties, passed); + fwts_acpi_reserved_bits("IORT", "ATS Attribute", node->ats_attribute, 3, 31, passed); + fwts_acpi_reserved_bits("IORT", "PASID capabilities", node->pasid_cap, 5, 15, passed); + fwts_acpi_reserved_zero("IORT", "Reserved", node->reserved, passed); - if (node->ats_attribute > 1) { + if (node->flags > 1) { *passed = false; fwts_failed(fw, LOG_LEVEL_HIGH, - "IORTCPCIRootComplexAtsAttrInvalid", - "IORT PCI Root Complex Node ATS Attribute is 0x%" PRIx32 - " and was expecting either 0 (root complex supports ATS) " - "or 1 (root complex does not support ATS).", - node->ats_attribute); + "IORTPCIRootComplexNodeFlagsInvalid", + "IORT PCI Root Complex Node flag " + "is 0x%" PRIx32 " and should be either " + "0 (not support PASID) or 1 (supports PASID).", + node->flags); } - iort_memory_access_properties_check(fw, "PCI Root Complex Node", &node->properties, passed); iort_id_mappings_check(fw, data, node_end, passed); fwts_log_nl(fw); } @@ -590,6 +598,8 @@ static void iort_check_smmuv3( fwts_log_info_simp_int(fw, " PRI: ", node->pri); fwts_log_info_simp_int(fw, " GERR: ", node->gerr); fwts_log_info_simp_int(fw, " Sync: ", node->sync); + fwts_log_info_simp_int(fw, " Proximity Domain: ", node->proximity_domain); + fwts_log_info_simp_int(fw, " DeviceId Mapping Index: ", node->deviceid_mapping_idx); iort_id_mappings_dump(fw, data, node_end); @@ -604,7 +614,7 @@ static void iort_check_smmuv3( "a model value of 0.", node->model); } - fwts_acpi_reserved_bits("IORT", "SMMUv3 Reserved Flags", node->flags, 2, 31, passed); + fwts_acpi_reserved_bits("IORT", "SMMUv3 Reserved Flags", node->flags, 4, 31, passed); fwts_log_nl(fw); } @@ -624,7 +634,8 @@ static void iort_check_pmcg( fwts_log_info_simp_int(fw, " Base Address: ", node->base_address); fwts_log_info_simp_int(fw, " Overflow interrupt GSIV: ", node->gsiv); fwts_log_info_simp_int(fw, " Node reference: ", node->node_ref); - + fwts_log_info_simp_int(fw, " Page 1 Base Address: ", node->p1_base_address); + iort_id_mappings_dump(fw, data, node_end); iort_node_check(fw, data, false, false, passed); diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index b12ca5af..8381c351 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -2063,7 +2063,6 @@ typedef struct { uint32_t context_interrupt_array_offset; uint32_t pmu_interrupt_count; uint32_t pmu_interrupt_array_offset; - /* * Global Interrupt array, Context Interrupt Array * and PMU Interrupt arrays follow at offsets into @@ -2101,6 +2100,10 @@ typedef struct { fwts_acpi_table_iort_properties properties; uint32_t ats_attribute; uint32_t pci_segment_number; + uint8_t memory_addr_size_limit; + uint16_t pasid_cap; + uint8_t reserved; + uint32_t flags; /* followed by array of ids_mappings at some offset uint32_t identifier_array[0]; @@ -2118,6 +2121,8 @@ typedef struct { uint32_t pri; uint32_t gerr; uint32_t sync; + uint32_t proximity_domain; + uint32_t deviceid_mapping_idx; /* followed by array of ids_mappings at some offset fwts_acpi_table_iort_id_mapping identifier_array[0]; @@ -2129,6 +2134,7 @@ typedef struct { uint64_t base_address; uint32_t gsiv; uint32_t node_ref; + uint64_t p1_base_address; /* followed by array of ids_mappings at some offset fwts_acpi_table_iort_id_mapping identifier_array[0];