From patchwork Thu Mar 9 09:00:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754545 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=I0cyw/8k; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNSd2NMJz246y for ; Thu, 9 Mar 2023 20:00:49 +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 1paC8e-0005pO-Mw; Thu, 09 Mar 2023 09:00:40 +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 1paC8O-0005nx-SS for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:24 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 4C2CB3F258 for ; Thu, 9 Mar 2023 09:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352424; bh=/3AXfg8TAM+2syHTdHU1Y+BRoBGwdJrHJriktmzgTwo=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=I0cyw/8kJNcspoQS2AS6l2qhOEatZkzh9E5SDV5Sr5eOSQ/ol2TfqhuauX2fyAYut VJhOzswBxxv/ZJwhiIAH5GBuOmoeWWnxzMeA+Kl/WALFvF1X9STi8qZjvbLOthKsVT CV1otwDbL/+Ngms6IjziCKK+yOKIUUesVrE3iFPQoYkGoOapnZjO3oGV+/whO5ZBW7 v48pWwW58ErR6PaTovNEKNEr9Pk8VgjKzBdYFgbj06UXK4k1itXGYZuHI2yuX4s1Y5 CnrnrzpjoSLXfERwvT6LqpbXhbrcaTXGb32aCwzz5ALphsvQ+kuz7zgzl/8whOrc3W xogmFL+Yo1lMQ== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 01/10] dmicheck: fix the extended bios ROM size bit check of type 0 Date: Thu, 9 Mar 2023 17:00:09 +0800 Message-Id: <20230309090018.32029-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" From the SMBIOS specification, 7.1 the Extended Bios ROM Size Bits 14:15, only 10b and 11b are reserved Signed-off-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 497a5c5f..22b7a6ec 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1297,7 +1297,7 @@ static void dmicheck_entry(fwts_framework *fw, /* new fields in spec 3.11 */ if (hdr->length < 0x1a) break; - dmi_reserved_bits_check(fw, table, addr, "Extended BIOS ROM Size", hdr, sizeof(uint16_t), 0x18, 14, 15); + dmi_reserved_bits_check(fw, table, addr, "Extended BIOS ROM Size", hdr, sizeof(uint16_t), 0x18, 15, 15); break; case 1: /* 7.2 */ From patchwork Thu Mar 9 09:00:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754546 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=fn+hewih; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNSd5gxnz2471 for ; Thu, 9 Mar 2023 20:00:49 +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 1paC8f-0005pe-QI; Thu, 09 Mar 2023 09:00:41 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC8U-0005ok-Ru for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:30 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 0924E3FFF7 for ; Thu, 9 Mar 2023 09:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352430; bh=GjupSnpL4nRqVrbWN4I3UglpL4cMzYfOzVM2PK7hbyw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fn+hewihkoTPBGQBp+6cXg7Zjm5AOXo0QjPWxlaOJaT6i491gCZZ12OTLwMtVRbUm /D5GWLg/dMSggqd4AmCwqPaLnLiwrKDZw/Oznni8y8uMoIXTpDL4uUlB6lceLj/9P3 3AIRd1dCB7u2kOckN1C5kQPNxQpcNNecNN03AmLMD8wFJr90mt6QNpMsxXk4Hma6qB egDP4Lv2o5FZlWYaGQfZ6SFg0pmBMtPt4Gpt8RL4w7ppceUOv7uiTVq/LYipWvrGBZ m/EgNgFkC1CMvSZwWYFZP5doMXWct6wsLRir5jt13bbDtbmiTsPePkL3oDzmuNXLEi b99UIWDtq8AOw== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 02/10] dmicheck: add processor family check for type 4 Date: Thu, 9 Mar 2023 17:00:10 +0800 Message-Id: <20230309090018.32029-2-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- src/dmi/dmicheck/dmicheck.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 22b7a6ec..3f28b35a 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1391,6 +1391,7 @@ static void dmicheck_entry(fwts_framework *fw, break; dmi_str_check(fw, table, addr, "Socket Designation", hdr, 0x4); dmi_min_max_uint8_check(fw, table, addr, "Processor Type", hdr, 0x5, 0x1, 0x6); + dmi_min_max_uint8_check(fw, table, addr, "Processor Family", hdr, 0x6, 0x1, 0xfe); dmi_str_check(fw, table, addr, "Processor Manufacturer", hdr, 0x7); dmi_str_check(fw, table, addr, "Processor Version", hdr, 0x10); dmi_min_max_uint8_check(fw, table, addr, "Upgrade", hdr, 0x19, 0x1, 0x3f); @@ -1402,6 +1403,9 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x28) break; dmi_reserved_bits_check(fw, table, addr, "Processor Characteristics", hdr, sizeof(uint16_t), 0x26, 10, 15); + if (hdr->length < 0x2a) + break; + dmi_min_max_uint16_check(fw, table, addr, "Processor Family 2", hdr, 0x28, 0x1, 0xfffd); if (hdr->length < 0x30) break; dmi_min_max_uint16_check(fw, table, addr, "Core Count 2", hdr, 0x2a, 0, 0xfffe); From patchwork Thu Mar 9 09:00:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754544 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=Vu1mn1em; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNSd0Wbhz2469 for ; Thu, 9 Mar 2023 20:00:48 +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 1paC8f-0005pn-U8; Thu, 09 Mar 2023 09:00:41 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC8a-0005p9-KD for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:36 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 433EB3FFF7 for ; Thu, 9 Mar 2023 09:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352436; bh=gjfC4IZAu9lTwnl212tC4L4pm+CYfRxATF7EY8gTBd8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Vu1mn1em1KN9MNetNNZOD58IcDjg7yalqn6Ha/NmkL1Ni6qpT/gtIFoSr32Npd/OZ dJS9YFOnyleBYKePle9RVnFBgLqy6PM/56giDDiwdbZAffwqPcz0RSQKeal0jawDI5 ENkC87zpJiaencNJJO20CBE21Ano6+p/Hi4ezNE26j47MdGu6uUGcsIutVfwUSmIEr 4Hy2OmnX6Zqi+cTzWl6/8g0tAu085QzYB/tRzA1v/1qFte5dgxJ0V7chHVkHxdkDdQ w2xYvWKs+XjQ87XwEGN1V/cvCautJ1KbpXkAPhzRJWq1gZ0JifB7zOfzdfm81CzP2k vNvelMF9gJsAQ== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 03/10] dmicheck: add status check for type 4 Date: Thu, 9 Mar 2023 17:00:11 +0800 Message-Id: <20230309090018.32029-3-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- src/dmi/dmicheck/dmicheck.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 3f28b35a..1952309c 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -57,6 +57,7 @@ #define DMI_RESERVED_BIT_USED "DMIReservedBitUsed" #define DMI_RESERVED_OFFSET_NONZERO "DMIReservedOffsetNonZero" +#define GET_UINT8(x) (uint8_t)(*(const uint8_t *)(x)) #define GET_UINT16(x) (uint16_t)(*(const uint16_t *)(x)) #define GET_UINT32(x) (uint32_t)(*(const uint32_t *)(x)) #define GET_UINT64(x) (uint64_t)(*(const uint64_t *)(x)) @@ -1394,6 +1395,16 @@ static void dmicheck_entry(fwts_framework *fw, dmi_min_max_uint8_check(fw, table, addr, "Processor Family", hdr, 0x6, 0x1, 0xfe); dmi_str_check(fw, table, addr, "Processor Manufacturer", hdr, 0x7); dmi_str_check(fw, table, addr, "Processor Version", hdr, 0x10); + if (((GET_UINT8(data + 0x18) & 0x07) == 0x5) || ((GET_UINT8(data + 0x18) & 0x07) == 0x6)) + fwts_failed(fw, LOG_LEVEL_HIGH, DMI_VALUE_OUT_OF_RANGE, + "Out of range value 0x%2.2" PRIx8 " " + "bits 0..2 set to illegal value 0x5 or 0x6 " + "while accessing entry '%s' @ 0x%8.8" PRIx32 + ", field '%s', offset 0x%2.2x", + GET_UINT8(data + 0x18), + table, addr, "Status", 0x18); + dmi_reserved_bits_check(fw, table, addr, "Status", hdr, sizeof(uint8_t), 0x18, 3, 5); + dmi_reserved_bits_check(fw, table, addr, "Status", hdr, sizeof(uint8_t), 0x18, 7, 7); dmi_min_max_uint8_check(fw, table, addr, "Upgrade", hdr, 0x19, 0x1, 0x3f); if (hdr->length < 0x23) break; From patchwork Thu Mar 9 09:00:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754547 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=YGRM2t0G; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNSd67Lfz2472 for ; Thu, 9 Mar 2023 20:00:49 +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 1paC8i-0005qe-3c; Thu, 09 Mar 2023 09:00:44 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC8g-0005pd-0R for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:42 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 617D53FFF7 for ; Thu, 9 Mar 2023 09:00:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352441; bh=Zzn8/UJRe/jG3iUmA5IDQh6ZpDk2D09Ib0HiJT8Zc4E=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YGRM2t0Gukh+oMvzz7QSIjIflMp5Qa7uGdcetciByEJ8ThmJHs+FYx9Ej1UwVYnVi gyyDpuE492glbLi59LnTc91Vylq3nnYhfTqIInqg6sgh4t6juLgcL2/sUhmY/Qrgt+ /WyW6AU3e95NgPZhcpKJJGZLsRAFqbsoC0NeK4iRcnkq8QtViWBYxiyhGvYusa3d24 FFJ5vYkpzwE4rgXiieYUDdwX159OkWcbYs1u36vlbBXHep1jjH2eTlpHLjmyGIIs4k JYFliW6G/AIVdMjWOIHIW8c8XsUmL/JffPi85diSOK8vr9HpRfGxSyP9FMP6XWxMOL Utacv4AfjHbdA== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 04/10] dmicheck: add bit 0 reserved check of the processor characteristics for type 4 Date: Thu, 9 Mar 2023 17:00:12 +0800 Message-Id: <20230309090018.32029-4-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- 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 1952309c..4ce492fd 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1413,6 +1413,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, 0, 0); dmi_reserved_bits_check(fw, table, addr, "Processor Characteristics", hdr, sizeof(uint16_t), 0x26, 10, 15); if (hdr->length < 0x2a) break; From patchwork Thu Mar 9 09:00:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754548 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=Io4BhthS; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNSk4nLhz2469 for ; Thu, 9 Mar 2023 20:00:54 +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 1paC8n-0005tV-6r; Thu, 09 Mar 2023 09:00:49 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC8m-0005sj-2Y for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:48 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 6ACC53FFF7 for ; Thu, 9 Mar 2023 09:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352447; bh=MBT6tOie5J6sFfrCQ+0SDGJKBOdsWTHI4v9bk+Nqqq4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Io4BhthSPA/D/i9X8VT7P68ejeX8iNwHzVoN+rjfUlb8dgfuC52EfJ3Ow2wZoCrK/ GpZXdGQiAJVKDuss+UTMEyj7wAb/2JMyRbWPumWYQ2kWqeCvd8IrE2KcDN443QZcXL y+Ti5uVcOI9h5tWZhjADx7lzQ27KFuHIx0QQamqwKgZtap6rc8tfYVlhVL8MSe3YxV ewzfT31/8yCk1+shvSj8fRXmReo1l7rtN8mQf7Bj5DLeE4ekDuXvq/OZ+ra5lz98SS MhNwS6PgXQ9LZLKxtZwW3J7M5FkLv9CJA0OI27CfS9l1b19FAQwFsitic2A8GMc61H LFR/IHwGuIXtg== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 05/10] dmicheck: modify the memory type range check for type 17 Date: Thu, 9 Mar 2023 17:00:13 +0800 Message-Id: <20230309090018.32029-5-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- src/dmi/dmicheck/dmicheck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 4ce492fd..836f7cdb 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1651,7 +1651,8 @@ static void dmicheck_entry(fwts_framework *fw, 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, 0x23); + fwts_dmi_value_range t17_ranges[] = {{0x1, 0x14}, {0x18, 0x23}}; + dmi_ranges_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, t17_ranges); if (hdr->length < 0x1b) break; dmi_str_check(fw, table, addr, "Manufacturer", hdr, 0x17); From patchwork Thu Mar 9 09:00:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754549 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=uTard2+O; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNSq58xDz2469 for ; Thu, 9 Mar 2023 20:00:59 +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 1paC8s-0005vX-9z; Thu, 09 Mar 2023 09:00:54 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC8r-0005vH-N4 for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:53 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 312D03FFF7 for ; Thu, 9 Mar 2023 09:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352453; bh=fNoGsW3z7c4BhVGEkbM3IBaLLQfBqhjxulYc1rv7GHw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uTard2+OgKsXVkcB1LAOewRLh68xBYaw+IwpEniJL24Yde4sUum5bqsCXWGLFb9pT ga9jitii1w1iMF+yXi/iQU1EVP4ShGCrgMkg8yBEKfjl6B/u+T/46fg0eV4vnhamJa vok6yrIyyc0ivGwVFKmAV+9J7yagUpp4aeALMZNRjx42lbpzSTj4YkzMni93GsBeCq Em2YroqSuaUOts6uuG/Fbp45345iW9K33wbW2qy6qaKTYeMqc6xEqrj/4N5GK4QiSe NBCW5Q2NDaaoofJeKYeuLLMpoVFH4tbCF1cQU7BM2JiUjPr3NaANGctrrW8RvPV3vn MwCMOdALMc0WA== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 06/10] dmicheck: add some bit 0 reserved checks for type 17 Date: Thu, 9 Mar 2023 17:00:14 +0800 Message-Id: <20230309090018.32029-6-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- src/dmi/dmicheck/dmicheck.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 836f7cdb..f2f8cb55 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1653,6 +1653,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Bank Locator", hdr, 0x11); fwts_dmi_value_range t17_ranges[] = {{0x1, 0x14}, {0x18, 0x23}}; dmi_ranges_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, t17_ranges); + dmi_reserved_bits_check(fw, table, addr, "Type Detail", hdr, sizeof(uint16_t), 0x13, 0, 0); if (hdr->length < 0x1b) break; dmi_str_check(fw, table, addr, "Manufacturer", hdr, 0x17); @@ -1662,12 +1663,13 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x1c) break; dmi_reserved_bits_check(fw, table, addr, "Attributes", hdr, sizeof(uint8_t), 0x1b, 4, 7); - if (hdr->length < 0x20) + if (hdr->length < 0x22) break; dmi_reserved_bits_check(fw, table, addr, "Extended Size", hdr, sizeof(uint32_t), 0x1c, 31, 31); 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, 0, 0); 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) From patchwork Thu Mar 9 09:00:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754550 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=jrfzF0cL; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNSx70w2z2469 for ; Thu, 9 Mar 2023 20:01:05 +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 1paC8y-0005yP-Dl; Thu, 09 Mar 2023 09:01:00 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC8w-0005xY-Iu for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:58 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 4F8A73FFF7 for ; Thu, 9 Mar 2023 09:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352458; bh=IbWyOO9y/ufvCKZ207QKz4L5VXAvMsMc7x4PCcI4GUo=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jrfzF0cLg5n9ZjXwTZhUa/Kw88qw26rkOFYJNgzkDsQpjfUdjgO6LoQG6k1TVxoUK RN9np6rtxB4EQwfx5WdVA4PJI9gJ9ezoFJUfMOKZOYK3kiK5EsG7LH/ESGWGqgfPBx dvbHpXMNREQb0uv7IkcVKEy0OZ/DY/QBAk+yRt/NGJXTg9Ae7CHDaZJkPYYPdtHZAF 2El2lZFvNcGvHZBRu2V0QfmqV1lvdLjsTo9hr8htcBVH5oexuctHZLO/LhunpT25B3 l4o0oIQaE7rhnV9DqozO7j4LqIXnMj9tgG03VpXX2xX/iUxbKLYPcKKIUkm9Or7TBV 66ixquf1JOSig== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 07/10] dmicheck: update the interface field for type 21 Date: Thu, 9 Mar 2023 17:00:15 +0800 Message-Id: <20230309090018.32029-7-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- 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 f2f8cb55..be934ad4 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1743,7 +1743,7 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x07) break; dmi_min_max_uint8_check(fw, table, addr, "Type", hdr, 0x4, 0x1, 0x9); - fwts_dmi_value_range t21_ranges[] = {{0x1, 0x8}, {0xa0, 0xa2}}; + fwts_dmi_value_range t21_ranges[] = {{0x1, 0x8}, {0xa0, 0xa4}}; dmi_ranges_uint8_check(fw, table, addr, "Interface", hdr, 0x5, t21_ranges); break; From patchwork Thu Mar 9 09:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754551 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=OEoyKWXM; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNT31K1Hz2469 for ; Thu, 9 Mar 2023 20:01:11 +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 1paC93-000634-J0; Thu, 09 Mar 2023 09:01:05 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC91-000627-Il for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:01:03 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 00AF03FFF7 for ; Thu, 9 Mar 2023 09:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352463; bh=Vv8+wO1EKRx+YgnOdrMtFzX5xnyn6ZtJETuAd74I/h4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OEoyKWXMxg1XFrYZkJc76wCeDgqkSK1piinBgS3F8gR2yb3CcvHTJ1qQXllwBIZ3G VkXycRzsjpyB3Yy5mUMLU4Pf2GaRfbiI9e9HG78lYZmOulNxvIwyDVsJSh7YVoZphQ ad/oBHDN7zRu3hhS5X9tu+Z7ZryCqr+oPMRuxYQLndETM9HEtN7qNSFquYa0Iyvy4n kEjltNiFyM/EK1s5UH/UCPCLdlmOdP1jH16pUYSN6keUrlrwrbm9MreN2BNmOPznzU 4r+Sw5L9MDrNXv/umWSdFrICsdvnVH3TiYzQCy7EZ2aWtBpyxKyt41TdKB+0fHkmne G0eQpqK/llE5A== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 08/10] dmicheck: update the device type field for type 41 Date: Thu, 9 Mar 2023 17:00:16 +0800 Message-Id: <20230309090018.32029-8-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- 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 be934ad4..36b758fe 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1971,7 +1971,7 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0xb) break; dmi_str_check(fw, table, addr, "Reference Designation", hdr, 0x4); - dmi_min_max_mask_uint8_check(fw, table, addr, "Device Type", hdr, 0x5, 0x1, 0xa, 0, 0x7f); + dmi_min_max_mask_uint8_check(fw, table, addr, "Device Type", hdr, 0x5, 0x1, 0x10, 0, 0x7f); break; case 42: /* 7.43 */ From patchwork Thu Mar 9 09:00:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754552 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=WkaTa9mb; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNT90pqyz2469 for ; Thu, 9 Mar 2023 20:01:17 +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 1paC98-000674-M8; Thu, 09 Mar 2023 09:01:10 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC96-00065J-6F for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:01:08 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 C6F683FFF7 for ; Thu, 9 Mar 2023 09:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352467; bh=veetNSugZONlpaY6jqKcouK4ivO0JEE9ZtpL1W1Ra1c=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WkaTa9mb/b8Ajshs3Ek6J4MYT9fUWV0AGjO0E4URcx3A24XGwy51urx454Qpp6djU FbqTLAwi8P8FjZrFL+p/Y8BKqcaPOBFaLxAo57yMih8Y7hJ9BuHWy8Q2edyXqpw7mk 82uXfEcO6iVuOKEP9LaiV5RmM+tUV8h6VBuy7E8wK5JvcLXrwgsLXIqlf3dg2bRyGG HUWZ+2qBVSzpxtezgGEpZXGh4OpyGeg0p9Efc7L7d/iH8mpxZnG2BvWmNM2VP3wlPy rr5G+1J6bl8HLV9mw11txM1310ZIFyXmOHA9fQBVQjL0z1YjIi3wNQDzCkc7UKT7yi U+LY1B6pDUDqA== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 09/10] dmicheck: update for supporting DMI version to 3.6 Date: Thu, 9 Mar 2023 17:00:17 +0800 Message-Id: <20230309090018.32029-9-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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" Buglink: https://bugs.launchpad.net/fwts/+bug/2009801 Signed-off-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 36b758fe..0c18e4d0 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -35,7 +35,7 @@ #include #include -#define DMI_VERSION (0x0350) +#define DMI_VERSION (0x0360) #define VERSION_MAJOR(v) ((v) >> 8) #define VERSION_MINOR(v) ((v) & 0xff) @@ -1405,7 +1405,7 @@ static void dmicheck_entry(fwts_framework *fw, table, addr, "Status", 0x18); dmi_reserved_bits_check(fw, table, addr, "Status", hdr, sizeof(uint8_t), 0x18, 3, 5); dmi_reserved_bits_check(fw, table, addr, "Status", hdr, sizeof(uint8_t), 0x18, 7, 7); - dmi_min_max_uint8_check(fw, table, addr, "Upgrade", hdr, 0x19, 0x1, 0x3f); + dmi_min_max_uint8_check(fw, table, addr, "Processor Upgrade", hdr, 0x19, 0x1, 0x48); if (hdr->length < 0x23) break; dmi_str_check(fw, table, addr, "Serial Number", hdr, 0x20); @@ -1422,7 +1422,10 @@ static void dmicheck_entry(fwts_framework *fw, break; dmi_min_max_uint16_check(fw, table, addr, "Core Count 2", hdr, 0x2a, 0, 0xfffe); dmi_min_max_uint16_check(fw, table, addr, "Core Enabled 2", hdr, 0x2c, 0, 0xfffe); - dmi_min_max_uint16_check(fw, table, addr, "Thread Enabled 2", hdr, 0x2e, 0, 0xfffe); + dmi_min_max_uint16_check(fw, table, addr, "Thread Count 2", hdr, 0x2e, 0, 0xfffe); + if (hdr->length < 0x32) + break; + dmi_min_max_uint16_check(fw, table, addr, "Thread Enabled", hdr, 0x30, 0, 0xfffe); break; case 5: /* 7.6 (Type 5 is obsolete) */ @@ -1651,7 +1654,7 @@ static void dmicheck_entry(fwts_framework *fw, 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); - fwts_dmi_value_range t17_ranges[] = {{0x1, 0x14}, {0x18, 0x23}}; + fwts_dmi_value_range t17_ranges[] = {{0x1, 0x14}, {0x18, 0x24}}; dmi_ranges_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, t17_ranges); dmi_reserved_bits_check(fw, table, addr, "Type Detail", hdr, sizeof(uint16_t), 0x13, 0, 0); if (hdr->length < 0x1b) @@ -2003,7 +2006,7 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x6) break; - dmi_min_max_uint8_check(fw, table, addr, "IProcessor Architecture Types", hdr, 0x7, 0x0, 0x8); + dmi_min_max_uint8_check(fw, table, addr, "IProcessor Architecture Types", hdr, 0x7, 0x0, 0xa); break; case 45: /* 7.46 */ From patchwork Thu Mar 9 09:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754553 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=vdYWOA7F; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PXNTC328sz2469 for ; Thu, 9 Mar 2023 20:01:19 +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 1paC9B-00069W-Sq; Thu, 09 Mar 2023 09:01:13 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC9A-00068o-VI for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:01:12 +0000 Received: from canonical.com (unknown [106.104.136.95]) (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 4EAFA3FFF7 for ; Thu, 9 Mar 2023 09:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352472; bh=9WK/RYOdDN8jYjJ2u0bCEoAcrA0hVNT/F54n1VcFOUA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vdYWOA7FvcXfYksKPbOPnCrIhmULH6TZv9Jo1ZfUHOF/Ume3V+ETZmW2/cdx8+WeK gtYFWjzVJkzDWlpGVU9R6QgbOffx7/QOyRHajxALy3CGJDBuqj3oOdIe5ufsKSnfsY Hva9o9u6eUpRKTWAJ8NpHqhQxcC6w2WeRRs7d7zPfwePy5JkEbbFTCAmGXniCfws3t sa7HqHLKmcqL98iAX0HX4FpVkB5aR2XyM50rFiIyTyILBcN1nqxm7LHX7G7V9yCctt jpbYL0hB3lYvHjURhVcbrYyiuFq4cCExyKKtrjZBtEh1KwrNHbSFt/NQ6E4qodSYQZ ICRd5CVHFY/ew== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 10/10] dmicheck: fix the print format Date: Thu, 9 Mar 2023 17:00:18 +0800 Message-Id: <20230309090018.32029-10-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-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 --- 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 0c18e4d0..ebfc0c94 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1451,7 +1451,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Socket Designation", hdr, 0x4); if (((GET_UINT16(data + 0x05) >> 5) & 0x0003) == 0x2) fwts_failed(fw, LOG_LEVEL_HIGH, DMI_VALUE_OUT_OF_RANGE, - "Out of range value %x4.4" PRIx16 " " + "Out of range value 0x%4.4" PRIx16 " " "bits 5..6 set to illegal value 0x2, only allowed" "0x0, 0x1, 0x3 while accessing entry '%s' @ " "0x%8.8" PRIx32 ", field '%s', offset 0x%2.2x",