From patchwork Thu Aug 3 07:43:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 797048 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=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3xNMW36mGdz9s75; Thu, 3 Aug 2017 17:43:43 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ddAnG-0006SZ-ON; Thu, 03 Aug 2017 07:43:42 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ddAn9-0006R1-0S for fwts-devel@lists.ubuntu.com; Thu, 03 Aug 2017 07:43:35 +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 1ddAn8-0006hC-AP; Thu, 03 Aug 2017 07:43:34 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] fwts-test: Add regression test for HMAT Date: Thu, 3 Aug 2017 00:43:28 -0700 Message-Id: <1501746208-21930-2-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501746208-21930-1-git-send-email-alex.hung@canonical.com> References: <1501746208-21930-1-git-send-email-alex.hung@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 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-bounces@lists.ubuntu.com Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- Makefile.am | 2 + fwts-test/hmat-0001/acpidump-0001.log | 38 ++++++++++++++++++ fwts-test/hmat-0001/acpidump-0002.log | 38 ++++++++++++++++++ fwts-test/hmat-0001/hmat-0001.log | 47 ++++++++++++++++++++++ fwts-test/hmat-0001/hmat-0002.log | 73 +++++++++++++++++++++++++++++++++++ fwts-test/hmat-0001/test-0001.sh | 23 +++++++++++ fwts-test/hmat-0001/test-0002.sh | 23 +++++++++++ 7 files changed, 244 insertions(+) create mode 100644 fwts-test/hmat-0001/acpidump-0001.log create mode 100644 fwts-test/hmat-0001/acpidump-0002.log create mode 100644 fwts-test/hmat-0001/hmat-0001.log create mode 100644 fwts-test/hmat-0001/hmat-0002.log create mode 100755 fwts-test/hmat-0001/test-0001.sh create mode 100755 fwts-test/hmat-0001/test-0002.sh diff --git a/Makefile.am b/Makefile.am index f16de80..546dbcf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,6 +96,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \ fwts-test/fpdt-0001/test-0002.sh \ fwts-test/hest-0001/test-0001.sh \ fwts-test/hest-0001/test-0002.sh \ + fwts-test/hmat-0001/test-0001.sh \ + fwts-test/hmat-0001/test-0002.sh \ fwts-test/iort-0001/test-0001.sh \ fwts-test/iort-0001/test-0002.sh \ fwts-test/klog-0001/test-0001.sh \ diff --git a/fwts-test/hmat-0001/acpidump-0001.log b/fwts-test/hmat-0001/acpidump-0001.log new file mode 100644 index 0000000..2d5c835 --- /dev/null +++ b/fwts-test/hmat-0001/acpidump-0001.log @@ -0,0 +1,38 @@ +FACS @ 0x00000000 + 0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 FACS@........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +FACP @ 0x00000000 + 0000: 46 41 43 50 f4 00 00 00 03 f9 41 4d 44 20 20 20 FACP......AMD + 0010: 47 55 41 4d 20 20 20 20 00 00 04 06 41 4d 44 20 GUAM ....AMD + 0020: 40 42 0f 00 c0 2f e9 af 92 47 e8 af 00 02 09 00 @B.../...G...... + 0030: b0 00 00 00 f0 f1 00 00 00 80 00 00 00 00 00 00 ................ + 0040: 04 80 00 00 00 00 00 00 00 82 00 00 08 80 00 00 ................ + 0050: 20 80 00 00 00 00 00 00 04 02 01 04 08 00 00 00 ............... + 0060: 65 00 e9 03 00 00 00 00 01 00 0d 00 32 00 00 00 e...........2... + 0070: a5 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 c0 2f e9 af 00 00 00 00 92 47 e8 af ...../.......G.. + 0090: 00 00 00 00 01 20 00 00 00 80 00 00 00 00 00 00 ..... .......... + 00a0: 00 00 00 00 00 00 00 00 00 00 00 00 01 10 00 00 ................ + 00b0: 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00c0: 00 00 00 00 01 08 00 00 00 82 00 00 00 00 00 00 ................ + 00d0: 01 20 00 00 08 80 00 00 00 00 00 00 01 40 00 00 . ...........@.. + 00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............... + 00f0: 00 00 00 00 .... + +HMAT @ 0x0000000000000000 + 0000: 48 4d 41 54 b6 00 00 00 00 60 49 4e 54 45 4c 20 HMAT.....`INTEL + 0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c TEMPLATE....INTL + 0020: 29 06 17 20 00 00 00 00 00 00 00 00 28 00 00 00 ).. ........(... + 0030: 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0050: 01 00 00 00 40 00 00 00 1f 05 00 00 02 00 00 00 ....@........... + 0060: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 00 00 01 00 02 00 03 00 04 00 05 00 ................ + 0090: 02 00 00 00 26 00 00 00 00 00 00 00 00 00 00 00 ....&........... + 00a0: 00 00 00 00 00 00 00 00 33 22 00 00 00 00 03 00 ........3"...... + 00b0: 00 00 01 00 02 00 ...... diff --git a/fwts-test/hmat-0001/acpidump-0002.log b/fwts-test/hmat-0001/acpidump-0002.log new file mode 100644 index 0000000..5464e81 --- /dev/null +++ b/fwts-test/hmat-0001/acpidump-0002.log @@ -0,0 +1,38 @@ +FACS @ 0x00000000 + 0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 FACS@........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +FACP @ 0x00000000 + 0000: 46 41 43 50 f4 00 00 00 03 f9 41 4d 44 20 20 20 FACP......AMD + 0010: 47 55 41 4d 20 20 20 20 00 00 04 06 41 4d 44 20 GUAM ....AMD + 0020: 40 42 0f 00 c0 2f e9 af 92 47 e8 af 00 02 09 00 @B.../...G...... + 0030: b0 00 00 00 f0 f1 00 00 00 80 00 00 00 00 00 00 ................ + 0040: 04 80 00 00 00 00 00 00 00 82 00 00 08 80 00 00 ................ + 0050: 20 80 00 00 00 00 00 00 04 02 01 04 08 00 00 00 ............... + 0060: 65 00 e9 03 00 00 00 00 01 00 0d 00 32 00 00 00 e...........2... + 0070: a5 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 c0 2f e9 af 00 00 00 00 92 47 e8 af ...../.......G.. + 0090: 00 00 00 00 01 20 00 00 00 80 00 00 00 00 00 00 ..... .......... + 00a0: 00 00 00 00 00 00 00 00 00 00 00 00 01 10 00 00 ................ + 00b0: 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00c0: 00 00 00 00 01 08 00 00 00 82 00 00 00 00 00 00 ................ + 00d0: 01 20 00 00 08 80 00 00 00 00 00 00 01 40 00 00 . ...........@.. + 00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............... + 00f0: 00 00 00 00 .... + +HMAT @ 0x0000000000000000 + 0000: 48 4d 41 54 b6 00 00 00 00 36 49 4e 54 45 4c 20 HMAT.....6INTEL + 0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c TEMPLATE....INTL + 0020: 29 06 17 20 00 00 00 00 00 00 01 00 28 00 00 00 ).. ........(... + 0030: 0f 00 02 00 00 00 00 00 00 00 00 00 03 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0050: 01 00 04 00 40 00 00 00 3f 06 05 00 02 00 00 00 ....@...?....... + 0060: 03 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 ................ + 0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 00 00 01 00 02 00 03 00 04 00 05 00 ................ + 0090: 02 00 07 00 26 00 00 00 00 00 00 00 08 00 00 00 ....&........... + 00a0: 00 00 00 00 00 00 00 00 33 23 00 00 09 00 03 00 ........3#...... + 00b0: 00 00 01 00 02 00 ...... diff --git a/fwts-test/hmat-0001/hmat-0001.log b/fwts-test/hmat-0001/hmat-0001.log new file mode 100644 index 0000000..d78484b --- /dev/null +++ b/fwts-test/hmat-0001/hmat-0001.log @@ -0,0 +1,47 @@ +hmat hmat: HMAT Heterogeneous Memory Attribute Table test. +hmat ---------------------------------------------------------- +hmat Test 1 of 1: Validate HMAT table. +hmat HMAT Heterogeneous Memory Attribute Table: +hmat Reserved: 0x00 +hmat Memory Subsystem Address Range (Type 0): +hmat Type: 0x0000 +hmat Reserved: 0x0000 +hmat Length: 0x00000028 +hmat Flags: 0x0007 +hmat Reserved: 0x0000 +hmat Processor Proximity Domain: 0x00000000 +hmat Memory Proximity Domain: 0x00000000 +hmat Reserved: 0x00000000 +hmat System Phy Addr Range Base: 0x0000000000000000 +hmat System Phy Addr Range Length: 0x0000000000000000 +hmat +hmat System Locality Latency and Bandwidth Information (Type 1): +hmat Type: 0x0001 +hmat Reserved: 0x0000 +hmat Length: 0x00000040 +hmat Flags: 0x1f +hmat Data Type: 0x05 +hmat Reserved: 0x0000 +hmat Number of Initiator PDs: 0x00000002 +hmat Number of Target PDs: 0x00000003 +hmat Reserved: 0x00000000 +hmat Entry Base Unit: 0x0000000000000000 +hmat +hmat Memory Side Cache Information (Type 2): +hmat Type: 0x0002 +hmat Reserved: 0x0000 +hmat Length: 0x00000026 +hmat Memory Proximity Domain: 0x00000000 +hmat Reserved: 0x00000000 +hmat Memory Side Cache Size: 0x0000000000000000 +hmat Cache Attributes: 0x00002233 +hmat Reserved: 0x0000 +hmat Number of SMBIOS Handles: 0x0003 +hmat +hmat +hmat PASSED: Test 1, No issues found in HMAT table. +hmat +hmat ========================================================== +hmat 1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0 +hmat info only. +hmat ========================================================== diff --git a/fwts-test/hmat-0001/hmat-0002.log b/fwts-test/hmat-0001/hmat-0002.log new file mode 100644 index 0000000..2394c28 --- /dev/null +++ b/fwts-test/hmat-0001/hmat-0002.log @@ -0,0 +1,73 @@ +hmat hmat: HMAT Heterogeneous Memory Attribute Table test. +hmat ---------------------------------------------------------- +hmat Test 1 of 1: Validate HMAT table. +hmat HMAT Heterogeneous Memory Attribute Table: +hmat Reserved: 0x00 +hmat Memory Subsystem Address Range (Type 0): +hmat Type: 0x0000 +hmat Reserved: 0x0001 +hmat Length: 0x00000028 +hmat Flags: 0x000f +hmat Reserved: 0x0002 +hmat Processor Proximity Domain: 0x00000000 +hmat Memory Proximity Domain: 0x00000000 +hmat Reserved: 0x00000003 +hmat System Phy Addr Range Base: 0x0000000000000000 +hmat System Phy Addr Range Length: 0x0000000000000000 +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x0001 instead +hmat FAILED [HIGH] HMATBadFlags: Test 1, HMAT Flags's +hmat Bits[15..3] must be zero, got 0x000f instead +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x0002 instead +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x00000003 instead +hmat +hmat System Locality Latency and Bandwidth Information (Type 1): +hmat Type: 0x0001 +hmat Reserved: 0x0004 +hmat Length: 0x00000040 +hmat Flags: 0x3f +hmat Data Type: 0x06 +hmat Reserved: 0x0005 +hmat Number of Initiator PDs: 0x00000002 +hmat Number of Target PDs: 0x00000003 +hmat Reserved: 0x00000006 +hmat Entry Base Unit: 0x0000000000000000 +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x0004 instead +hmat FAILED [CRITICAL] HMATBadFlags: Test 1, HMAT Flags's +hmat Bits[7..5] must be zero, got 0x3f instead +hmat FAILED [CRITICAL] HMATBadFDataType: Test 1, HMAT Data Type +hmat must be 0..5, got 0x06 instead +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x0005 instead +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x00000006 instead +hmat +hmat Memory Side Cache Information (Type 2): +hmat Type: 0x0002 +hmat Reserved: 0x0007 +hmat Length: 0x00000026 +hmat Memory Proximity Domain: 0x00000000 +hmat Reserved: 0x00000008 +hmat Memory Side Cache Size: 0x0000000000000000 +hmat Cache Attributes: 0x00002333 +hmat Reserved: 0x0009 +hmat Number of SMBIOS Handles: 0x0003 +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x0007 instead +hmat FAILED [CRITICAL] HMATBadCacheAttributeReserved: Test 1, +hmat HMAT Cache Attribute reserved values are used, got +hmat 0x00002333 instead +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x00000008 instead +hmat FAILED [LOW] HMATReservedNonZero: Test 1, HMAT reserved +hmat field must be zero, got 0x0009 instead +hmat +hmat +hmat +hmat ========================================================== +hmat 0 passed, 13 failed, 0 warning, 0 aborted, 0 skipped, 0 +hmat info only. +hmat ========================================================== diff --git a/fwts-test/hmat-0001/test-0001.sh b/fwts-test/hmat-0001/test-0001.sh new file mode 100755 index 0000000..a64eb57 --- /dev/null +++ b/fwts-test/hmat-0001/test-0001.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test acpitables against HMAT" +NAME=test-0001.sh +TMPLOG=$TMP/hmat.log.$$ + +$FWTS --show-tests | grep hmat > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/hmat-0001/acpidump-0001.log hmat - | cut -c7- | grep "^hmat" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/hmat-0001/hmat-0001.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret diff --git a/fwts-test/hmat-0001/test-0002.sh b/fwts-test/hmat-0001/test-0002.sh new file mode 100755 index 0000000..7d15fb8 --- /dev/null +++ b/fwts-test/hmat-0001/test-0002.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test acpitables against invalid HMAT" +NAME=test-0001.sh +TMPLOG=$TMP/hmat.log.$$ + +$FWTS --show-tests | grep hmat > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/hmat-0001/acpidump-0002.log hmat - | cut -c7- | grep "^hmat" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/hmat-0001/hmat-0002.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret