From patchwork Fri Jul 6 14:42:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elliott, Robert (Servers)" X-Patchwork-Id: 940546 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=none (p=none dis=none) header.from=hpe.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 41McrK74lbz9s4V; Sat, 7 Jul 2018 00:42:09 +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 1fbRvz-0000yY-Ic; Fri, 06 Jul 2018 14:42:07 +0000 Received: from g4t3426.houston.hpe.com ([15.241.140.75]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1fbRvw-0000xr-BO for fwts-devel@lists.ubuntu.com; Fri, 06 Jul 2018 14:42:04 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g4t3426.houston.hpe.com (Postfix) with ESMTP id 184FF5A for ; Fri, 6 Jul 2018 14:42:03 +0000 (UTC) Received: from s17.americas.hpqcorp.net (s17.americas.hpqcorp.net [16.84.27.163]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id E5B4E62; Fri, 6 Jul 2018 14:42:02 +0000 (UTC) From: Robert Elliott To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] nfit: remove broken NFITBadLineOffsetAlignment check Date: Fri, 6 Jul 2018 09:42:55 -0500 Message-Id: <20180706144255.56986-2-elliott@hpe.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180706144255.56986-1-elliott@hpe.com> References: <20180706144255.56986-1-elliott@hpe.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" Remove the NFITBadLineOffsetAlignment check. Entries in the ACPI NFIT Interleave structure are in units of the line size, not values required to be multiples of the line size. So, the test fails incorrectly with these errors: NFIT Subtable: Type: 0x0002 Length: 0x0050 Interleave Structure Index: 0x000c Reserved: 0x0000 Number of Lines Described: 0x00000010 Line Size: 0x00000100 Line Offset: 0x00000000 Line Offset: 0x00000001 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000001 instead Line Offset: 0x00000002 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000002 instead Line Offset: 0x00000003 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000003 instead Line Offset: 0x00000004 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000004 instead Line Offset: 0x00000005 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000005 instead Line Offset: 0x00000006 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000006 instead Line Offset: 0x00000007 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000007 instead Line Offset: 0x00000008 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000008 instead Line Offset: 0x00000009 FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x00000009 instead Line Offset: 0x0000000a FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x0000000a instead Line Offset: 0x0000000b FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x0000000b instead Line Offset: 0x0000000c FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x0000000c instead Line Offset: 0x0000000d FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x0000000d instead Line Offset: 0x0000000e FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x0000000e instead Line Offset: 0x0000000f FAILED [HIGH] NFITBadLineOffsetAlignment: Test 1, NFIT Line Offset must be aligned nfit_struct->line_size, got 0x0000000f instead Instead, print the full SPA address offset alongside the Line Offset (by multiplying by the Line Size). NFIT Subtable: Type: 0x0002 Length: 0x0050 Interleave Structure Index: 0x000c Reserved: 0x0000 Number of Lines Described: 0x00000010 Line Size: 0x00000100 Line Offset: 0x00000000, SPA 0x0000000000000000 Line Offset: 0x00000001, SPA 0x0000000000000100 Line Offset: 0x00000002, SPA 0x0000000000000200 Line Offset: 0x00000003, SPA 0x0000000000000300 Line Offset: 0x00000004, SPA 0x0000000000000400 Line Offset: 0x00000005, SPA 0x0000000000000500 Line Offset: 0x00000006, SPA 0x0000000000000600 Line Offset: 0x00000007, SPA 0x0000000000000700 Line Offset: 0x00000008, SPA 0x0000000000000800 Line Offset: 0x00000009, SPA 0x0000000000000900 Line Offset: 0x0000000a, SPA 0x0000000000000a00 Line Offset: 0x0000000b, SPA 0x0000000000000b00 Line Offset: 0x0000000c, SPA 0x0000000000000c00 Line Offset: 0x0000000d, SPA 0x0000000000000d00 Line Offset: 0x0000000e, SPA 0x0000000000000e00 Line Offset: 0x0000000f, SPA 0x0000000000000f00 Fixes: d11965d8346b9525 ("add ACPI NFIT test") Signed-off-by: Robert Elliott Acked-by: Alex Hung Acked-by: Ivan Hu --- src/acpi/nfit/nfit.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c index 99231501..961e5f28 100644 --- a/src/acpi/nfit/nfit.c +++ b/src/acpi/nfit/nfit.c @@ -250,15 +250,11 @@ static int nfit_test1(fwts_framework *fw) break; } - for (i = 0; i < nfit_struct->line_count; i++) { - fwts_log_info_verbatim(fw, " Line Offset: 0x%8.8" PRIx32, nfit_struct->line_offset[i]); - - if (nfit_struct->line_offset[i] % nfit_struct->line_size) - fwts_failed(fw, LOG_LEVEL_HIGH, - "NFITBadLineOffsetAlignment", - "NFIT Line Offset must be aligned nfit_struct->line_size, got " - "0x%8.8" PRIx32 " instead", nfit_struct->line_offset[i]); - } + for (i = 0; i < nfit_struct->line_count; i++) + fwts_log_info_verbatim(fw, + " Line Offset: 0x%8.8" PRIx32 ", SPA 0x%16.16" PRIx64, + nfit_struct->line_offset[i], + (uint64_t) nfit_struct->line_offset[i] * nfit_struct->line_size); if (nfit_struct->reserved != 0) reserved_passed = nfit_struct->reserved;