From patchwork Fri Jul 6 14:30:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 169479 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id C44CE2C0207 for ; Sat, 7 Jul 2012 00:30:26 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sn9Y9-0003hP-HW for incoming@patchwork.ozlabs.org; Fri, 06 Jul 2012 14:30:25 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sn9Y7-0003gr-P8 for fwts-devel@lists.ubuntu.com; Fri, 06 Jul 2012 14:30:23 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Sn9Y7-0004QA-KE for fwts-devel@lists.ubuntu.com; Fri, 06 Jul 2012 14:30:23 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/3] dmi_decode: Add some more advice text Date: Fri, 6 Jul 2012 15:30:20 +0100 Message-Id: <1341585020-24134-4-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1341585020-24134-1-git-send-email-colin.king@canonical.com> References: <1341585020-24134-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Ivan Hu --- src/dmi/dmi_decode/dmi_decode.c | 42 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/dmi/dmi_decode/dmi_decode.c b/src/dmi/dmi_decode/dmi_decode.c index 67dfea2..940ac35 100644 --- a/src/dmi/dmi_decode/dmi_decode.c +++ b/src/dmi/dmi_decode/dmi_decode.c @@ -162,6 +162,17 @@ static uint16_t dmi_remap_version(fwts_framework *fw, uint16_t old) return old; } +static void dmi_out_of_range_advice(fwts_framework *fw) +{ + fwts_advice(fw, + "A value that is out of range is incorrect and not conforming to " + "the SMBIOS specification. It is possible that it " + "won't be handled correctly by the operating system or by tools " + "like dmidecode. For some fields this out of range setings " + "could lead to the operating system to ignore or misunderstand this " + "particular SMBIOS configuration."); +} + static void dmi_min_max_uint8_check(fwts_framework *fw, const char *table, uint32_t addr, @@ -172,12 +183,14 @@ static void dmi_min_max_uint8_check(fwts_framework *fw, uint8_t max) { uint8_t val = hdr->data[offset]; - if ((val < min) || (val > max)) + if ((val < min) || (val > max)) { fwts_failed(fw, LOG_LEVEL_HIGH, DMI_VALUE_OUT_OF_RANGE, "Out of range value 0x%2.2x (range allowed 0x%2.2x..0x%2.2x) " "while accessing entry '%s' @ 0x%8.8x, field '%s', offset 0x%2.2x", val, min, max, table, addr, field, offset); + dmi_out_of_range_advice(fw); + } } static void dmi_min_max_mask_uint8_check(fwts_framework *fw, @@ -193,11 +206,13 @@ static void dmi_min_max_mask_uint8_check(fwts_framework *fw, { uint8_t val = (hdr->data[offset] >> shift) & mask; - if ((val < min) || (val > max)) + if ((val < min) || (val > max)) { fwts_failed(fw, LOG_LEVEL_HIGH, DMI_VALUE_OUT_OF_RANGE, "Out of range value 0x%2.2x (range allowed 0x%2.2x..0x%2.2x) " "while accessing entry '%s' @ 0x%8.8x, field '%s', offset 0x%2.2x", val, min, max, table, addr, field, offset); + dmi_out_of_range_advice(fw); + } } static void dmi_str_check_index(fwts_framework *fw, @@ -226,6 +241,11 @@ static void dmi_str_check_index(fwts_framework *fw, "Out of range string index 0x%2.2x while accessing entry '%s' " "@ 0x%8.8x, field '%s', offset 0x%2.2x", index, table, addr, field, offset); + fwts_advice(fw, + "DMI strings are stored in a manner that uses a special " + "index to fetch the Nth string from the data. For this " + "particular DMI string the index given is not in range " + "which means this particular entry is broken."); return; } @@ -247,6 +267,13 @@ static void dmi_str_check_index(fwts_framework *fw, "offset 0x%2.2x has a default value '%s' and probably has " "not been updated by the BIOS vendor.", index, table, addr, field, offset, data); + fwts_advice(fw, + "The DMI table contains data which is clearly been " + "left in a default setting and not been configured " + "for this machine. While this is not critical it does " + "mean that somebody has probably forgotten to define this " + "field and it basically means this field is effectively " + "useless."); } } } @@ -281,6 +308,13 @@ static void dmi_uuid_check(fwts_framework *fw, "offset 0x%2.2x has a default value '%s' and probably has " "not been updated by the BIOS vendor.", table, addr, field, offset, guid_str); + fwts_advice(fw, + "The DMI table contains a UUID which is clearly been " + "left in a default setting and not been configured " + "for this machine. While this is not critical it does " + "mean that somebody has probably forgotten to define this " + "field and it basically means this field is effectively " + "useless."); } } } @@ -377,6 +411,10 @@ static void dmi_decode_entry(fwts_framework *fw, "Incorrect Chassis Type " "SMBIOS Type 3 reports 0x%x", data[5]); + fwts_advice(fw, + "The Chassis Type in the ACPI FADT is out of range " + "and hence we cannot identify the preferred power " + "management profile for this machine."); break; }