While other ACPI tables include fixed fields and lengths, it doesn't mean their contents cannot go wrong. In fact, many systems have many incorrect ACPI tables in their firmware. This can happen when systems are developed by integrating code from various parties without being modified specifically for customised hardware.
A test suite is a good solution to catch errors without involving too many engineering resources as it can identify errors automatically or semi-automatically. In particular, Firmware Test Suite is one of the best test suite (did I also mention it is freely available too?) and it is the recommended ACPI SCT by UEFI forum, who is the owner of the specification.
What is Firmware Test Suite (FWTS) ?Firmware Test Suite (FWTS) is a test suite that performs sanity checks on firmware. It is intended to identify BIOS, UEFI, ACPI and many other errors and if appropriate it will try to explain the errors and give advice to help workaround or fix firmware bugs.
More information can be found at its official website.
Installation for Ubuntu Linux is as below:
- Add stable PPA for latest FWTS (optional) - sudo add-apt-repository ppa:firmware-testing-team/ppa-fwts-stable
- Install FWTS - sudo apt install fwts
Running Firmware Test Suite
FWTS is a command-line tool and its usage is "fwts cmds" (root access is usually required). The below is an example of checking FACP table
More test details can be found on its references.
Running Multiple Tests
FWTS can also run multiple tests by appending tests one after another as below:
Running All ACPI TestsFWTS provides a way to execute all tests in a category. For example, sudo fwts --acpitests run all ACPI tests all together. A similar command is sudo fwts --uefitests which will not be discussed in details here.
Let's See Some Examples...FWTS is used for real projects. Here are some examples of tests we have run.
Running fadt includes 6 tests that check whether system firmware/BIOS implements FACP table correctly.
Especially, the sizes of FACP table grow with ACPI specs, but some firmware/BIOS updates the FACP major and minor versions without adding the new fields in later ACPI spec. This can be caught by FWTS with ease. An example is Test 3 in results.log shown below.
Checking Table ChecksumAnother common error in system firmware/BIOS is ACPI table checksum. When built by AML compiler, ex. iasl, table checksum is updated; however, it is a common practice that system firmware/BIOS modifies ACPI tables for hardware customisation during boot time. This can corrupt table checksum if firmware/BIOS does not update it accordingly.
Below is an example to verify the checksum fields of all ACPI tables.