From patchwork Sat Jun 30 00:55:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 937246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41HZp35GKkz9ry1; Sat, 30 Jun 2018 10:56:11 +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 1fZ4BN-0000XM-AJ; Sat, 30 Jun 2018 00:56:09 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fZ4BL-0000Wg-MW for fwts-devel@lists.ubuntu.com; Sat, 30 Jun 2018 00:56:07 +0000 Received: from 1.general.alexhung.us.vpn ([10.172.65.254] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fZ4BL-0003x6-4K; Sat, 30 Jun 2018 00:56:07 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/4] dmicheck: update Usage and Characteristics 2 fields in Type 9 Date: Fri, 29 Jun 2018 17:55:55 -0700 Message-Id: <1530320156-8606-4-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530320156-8606-1-git-send-email-alex.hung@canonical.com> References: <1530320156-8606-1-git-send-email-alex.hung@canonical.com> 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: , MIME-Version: 1.0 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 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 522f590..b508799 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1345,17 +1345,13 @@ static void dmicheck_entry(fwts_framework *fw, "field '%s', offset 0x%2.2x", data[0x5], table, addr, "Slot Type", 0x5); dmi_min_max_uint8_check(fw, table, addr, "Slot Data Bus Width", hdr, 0x6, 0x1, 0xe); - dmi_min_max_uint8_check(fw, table, addr, "Current Usage", hdr, 0x7, 0x1, 0x4); + dmi_min_max_uint8_check(fw, table, addr, "Current Usage", hdr, 0x7, 0x1, 0x5); dmi_min_max_uint8_check(fw, table, addr, "Slot Length", hdr, 0x8, 0x1, 0x6); if (hdr->length < 0x0d) break; - if (data[0xc] & 0xf8) - fwts_failed(fw, LOG_LEVEL_MEDIUM, DMI_RESERVED_VALUE_USED, - "Reserved bits 0x%2.2" PRIx8 " was used" - "bits 3..7 would be reserved while accessing entry '%s' @ " - "0x%8.8" PRIx32 ", field '%s', offset 0x%2.2x", - data[0xc], - table, addr, "Slot Characteristics 2", 0xc); + + dmi_reserved_bits_check(fw, table, addr, "Slot Characteristics 2", hdr, sizeof(uint8_t), 0x0c, 4, 7); + if (hdr->length < 0x11) break; if (!((data[0x5] == 0x06) ||