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 */