From patchwork Thu May 21 02:37:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294902 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=) 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 49SDLs36MDz9sRf; Thu, 21 May 2020 12:38:13 +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 1jbb62-00076C-TE; Thu, 21 May 2020 02:38:10 +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 1jbb61-000766-3C for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:09 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb5z-0002SA-Sx; Thu, 21 May 2020 02:38:08 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 01/10] dmicheck: test feature flags in type 2 Date: Wed, 20 May 2020 20:37:53 -0600 Message-Id: <20200521023802.1553594-1-alex.hung@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" Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index c53bf163..46d7e620 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1260,6 +1260,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Asset Tag", hdr, 0x8); if (hdr->length < 0x0f) break; + dmi_reserved_bits_check(fw, table, addr, "Feature Flags", hdr, sizeof(uint8_t), 0x9, 5, 7); dmi_str_check(fw, table, addr, "Location In Chassis", hdr, 0xa); dmi_min_max_uint8_check(fw, table, addr, "Type", hdr, 0xd, 0x1, 0xd); break; From patchwork Thu May 21 02:37:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294903 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=) 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 49SDLw3Qmlz9sRf; Thu, 21 May 2020 12:38:16 +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 1jbb66-00077U-1n; Thu, 21 May 2020 02:38:14 +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 1jbb63-00076g-To for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:11 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb63-0002SP-8z; Thu, 21 May 2020 02:38:11 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 02/10] dmicheck: remove duplicated chassis type test in type 3 Date: Wed, 20 May 2020 20:37:54 -0600 Message-Id: <20200521023802.1553594-2-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 46d7e620..f163c253 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1270,16 +1270,7 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x09) break; dmi_str_check(fw, table, addr, "Manufacturer", hdr, 0x4); - dmi_min_max_mask_uint8_check(fw, table, addr, "Chassis Type", hdr, 0x5, 0x1, 0x24, 0x0, 0x7f); - - if ((data[5] & ~0x80) >= FWTS_SMBIOS_CHASSIS_MAX) { - fwts_failed(fw, LOG_LEVEL_HIGH, DMI_INVALID_HARDWARE_ENTRY, - "Incorrect Chassis Type " - "SMBIOS Type 3 reports 0x%" PRIx8, - (data[5] & ~0x80)); - break; - } - + dmi_min_max_mask_uint8_check(fw, table, addr, "Chassis Type", hdr, 0x5, 0x1, FWTS_SMBIOS_CHASSIS_MAX - 1, 0x0, 0x7f); dmi_min_max_mask_uint8_check(fw, table, addr, "Chassis Lock", hdr, 0x5, 0x0, 0x1, 0x7, 0x1); dmi_str_check(fw, table, addr, "Version", hdr, 0x6); dmi_str_check(fw, table, addr, "Serial Number", hdr, 0x7); From patchwork Thu May 21 02:37:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294904 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=) 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 49SDLy5wb7z9sRf; Thu, 21 May 2020 12:38:18 +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 1jbb68-000788-69; Thu, 21 May 2020 02:38:16 +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 1jbb66-00077s-FP for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:14 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb65-0002Sf-Qz; Thu, 21 May 2020 02:38:14 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 03/10] dmicheck: update Processor Characteristics test in type 4 Date: Wed, 20 May 2020 20:37:55 -0600 Message-Id: <20200521023802.1553594-3-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index f163c253..22066c03 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1330,7 +1330,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Part Number", hdr, 0x22); if (hdr->length < 0x28) break; - dmi_reserved_bits_check(fw, table, addr, "Processor Characteristics", hdr, sizeof(uint16_t), 0x26, 8, 15); + dmi_reserved_bits_check(fw, table, addr, "Processor Characteristics", hdr, sizeof(uint16_t), 0x26, 9, 15); if (hdr->length < 0x30) break; dmi_min_max_uint16_check(fw, table, addr, "Core Count 2", hdr, 0x2a, 0, 0xfffe); From patchwork Thu May 21 02:37:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294905 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=) 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 49SDM14hg2z9sRf; Thu, 21 May 2020 12:38:21 +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 1jbb6B-00079Z-94; Thu, 21 May 2020 02:38:19 +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 1jbb69-000799-A4 for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:17 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb68-0002Sn-HL; Thu, 21 May 2020 02:38:16 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 04/10] dmicheck: add Supported SRAM test in type 4 Date: Wed, 20 May 2020 20:37:56 -0600 Message-Id: <20200521023802.1553594-4-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 22066c03..dd2e5d59 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1369,6 +1369,7 @@ static void dmicheck_entry(fwts_framework *fw, table, addr, "Cache Location", 0x5); dmi_reserved_bits_check(fw, table, addr, "Cache Location", hdr, sizeof(uint16_t), 0x05, 10, 15); + dmi_reserved_bits_check(fw, table, addr, "Supported SRAM Type", hdr, sizeof(uint16_t), 0x0b, 7, 15); dmi_reserved_bits_check(fw, table, addr, "Current SRAM Type", hdr, sizeof(uint16_t), 0x0d, 7, 15); if (hdr->length < 0x13) break; From patchwork Thu May 21 02:37:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294906 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=) 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 49SDM3751Sz9sRf; Thu, 21 May 2020 12:38:23 +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 1jbb6D-0007AN-CG; Thu, 21 May 2020 02:38: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 1jbb6B-0007A2-Qa for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:19 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb6B-0002Sx-8b; Thu, 21 May 2020 02:38:19 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 05/10] dmicheck: fix typo in type 8 Date: Wed, 20 May 2020 20:37:57 -0600 Message-Id: <20200521023802.1553594-5-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index dd2e5d59..5fe0283c 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1401,7 +1401,7 @@ static void dmicheck_entry(fwts_framework *fw, "(range allowed 0x00..0x23, 0xa0..0xa4, 0xff) " "while accessing entry '%s' @ " "0x%8.8" PRIx32 ", field '%s', offset 0x%2.2x", - data[0x7], table, addr, "Internal Connector Type", 0x7); + data[0x7], table, addr, "External Connector Type", 0x7); if (!((data[0x8] <= 0x23) || (data[0x8] == 0xff) || From patchwork Thu May 21 02:37:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294907 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=) 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 49SDM70lcKz9sRf; Thu, 21 May 2020 12:38: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 1jbb6G-0007BW-GH; Thu, 21 May 2020 02:38:24 +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 1jbb6E-0007B2-F8 for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:22 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb6D-0002T9-Qa; Thu, 21 May 2020 02:38:22 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 06/10] dmicheck: add CXL Flexbus 1.0 to slot type in type 9 Date: Wed, 20 May 2020 20:37:58 -0600 Message-Id: <20200521023802.1553594-6-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 5fe0283c..d163bed3 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1420,6 +1420,7 @@ static void dmicheck_entry(fwts_framework *fw, break; dmi_str_check(fw, table, addr, "Slot Designation", hdr, 0x4); if (!(((data[0x5] >= 0x01) && (data[0x5] <= 0x23)) || + (data[0x5] == 0x30) || ((data[0x5] >= 0xa0) && (data[0x5] <= 0xbd)))) fwts_failed(fw, LOG_LEVEL_HIGH, DMI_VALUE_OUT_OF_RANGE, "Out of range value 0x%2.2" PRIx8 " " From patchwork Thu May 21 02:37:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294908 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=) 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 49SDM90M7dz9sRf; Thu, 21 May 2020 12:38:29 +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 1jbb6I-0007CO-JQ; Thu, 21 May 2020 02:38:26 +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 1jbb6H-0007By-4P for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:25 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb6G-0002TP-Fg; Thu, 21 May 2020 02:38:24 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 07/10] dmicheck: fix wrong length for reserved fields in type 13 Date: Wed, 20 May 2020 20:37:59 -0600 Message-Id: <20200521023802.1553594-7-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index d163bed3..f23c353b 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1501,7 +1501,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_reserved_bits_check(fw, table, addr, "Flags", hdr, sizeof(uint8_t), 0x5, 1, 7); if (hdr->length < 0x15) break; - for (i = 0x6; i < 0x15; i++) + for (i = 0x6; i < 15; i++) dmi_reserved_uint8_check(fw, table, addr, "Reserved", hdr, i); if (hdr->length < 0x16) break; From patchwork Thu May 21 02:38:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294909 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=) 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 49SDMC1SyHz9sRf; Thu, 21 May 2020 12:38:31 +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 1jbb6K-0007Db-MC; Thu, 21 May 2020 02:38:28 +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 1jbb6J-0007DL-RQ for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:27 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb6J-0002Td-87; Thu, 21 May 2020 02:38:27 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 08/10] dmicheck: update tests in type 17 Date: Wed, 20 May 2020 20:38:00 -0600 Message-Id: <20200521023802.1553594-8-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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" 1. update form factor - die 2. add firmware version string check 3. add reserved bits for extended speed and extended configured memory speed Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index f23c353b..f24290f1 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1606,7 +1606,7 @@ static void dmicheck_entry(fwts_framework *fw, break; if (hdr->length < 0x15) break; - dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0xf); + dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0x10); dmi_str_check(fw, table, addr, "Locator", hdr, 0x10); dmi_str_check(fw, table, addr, "Bank Locator", hdr, 0x11); dmi_min_max_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, 0x1, 0x21); @@ -1622,10 +1622,15 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x20) break; dmi_reserved_bits_check(fw, table, addr, "Extended Size", hdr, sizeof(uint32_t), 0x1c, 31, 31); - if (hdr->length < 0x3c) + if (hdr->length < 0x4c) break; dmi_min_max_uint8_check(fw, table, addr, "Memory Technology", hdr, 0x28, 0x1, 0x7); dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 6, 15); + dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b); + if (hdr->length < 0x54) + break; + dmi_reserved_bits_check(fw, table, addr, "Extended Speed", hdr, sizeof(uint32_t), 0x54, 31, 31); + dmi_reserved_bits_check(fw, table, addr, "Extended Configured Memory Speed", hdr, sizeof(uint32_t), 0x58, 31, 31); break; From patchwork Thu May 21 02:38:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294910 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=) 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 49SDMG2VnWz9sRf; Thu, 21 May 2020 12:38:34 +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 1jbb6N-0007FV-QC; Thu, 21 May 2020 02:38:31 +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 1jbb6M-0007ES-9T for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:30 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb6L-0002Tt-Ms; Thu, 21 May 2020 02:38:30 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 09/10] dmicheck: check fields that has max 0x8000 Date: Wed, 20 May 2020 20:38:01 -0600 Message-Id: <20200521023802.1553594-9-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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" This includes fields in type 26, 27, 28, 29, 36 and 39. Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index f24290f1..0ca5cce2 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1767,6 +1767,13 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Description", hdr, 0x4); dmi_min_max_mask_uint8_check(fw, table, addr, "Location (bits 0..4)", hdr, 0x5, 0x1, 0xb, 0, 0x1f); dmi_min_max_mask_uint8_check(fw, table, addr, "Status (bits 5..7)", hdr, 0x5, 0x1, 0x6, 5, 0x7); + dmi_min_max_uint16_check(fw, table, addr, "Maximum Value", hdr, 0x6, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Minimum Value", hdr, 0x8, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Resolution", hdr, 0xa, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Tolerance", hdr, 0xc, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Accuracy", hdr, 0xe, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Nominal Value", hdr, 0x14, 0, 0x8000); + break; case 27: /* 7.28 */ @@ -1786,6 +1793,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_min_max_mask_uint8_check(fw, table, addr, "Status (bits 5..7)", hdr, 0x6, 0x1, 0x6, 5, 0x7); if (hdr->length < 0x0f) break; + dmi_min_max_uint16_check(fw, table, addr, "Nominal Speed", hdr, 0xc, 0, 0x8000); dmi_str_check(fw, table, addr, "Description", hdr, 0xe); break; @@ -1796,6 +1804,12 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Description", hdr, 0x4); dmi_min_max_mask_uint8_check(fw, table, addr, "Location (bits 0..4)", hdr, 0x5, 0x1, 0xf, 0, 0x1f); dmi_min_max_mask_uint8_check(fw, table, addr, "Status (bits 5..7)", hdr, 0x5, 0x1, 0x6, 5, 0x7); + dmi_min_max_uint16_check(fw, table, addr, "Maximum Value", hdr, 0x6, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Minimum Value", hdr, 0x8, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Resolution", hdr, 0xa, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Tolerance", hdr, 0xc, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Accuracy", hdr, 0xe, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Nominal Value", hdr, 0x14, 0, 0x8000); break; case 29: /* 7.30 */ @@ -1805,6 +1819,12 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Description", hdr, 0x4); dmi_min_max_mask_uint8_check(fw, table, addr, "Location (bits 0..4)", hdr, 0x5, 0x1, 0xb, 0, 0x1f); dmi_min_max_mask_uint8_check(fw, table, addr, "Status (bits 5..7)", hdr, 0x5, 0x1, 0x6, 5, 0x7); + dmi_min_max_uint16_check(fw, table, addr, "Maximum Value", hdr, 0x6, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Minimum Value", hdr, 0x8, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Resolution", hdr, 0xa, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Tolerance", hdr, 0xc, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Accuracy", hdr, 0xe, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Nominal Value", hdr, 0x14, 0, 0x8000); break; case 30: /* 7.31 */ @@ -1865,10 +1885,14 @@ static void dmicheck_entry(fwts_framework *fw, case 36: /* 7.37 */ table = "Management Device Threshold Data (Type 36)"; - /* if (hdr->length < 0x10) break; - */ + dmi_min_max_uint16_check(fw, table, addr, "Lower Threshold - Non-critical", hdr, 0x4, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Upper Threshold - Non-critical", hdr, 0x6, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Lower Threshold - Critical", hdr, 0x8, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Upper Threshold - Critical", hdr, 0xa, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Lower Threshold - Non-recoverable", hdr, 0xc, 0, 0x8000); + dmi_min_max_uint16_check(fw, table, addr, "Upper Threshold - Non-recoverable", hdr, 0xe, 0, 0x8000); break; case 37: /* 7.38 */ @@ -1900,6 +1924,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Asset Tag", hdr, 0x9); dmi_str_check(fw, table, addr, "Model Part Number", hdr, 0xa); dmi_str_check(fw, table, addr, "Revision Level", hdr, 0xb); + dmi_min_max_uint16_check(fw, table, addr, "Max Power Capacity", hdr, 0xc, 0, 0x8000); dmi_reserved_bits_check(fw, table, addr, "Power Supply Characteristics", hdr, sizeof(uint16_t), 0xe, 14, 15); break; From patchwork Thu May 21 02:38:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294911 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=) 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 49SDMK3Jtcz9sRf; Thu, 21 May 2020 12:38:37 +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 1jbb6Q-0007Gx-3S; Thu, 21 May 2020 02:38:34 +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 1jbb6O-0007GJ-Sd for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:32 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jbb6O-0002U5-8h; Thu, 21 May 2020 02:38:32 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 10/10] dmicheck: check reserved bits in Characteristics in type 43 Date: Wed, 20 May 2020 20:38:02 -0600 Message-Id: <20200521023802.1553594-10-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 0ca5cce2..ee1cd6fb 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1960,6 +1960,7 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x1b) break; dmi_str_check(fw, table, addr, "Description", hdr, 0x12); + dmi_reserved_bits_check(fw, table, addr, "Characteristics", hdr, sizeof(uint64_t), 0x13, 0, 1); dmi_reserved_bits_check(fw, table, addr, "Characteristics", hdr, sizeof(uint64_t), 0x13, 6, 63); break;