From patchwork Tue Feb 12 01:51:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1040315 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 43z5Gm0D9qz9s3l; Tue, 12 Feb 2019 12:51:12 +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 1gtNE4-00070f-Ut; Tue, 12 Feb 2019 01:51:08 +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 1gtNE3-00070Z-Lb for fwts-devel@lists.ubuntu.com; Tue, 12 Feb 2019 01:51: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_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gtNE2-0008Ff-Uc; Tue, 12 Feb 2019 01:51:07 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH][V2] acpi/pptt: check flags by revision (mantis 1870 for ACPI 6.2b) Date: Mon, 11 Feb 2019 17:51:04 -0800 Message-Id: <20190212015104.18842-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.17.1 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/acpi/pptt/pptt.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/acpi/pptt/pptt.c b/src/acpi/pptt/pptt.c index ef1c50e8..2a399522 100644 --- a/src/acpi/pptt/pptt.c +++ b/src/acpi/pptt/pptt.c @@ -39,7 +39,7 @@ static int pptt_init(fwts_framework *fw) return FWTS_OK; } -static void pptt_processor_test(fwts_framework *fw, const fwts_acpi_table_pptt_processor *entry, bool *passed) +static void pptt_processor_test(fwts_framework *fw, const fwts_acpi_table_pptt_processor *entry, uint8_t rev, bool *passed) { fwts_log_info_verbatim(fw, " Processor hierarchy node structure (Type 0):"); fwts_log_info_verbatim(fw, " Type: 0x%2.2" PRIx8, entry->header.type); @@ -65,7 +65,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 (rev == 1) + fwts_acpi_reserved_bits_check(fw, "PPTT", "Flags", entry->flags, sizeof(entry->flags), 2, 31, passed); + else if (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 +117,12 @@ 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; entry = (fwts_acpi_table_pptt_header *) (table->data + sizeof(fwts_acpi_table_pptt)); offset = sizeof(fwts_acpi_table_pptt); @@ -131,7 +138,7 @@ static int pptt_test1(fwts_framework *fw) } if (entry->type == FWTS_ACPI_PPTT_PROCESSOR) { - pptt_processor_test(fw, (fwts_acpi_table_pptt_processor *) entry, &passed); + pptt_processor_test(fw, (fwts_acpi_table_pptt_processor *) entry, pptt->header.revision, &passed); type_length = sizeof(fwts_acpi_table_pptt_processor) + ((fwts_acpi_table_pptt_processor *) entry)->number_priv_resources * 4; } else if (entry->type == FWTS_ACPI_PPTT_CACHE) {