From patchwork Thu Jan 4 08:45:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1882359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T5Ktk6kKYz1ydb for ; Thu, 4 Jan 2024 19:46:06 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rLJMT-0001NF-FR; Thu, 04 Jan 2024 08:45:57 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rLJMM-0001N0-Vi for fwts-devel@lists.ubuntu.com; Thu, 04 Jan 2024 08:45:51 +0000 Received: from canonical.com (118-163-61-247.hinet-ip.hinet.net [118.163.61.247]) (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 9A2D03F20E for ; Thu, 4 Jan 2024 08:45:49 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] acpi: phat: add reset reason health record test (mantis 2294) Date: Thu, 4 Jan 2024 16:45:45 +0800 Message-Id: <20240104084546.65238-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.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" BugLink: https://bugs.launchpad.net/fwts/+bug/2047212 The new reset reason health record was added in ACPI 6.5 Signed-off-by: Ivan Hu --- src/acpi/phat/phat.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/acpi/phat/phat.c b/src/acpi/phat/phat.c index 57499c34..9312eacc 100644 --- a/src/acpi/phat/phat.c +++ b/src/acpi/phat/phat.c @@ -25,6 +25,8 @@ #include "fwts_uefi.h" +static const char reset_reason_guid[] = "7A014CE2-F263-4B77-B88A-E6336B782C14"; + static fwts_acpi_table_info *table; acpi_table_init(PHAT, &table) @@ -87,6 +89,7 @@ static void phat_health_test( char guid[37]; char buffer[2048]; + uint8_t supported_src, source; fwts_guid_buf_to_str(entry->data_signature, guid, sizeof(guid)); device_path = (uint16_t *)((char *)entry + sizeof(fwts_acpi_table_phat_health)); @@ -115,9 +118,17 @@ static void phat_health_test( *passed = false; } else { - fwts_log_info_verbatim(fw, " Vendor Data:"); + fwts_log_info_verbatim(fw, " Device-specific Data:"); fwts_hexdump_data_prefix_all(fw, (uint8_t *)entry + entry->data_offset, " ", entry->header.length - entry->data_offset); + + /* Check Reset Reason Health Record Supported Sources and source*/ + if (strcmp(reset_reason_guid, guid) == 0) { + supported_src = *((uint8_t *)entry + entry->data_offset); + source = *((uint8_t *)entry + entry->data_offset + 1); + fwts_acpi_reserved_bits("PHAT", "Supported Sources", supported_src, 5, 7, passed); + fwts_acpi_reserved_bits("PHAT", "Source", source, 5, 7, passed); + } } } From patchwork Thu Jan 4 08:45:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1882360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T5Ktk6yB6z23dg for ; Thu, 4 Jan 2024 19:46:06 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rLJMV-0001Nc-Sd; Thu, 04 Jan 2024 08:46:00 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rLJMR-0001NK-7E for fwts-devel@lists.ubuntu.com; Thu, 04 Jan 2024 08:45:55 +0000 Received: from canonical.com (118-163-61-247.hinet-ip.hinet.net [118.163.61.247]) (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-1.canonical.com (Postfix) with ESMTPSA id 30B4F42891 for ; Thu, 4 Jan 2024 08:45:53 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] fwts-test: sync up for reset reason health record test Date: Thu, 4 Jan 2024 16:45:46 +0800 Message-Id: <20240104084546.65238-2-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240104084546.65238-1-ivan.hu@canonical.com> References: <20240104084546.65238-1-ivan.hu@canonical.com> 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" Signed-off-by: Ivan Hu --- fwts-test/phat-0001/acpidump-0001.log | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fwts-test/phat-0001/acpidump-0001.log b/fwts-test/phat-0001/acpidump-0001.log index c926774d..1f4d6328 100644 --- a/fwts-test/phat-0001/acpidump-0001.log +++ b/fwts-test/phat-0001/acpidump-0001.log @@ -35,10 +35,10 @@ PHAT @ 0x0000000000000000 0080: 86 5D 0E 47 A6 B0 0A 2D B9 40 82 49 3A 00 00 00 .].G...-.@.I+... 0090: 5C 00 5F 00 53 00 42 00 2E 00 50 00 43 00 49 00 \._.S.B...P.C.I. 00A0: 30 00 2E 00 41 00 42 00 43 00 44 00 00 00 FF 11 0...A.B.C.D..... - 00B0: 55 AA 01 00 4A 00 00 00 00 00 11 DD D5 18 12 BA U...7........... - 00C0: 24 49 A7 5A 46 D2 51 EC B5 93 42 00 00 00 5C 00 $I.ZF.Q.../...\. + 00B0: 55 AA 01 00 4A 00 00 00 00 00 E2 4C 01 7A 63 F2 U...7........... + 00C0: 77 4B B8 8A E6 33 6B 78 2C 14 42 00 00 00 5C 00 $I.ZF.Q.../...\. 00D0: 5F 00 53 00 42 00 2E 00 50 00 43 00 49 00 30 00 _.S.B...P.C.I.0. 00E0: 2E 00 47 00 46 00 58 00 30 00 2E 00 58 00 59 00 ..G.F.X.0...X.Y. - 00F0: 5A 00 00 00 12 34 56 78 90 AB CD EF Z...4Vx.... + 00F0: 5A 00 00 00 00 00 45 67 89 AB CD EF Z...4Vx....