From patchwork Fri Feb 8 03:23:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1038457 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-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43wgW36d7xz9sMl; Fri, 8 Feb 2019 14:23:27 +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 1grwlB-0004OO-Ek; Fri, 08 Feb 2019 03:23:25 +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 1grwl9-0004NU-DY for fwts-devel@lists.ubuntu.com; Fri, 08 Feb 2019 03:23:23 +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_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1grwl8-0003e5-Pt; Fri, 08 Feb 2019 03:23:23 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 02/14] acpi: pptt: check flags based on revision (mantis 1870 for ACPI 6.2b) Date: Thu, 7 Feb 2019 19:23:02 -0800 Message-Id: <20190208032314.15215-3-alex.hung@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190208032314.15215-1-alex.hung@canonical.com> References: <20190208032314.15215-1-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 --- src/acpi/pptt/pptt.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/acpi/pptt/pptt.c b/src/acpi/pptt/pptt.c index ef1c50e8..e0b7f446 100644 --- a/src/acpi/pptt/pptt.c +++ b/src/acpi/pptt/pptt.c @@ -25,6 +25,8 @@ static fwts_acpi_table_info *table; +static uint8_t table_rev; + static int pptt_init(fwts_framework *fw) { if (fwts_acpi_find_table(fw, "PPTT", 0, &table) != FWTS_OK) { @@ -65,7 +67,12 @@ static void pptt_processor_test(fwts_framework *fw, const fwts_acpi_table_pptt_p } fwts_acpi_reserved_zero_check(fw, "PPTT", "Reserved", entry->reserved, sizeof(entry->reserved), passed); - fwts_acpi_reserved_bits_check(fw, "PPTT", "Flags", entry->flags, sizeof(entry->flags), 2, 31, passed); + + if (table_rev == 1) + fwts_acpi_reserved_bits_check(fw, "PPTT", "Flags", entry->flags, sizeof(entry->flags), 2, 31, passed); + else if (table_rev == 2) + fwts_acpi_reserved_bits_check(fw, "PPTT", "Flags", entry->flags, sizeof(entry->flags), 5, 31, passed); + } static void pptt_cache_test(fwts_framework *fw, const fwts_acpi_table_pptt_cache *entry, bool *passed) @@ -112,10 +119,13 @@ static void pptt_id_test(fwts_framework *fw, const fwts_acpi_table_pptt_id *entr static int pptt_test1(fwts_framework *fw) { fwts_acpi_table_pptt_header *entry; - uint32_t offset; + fwts_acpi_table_pptt *pptt; bool passed = true; + uint32_t offset; fwts_log_info_verbatim(fw, "PPTT Processor Properties Topology Table:"); + pptt = (fwts_acpi_table_pptt *)table->data; + table_rev = pptt->header.revision; entry = (fwts_acpi_table_pptt_header *) (table->data + sizeof(fwts_acpi_table_pptt)); offset = sizeof(fwts_acpi_table_pptt);