diff mbox series

[2/2] fwts-test: add regression tests for ASPT v2

Message ID 20250609072037.41119-2-ivan.hu@canonical.com
State Accepted
Headers show
Series [1/2] acpi: aspt: support for the aspt revision 2 | expand

Commit Message

AceLan Kao June 9, 2025, 7:20 a.m. UTC
Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 Makefile.am                           |  2 +
 fwts-test/aspt-0001/acpidump-0003.log | 33 +++++++++++++
 fwts-test/aspt-0001/acpidump-0004.log | 33 +++++++++++++
 fwts-test/aspt-0001/aspt-0001.log     | 31 ++++++++++---
 fwts-test/aspt-0001/aspt-0002.log     | 67 ++++++++++++++++++++++-----
 fwts-test/aspt-0001/aspt-0003.log     | 36 ++++++++++++++
 fwts-test/aspt-0001/aspt-0004.log     | 57 +++++++++++++++++++++++
 fwts-test/aspt-0001/test-0003.sh      | 23 +++++++++
 fwts-test/aspt-0001/test-0004.sh      | 23 +++++++++
 9 files changed, 288 insertions(+), 17 deletions(-)
 create mode 100644 fwts-test/aspt-0001/acpidump-0003.log
 create mode 100644 fwts-test/aspt-0001/acpidump-0004.log
 create mode 100644 fwts-test/aspt-0001/aspt-0003.log
 create mode 100644 fwts-test/aspt-0001/aspt-0004.log
 create mode 100755 fwts-test/aspt-0001/test-0003.sh
 create mode 100755 fwts-test/aspt-0001/test-0004.sh
diff mbox series

Patch

diff --git a/Makefile.am b/Makefile.am
index 306bac52..e997ba84 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,6 +94,8 @@  TESTS = fwts-test/acpidump-0001/test-0001.sh \
 	fwts-test/asf-0001/test-0002.sh \
 	fwts-test/aspt-0001/test-0001.sh \
 	fwts-test/aspt-0001/test-0002.sh \
+	fwts-test/aspt-0001/test-0003.sh \
+	fwts-test/aspt-0001/test-0004.sh \
 	fwts-test/bert-0001/test-0001.sh \
 	fwts-test/bert-0001/test-0002.sh \
 	fwts-test/bgrt-0001/test-0001.sh \
diff --git a/fwts-test/aspt-0001/acpidump-0003.log b/fwts-test/aspt-0001/acpidump-0003.log
new file mode 100644
index 00000000..3b70cf7c
--- /dev/null
+++ b/fwts-test/aspt-0001/acpidump-0003.log
@@ -0,0 +1,33 @@ 
+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                                      ....
+
+ASPT @ 0x00000000
+  0000: 41 53 50 54 70 00 00 00 02 c9 56 52 54 55 41 4c  ASPT......VRTUAL
+  0010: 4d 49 43 52 4f 53 46 54 01 00 00 00 49 4e 54 4c  MICROSFT....INTL
+  0020: 12 12 24 20 00 00 b0 fd 00 00 00 00 00 00 00 00  ..$ ...... .....
+  0030: 03 00 00 00 00 00 14 00 00 00 00 00 08 00 00 fe  ................
+  0040: 08 00 a0 fe 08 00 b0 fe 01 00 14 00 01 00 00 00  .......... .....
+  0050: 10 00 b0 fe 14 00 b0 fe 18 00 b0 fe 02 00 14 00  ........ .......
+  0060: 00 00 00 00 20 00 b0 fe 00 00 00 00 00 00 00 00  ...............
diff --git a/fwts-test/aspt-0001/acpidump-0004.log b/fwts-test/aspt-0001/acpidump-0004.log
new file mode 100644
index 00000000..7e14a2d9
--- /dev/null
+++ b/fwts-test/aspt-0001/acpidump-0004.log
@@ -0,0 +1,33 @@ 
+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                                      ....
+
+ASPT @ 0x00000000
+  0000: 41 53 50 54 70 00 00 00 02 c9 56 52 54 55 41 4c  ASPT......VRTUAL
+  0010: 4d 49 43 52 4f 53 46 54 01 00 00 00 49 4e 54 4c  MICROSFT....INTL
+  0020: 12 12 24 20 00 00 b0 fd 00 00 00 00 00 00 00 00  ..$ ...... .....
+  0030: 03 00 00 00 00 00 14 00 ff 00 00 00 08 00 00 fe  ................
+  0040: 08 00 a0 fe 08 00 b0 fe 01 00 14 00 e1 00 00 01  .......... .....
+  0050: 10 00 b0 fe 14 00 b0 fe 18 00 b0 fe 02 00 14 00  ........ .......
+  0060: 00 00 00 01 20 00 b0 fe 00 ff 00 00 00 01 00 00  ............... 
diff --git a/fwts-test/aspt-0001/aspt-0001.log b/fwts-test/aspt-0001/aspt-0001.log
index b35c02e4..858eb3c9 100644
--- a/fwts-test/aspt-0001/aspt-0001.log
+++ b/fwts-test/aspt-0001/aspt-0001.log
@@ -1,12 +1,31 @@ 
 aspt            aspt: ASPT Table test.
 aspt            ----------------------------------------------------------
 aspt            Test 1 of 1: ASPT Table test.
-aspt            ASPT Table:
-aspt              SPTT Start Address: 0x00000000
-aspt              SPTT End Address:   0x00000000
-aspt              AMRT Start Address: 0x00000000
-aspt              AMRT End Address:   0x00000000
-aspt            
+aspt            AMD Secure Processor Table:
+aspt              ASP Register Structure Count:    0x00000003
+aspt              ASP Global Registers:
+aspt                Type:                              0x0000
+aspt                Length:                            0x0020
+aspt                Reserved:                          0x00000000
+aspt                Feature Register Address:          0x00000000feb00000
+aspt                Interrupt Enable Register Address: 0x00000000feb00004
+aspt                Interrupt Status Register Address: 0x00000000feb00008
+aspt              SEV Mailbox Registers:
+aspt                Type:                              0x0001
+aspt                Length:                            0x0020
+aspt                Mailbox Interrupt ID:              0x01
+aspt                Reserved:
+aspt                  00 00 00 
+aspt                CmdResp Register Address:          0x00000000feb00010
+aspt                CmdBufAddr_Lo Register Address:    0x00000000feb00014
+aspt                CmdBufAddr_Hi Register Address:    0x00000000feb00018
+aspt              ACPI Mailbox Registers:
+aspt                Type:                              0x0002
+aspt                Length:                            0x0020
+aspt                Reserved:                          0x00000000
+aspt                CmdResp Register Address:          0x00000000feb00020
+aspt                Reserved:
+aspt                  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 aspt            PASSED: Test 1, No issues found in ASPT table.
 aspt            
 aspt            ==========================================================
diff --git a/fwts-test/aspt-0001/aspt-0002.log b/fwts-test/aspt-0001/aspt-0002.log
index 3cba29b8..4770624b 100644
--- a/fwts-test/aspt-0001/aspt-0002.log
+++ b/fwts-test/aspt-0001/aspt-0002.log
@@ -1,18 +1,63 @@ 
 aspt            aspt: ASPT Table test.
 aspt            ----------------------------------------------------------
 aspt            Test 1 of 1: ASPT Table test.
-aspt            ASPT Table:
-aspt              SPTT Start Address: 0xf0000020
-aspt              SPTT End Address:   0xf0000000
-aspt              AMRT Start Address: 0xe0000010
-aspt              AMRT End Address:   0xe0000000
-aspt            
-aspt            FAILED [HIGH] ASPTSpttEndError: Test 1, ASPT SPTT end
-aspt            address is less than the SPTT start address.
-aspt            FAILED [HIGH] ASPTAmrtEndError: Test 1, ASPT AMRT end
-aspt            address is less than the AMRT start address.
+aspt            AMD Secure Processor Table:
+aspt              ASP Register Structure Count:    0x00000003
+aspt              ASP Global Registers:
+aspt                Type:                              0x0000
+aspt                Length:                            0x0020
+aspt                Reserved:                          0x00000001
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be zero, got 0x00000001 instead
+aspt                Feature Register Address:          0x00000000feb00000
+aspt                Interrupt Enable Register Address: 0x00000000feb00004
+aspt                Interrupt Status Register Address: 0x00000000feb00008
+aspt              SEV Mailbox Registers:
+aspt                Type:                              0x0001
+aspt                Length:                            0x0020
+aspt                Mailbox Interrupt ID:              0xf1
+aspt            FAILED [HIGH] ASPTReservedBitsNonZero: Test 1, ASPT
+aspt            Mailbox Interrupt ID Bits [7..6] must be zero, got 0xf1
+aspt            instead
+aspt                Reserved:
+aspt                  00 02 00 
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be all zero, got below instead
+aspt              Reserved [00] = 0x00
+aspt              Reserved [01] = 0x02
+aspt              Reserved [02] = 0x00
+aspt                CmdResp Register Address:          0x00000000feb00010
+aspt                CmdBufAddr_Lo Register Address:    0x00000000feb00014
+aspt                CmdBufAddr_Hi Register Address:    0x00000000feb00018
+aspt              ACPI Mailbox Registers:
+aspt                Type:                              0x0002
+aspt                Length:                            0x0020
+aspt                Reserved:                          0x01000000
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be zero, got 0x01000000 instead
+aspt                CmdResp Register Address:          0x00000000feb00020
+aspt                Reserved:
+aspt                  00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be all zero, got below instead
+aspt              Reserved [00] = 0x00
+aspt              Reserved [01] = 0x00
+aspt              Reserved [02] = 0x00
+aspt              Reserved [03] = 0x00
+aspt              Reserved [04] = 0x00
+aspt              Reserved [05] = 0x00
+aspt              Reserved [06] = 0x00
+aspt              Reserved [07] = 0x00
+aspt              Reserved [08] = 0x00
+aspt              Reserved [09] = 0x00
+aspt              Reserved [10] = 0x00
+aspt              Reserved [11] = 0x00
+aspt              Reserved [12] = 0x00
+aspt              Reserved [13] = 0x00
+aspt              Reserved [14] = 0xff
+aspt              Reserved [15] = 0x00
 aspt            
 aspt            ==========================================================
-aspt            0 passed, 2 failed, 0 warning, 0 aborted, 0 skipped, 0
+aspt            0 passed, 5 failed, 0 warning, 0 aborted, 0 skipped, 0
 aspt            info only.
 aspt            ==========================================================
diff --git a/fwts-test/aspt-0001/aspt-0003.log b/fwts-test/aspt-0001/aspt-0003.log
new file mode 100644
index 00000000..8e077d74
--- /dev/null
+++ b/fwts-test/aspt-0001/aspt-0003.log
@@ -0,0 +1,36 @@ 
+aspt            aspt: ASPT Table test.
+aspt            ----------------------------------------------------------
+aspt            Test 1 of 1: ASPT Table test.
+aspt            AMD Secure Processor Table:
+aspt              ASP Register Base Address:       0x00000000fdb00000
+aspt              ASP Register Space Pages:        0x00000000
+aspt              ASP Register Structure Count:    0x00000003
+aspt              ASP Global Registers:
+aspt                Type:                             0x0000
+aspt                Length:                           0x0014
+aspt                Reserved:                         0x00000000
+aspt                Feature Register Offset:          0xfe000008
+aspt                Interrupt Enable Register Offset: 0xfea00008
+aspt                Interrupt Status Register Offset: 0xfeb00008
+aspt              SEV Mailbox Registers:
+aspt                Type:                             0x0001
+aspt                Length:                           0x0014
+aspt                Mailbox Interrupt ID:             0x01
+aspt                Reserved:
+aspt                  00 00 00 
+aspt                CmdResp Register Offset:          0xfeb00010
+aspt                CmdBufAddr_Lo Register Offset:    0xfeb00014
+aspt                CmdBufAddr_Hi Register Offset:    0xfeb00018
+aspt              ACPI Mailbox Registers:
+aspt                Type:                             0x0002
+aspt                Length:                           0x0014
+aspt                Reserved:                         0x00000000
+aspt                CmdResp Register Offset:          0xfeb00020
+aspt                Reserved:
+aspt                   00 00 00 00 00 00 00 00 
+aspt            PASSED: Test 1, No issues found in ASPT table.
+aspt            
+aspt            ==========================================================
+aspt            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
+aspt            info only.
+aspt            ==========================================================
diff --git a/fwts-test/aspt-0001/aspt-0004.log b/fwts-test/aspt-0001/aspt-0004.log
new file mode 100644
index 00000000..33ba8d89
--- /dev/null
+++ b/fwts-test/aspt-0001/aspt-0004.log
@@ -0,0 +1,57 @@ 
+aspt            aspt: ASPT Table test.
+aspt            ----------------------------------------------------------
+aspt            Test 1 of 1: ASPT Table test.
+aspt            AMD Secure Processor Table:
+aspt              ASP Register Base Address:       0x00000000fdb00000
+aspt              ASP Register Space Pages:        0x00000000
+aspt              ASP Register Structure Count:    0x00000003
+aspt              ASP Global Registers:
+aspt                Type:                             0x0000
+aspt                Length:                           0x0014
+aspt                Reserved:                         0x000000ff
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be zero, got 0x000000ff instead
+aspt                Feature Register Offset:          0xfe000008
+aspt                Interrupt Enable Register Offset: 0xfea00008
+aspt                Interrupt Status Register Offset: 0xfeb00008
+aspt              SEV Mailbox Registers:
+aspt                Type:                             0x0001
+aspt                Length:                           0x0014
+aspt                Mailbox Interrupt ID:             0xe1
+aspt            FAILED [HIGH] ASPTReservedBitsNonZero: Test 1, ASPT
+aspt            Mailbox Interrupt ID Bits [7..6] must be zero, got 0xe1
+aspt            instead
+aspt                Reserved:
+aspt                  00 00 01 
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be all zero, got below instead
+aspt              Reserved [00] = 0x00
+aspt              Reserved [01] = 0x00
+aspt              Reserved [02] = 0x01
+aspt                CmdResp Register Offset:          0xfeb00010
+aspt                CmdBufAddr_Lo Register Offset:    0xfeb00014
+aspt                CmdBufAddr_Hi Register Offset:    0xfeb00018
+aspt              ACPI Mailbox Registers:
+aspt                Type:                             0x0002
+aspt                Length:                           0x0014
+aspt                Reserved:                         0x01000000
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be zero, got 0x01000000 instead
+aspt                CmdResp Register Offset:          0xfeb00020
+aspt                Reserved:
+aspt                   00 FF 00 00 00 01 00 00 
+aspt            FAILED [MEDIUM] ASPTReservedNonZero: Test 1, ASPT Reserved
+aspt            field must be all zero, got below instead
+aspt              Reserved [00] = 0x00
+aspt              Reserved [01] = 0xff
+aspt              Reserved [02] = 0x00
+aspt              Reserved [03] = 0x00
+aspt              Reserved [04] = 0x00
+aspt              Reserved [05] = 0x01
+aspt              Reserved [06] = 0x00
+aspt              Reserved [07] = 0x00
+aspt            
+aspt            ==========================================================
+aspt            0 passed, 5 failed, 0 warning, 0 aborted, 0 skipped, 0
+aspt            info only.
+aspt            ==========================================================
diff --git a/fwts-test/aspt-0001/test-0003.sh b/fwts-test/aspt-0001/test-0003.sh
new file mode 100755
index 00000000..b3143664
--- /dev/null
+++ b/fwts-test/aspt-0001/test-0003.sh
@@ -0,0 +1,23 @@ 
+#!/bin/bash
+#
+TEST="Test acpitables against ASPT"
+NAME=test-0003.sh
+TMPLOG=$TMP/aspt.log.$$
+
+$FWTS --show-tests | grep ASPT > /dev/null
+if [ $? -eq 1 ]; then
+	echo SKIP: $TEST, $NAME
+	exit 77
+fi
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/aspt-0001/acpidump-0003.log aspt - | cut -c7- | grep "^aspt" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/aspt-0001/aspt-0003.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/aspt-0001/test-0004.sh b/fwts-test/aspt-0001/test-0004.sh
new file mode 100755
index 00000000..4d6ff889
--- /dev/null
+++ b/fwts-test/aspt-0001/test-0004.sh
@@ -0,0 +1,23 @@ 
+#!/bin/bash
+#
+TEST="Test acpitables against ASPT"
+NAME=test-0004.sh
+TMPLOG=$TMP/aspt.log.$$
+
+$FWTS --show-tests | grep ASPT > /dev/null
+if [ $? -eq 1 ]; then
+	echo SKIP: $TEST, $NAME
+	exit 77
+fi
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/aspt-0001/acpidump-0004.log aspt - | cut -c7- | grep "^aspt" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/aspt-0001/aspt-0004.log >> $FAILURE_LOG
+ret=$?
+if [ $ret -eq 0 ]; then
+	echo PASSED: $TEST, $NAME
+else
+	echo FAILED: $TEST, $NAME
+fi
+
+rm $TMPLOG
+exit $ret