From patchwork Fri Jun 4 05:11:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1487574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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 ozlabs.org (Postfix) with ESMTPS id 4Fx9pm1Fxhz9sRK for ; Fri, 4 Jun 2021 15:11:27 +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 1lp277-0004fg-QM; Fri, 04 Jun 2021 05:11:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lp276-0004fa-3q for fwts-devel@lists.ubuntu.com; Fri, 04 Jun 2021 05:11:20 +0000 Received: from d75-158-101-9.abhsia.telus.net ([75.158.101.9] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lp275-0006kE-GP; Fri, 04 Jun 2021 05:11:19 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/3] sbbr: add checks for mandatory tables Date: Thu, 3 Jun 2021 23:11:15 -0600 Message-Id: <20210604051117.428840-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.31.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" This is based on Arm Server Base Boot Requirements (SBBR) 1.2 Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/sbbr/acpitables/acpitables.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/sbbr/acpitables/acpitables.c b/src/sbbr/acpitables/acpitables.c index fa63be64..0919250b 100644 --- a/src/sbbr/acpitables/acpitables.c +++ b/src/sbbr/acpitables/acpitables.c @@ -195,6 +195,22 @@ static int acpi_table_sbbr_check_test2(fwts_framework *fw) return FWTS_OK; } +/* List of mandatory ACPI tables (SBBR 4.2.1) */ +static const char *mandatory_acpi_tables[] = { + "RSDP", + "XSDT", + "FACP", + "DSDT", + "SSDT", + "MADT", + "GTDT", + "DBG2", + "SPCR", + "MCFG", + "PPTT", + NULL +}; + /* List of ACPI tables recommended by SBBR 4.2.2 */ static const char *recommended_acpi_tables[] = { "MCFG", @@ -235,6 +251,19 @@ static int acpi_table_sbbr_check_test3(fwts_framework *fw) { uint32_t i; + for (i = 0; mandatory_acpi_tables[i] != NULL; i++) { + fwts_acpi_table_info *info; + + info = sbbr_search_acpi_tables(fw, mandatory_acpi_tables[i]); + if (info == NULL) { + fwts_failed(fw, LOG_LEVEL_CRITICAL, "SBBRTableNotFound", + "SBBR mandatory ACPI table \"%s\" not found.", mandatory_acpi_tables[i]); + } else { + fwts_passed(fw, "SBBR mandatory ACPI table \"%s\" found.", + mandatory_acpi_tables[i]); + } + } + for (i = 0; recommended_acpi_tables[i] != NULL; i++) { fwts_acpi_table_info *info; @@ -253,7 +282,7 @@ static int acpi_table_sbbr_check_test3(fwts_framework *fw) static fwts_framework_minor_test acpi_table_sbbr_check_tests[] = { { acpi_table_sbbr_namespace_check_test1, "Test that processors only exist in the _SB namespace." }, { acpi_table_sbbr_check_test2, "Test DSDT and SSDT tables are implemented." }, - { acpi_table_sbbr_check_test3, "Check for recommended ACPI tables." }, + { acpi_table_sbbr_check_test3, "Check for mandatory and recommended ACPI tables." }, { NULL, NULL } };