Ubuntu – Kernel error messages when booting Ubuntu 20.04

20.04acpibootkernel

This is my laptop: system X555UJ (ASUS-NotebookSKU); processor Intel(R) Core(TM) i7-6500U CPU @ 2.50G

I installed Ubuntu 20.04. I have 2 kernels: 5.4.0-26 and 5.4.0-28. I frequently got error messages when booting, so I ran some fwts tests. These are the results:

klog: Scan kernel log for errors and warnings.
-------------------------------------------------------------------------------- 
Test 1 of 1: Kernel log error check. Kernel message: [ 0.116558]

ADVICE: This is not exactly a failure but a warning from the kernel.
The MSR_IA32_ENERGY_PERF_BIAS was initialized and defaulted to a high
performance bias setting. The kernel has detected this and changed it
down to a 'normal' bias setting.

FAILED [HIGH] KlogAcpiExecFailure: Test 1, HIGH Kernel message: [
0.135632] ACPI Error: Skipping While/If block (20190816/psloop-427)

ADVICE: The kernel has most probably detected an error while executing
ACPI AML. The error lists the ACPI driver module and the line number
where the bug has been caught and the method that caused the error.

Kernel message: [ 0.166504] ACPI: [Firmware Bug]: BIOS _OSI(Linux)
query ignored

ADVICE: This is not exactly a failure mode but a warning from the
kernel. The
_OSI() method has implemented a match to the 'Linux' query in the DSDT and this is redundant because the ACPI driver matches onto the Windows
_OSI strings by default.

FAILED [HIGH] KlogAcpiFirmwareError: Test 1, HIGH Kernel message: [
0.428507] tpm_crb MSFT0101:00: [Firmware Bug]: ACPI region does not cover the entire command/response buffer. [mem 0xfed40000-0xfed4087f
flags 0x200] vs fed40080 f80 Message repeated 1 times.

ADVICE: The kernel has detected a Firmware bug in the BIOS or ACPI
which needs investigating and fixing.

FAILED [HIGH] KlogAcpiBadAmlCode: Test 1, HIGH Kernel message: [
43.756627] ACPI Warning: \_SB.PCI0.RP01.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package]
(20190816/nsarguments-59)

ADVICE: ACPI AML interpreter has found some non-conforming AML code.
This should be investigated and fixed.

FAILED [HIGH] KlogAsusWmiUnknownKeypressed: Test 1, HIGH Kernel
message: [> 3421.120372] asus_wmi: Unknown key cf pressed

ADVICE: The ASUS WMI driver has received an unknown key event. The
driver should handle this new key event or the firmware is reporting
an incorrect and unknown event.
Found 4 unique errors in kernel log.

================================================================================

I have only Ubuntu 20.04, nevertheless while booting the boot menu appears. I choose Ubuntu and afterwards I see this:

0139274 ACPI BIOS Error (bug): Could not resolve symbol NSB.PCIO.Rro1.r XSX), 
AE NOT FOUND 20190816 /psargs-330) 0374881 0139290 
ACPI Error: Skipping While/If block 20190816 /psloop-427) 
Initramfs unpacking failed: Decoding failed 0128427 tp_crb MSFT0101:00:
Firmware Bug]: ACPI region does not cover the entire command response buffer. 
dev/sda2: clean, 280598/30198816 files, 6158711121965056 blocks
sudo dmidecode -s bios-version:
X555UJ.303

I have 2 kernels: 5.4.0-26 and 5.4.0-28. The system boots even with the latest kernel, nevertheless while booting sometimes (not always) it shows the error messages I posted.

drwxr-xr-x  4 root root     4096 apr 29 07:46 .
drwxr-xr-x 20 root root     4096 apr 24 19:26 ..
-rw-r--r--  1 root root   237718 apr 20 18:33 config-5.4.0-26-generic
-rw-r--r--  1 root root   237718 apr 22 16:08 config-5.4.0-28-generic
drwx------  3 root root     4096 gen  1  1970 efi
drwxr-xr-x  4 root root     4096 apr 29 07:46 grub
lrwxrwxrwx  1 root root       27 apr 29 07:46 initrd.img -> initrd.img-5.4.0-28-generic
-rw-r--r--  1 root root 49454183 apr 24 19:34 initrd.img-5.4.0-26-generic
-rw-r--r--  1 root root 49450711 apr 29 07:46 initrd.img-5.4.0-28-generic
lrwxrwxrwx  1 root root       27 apr 24 19:21 initrd.img.old -> initrd.img-5.4.0-26-generic
-rw-r--r--  1 root root   182704 feb 14 00:09 memtest86+.bin
-rw-r--r--  1 root root   184380 feb 14 00:09 memtest86+.elf
-rw-r--r--  1 root root   184884 feb 14 00:09 memtest86+_multiboot.bin
-rw-------  1 root root  4736015 apr 20 18:33 System.map-5.4.0-26-generic
-rw-------  1 root root  4736015 apr 22 16:08 System.map-5.4.0-28-generic
lrwxrwxrwx  1 root root       24 apr 29 07:46 vmlinuz -> vmlinuz-5.4.0-28-generic
-rw-r--r--  1 root root 11657976 apr 23 09:48 vmlinuz-5.4.0-26-generic
-rw-------  1 root root 11657976 apr 22 16:43 vmlinuz-5.4.0-28-generic
lrwxrwxrwx  1 root root       24 apr 29 07:46 vmlinuz.old -> vmlinuz-5.4.0-26-generic

Best Answer

The error is issued from the Kernel's Trusted Platform Module Command Response Buffer Interface driver (see drivers/char/tpm/tpm_crb.c in the Linux source), function crb_fixup_cmd_size(). This states in a comment:

"Work around broken BIOSs that return inconsistent values from the ACPI region vs the registers. Trust the ACPI region. Such broken systems probably cannot send large TPM commands since the buffer will be truncated."

Basically the ACPI AML contains I/O resource information that informs the kernel where a I/O region exists but this information looks dubious and the kernel attempts to work around this.

Normally the DSTD or SSDT contain AML that describes the I/O region (base address and length). I suspect one of the _CRS ACPI objects with the TPM 2.0 _CID "MSFT0101" is incorrect. You can find these using:

sudo fwts crsdump -

On my laptop I have the following:

\_SB_.TPM_._CRS (32-Bit Fixed Memory Range Descriptor):
  0x0000: Tag Type                      : 0x01
  0x0000: Tag Item ID                   : 0x06
  0x0001: Length                        : 0x0009
  0x0003: Write Status                  : 0x00 (non-writeable, read-only)
  0x0004: Range Base Address            : 0xfed40000
  0x0008: Range Length                  : 0x00005000

Or disassemble the AML using:

sudo fwts --dis

usually in one of the SSDT tables you have the relevant object described in AML something like:

Scope (\_SB)
{
    Device (TPM)
    {
        Name (_HID, "STM7304")  // _HID: Hardware ID
        Noop
        Name (_CID, "MSFT0101" /* TPM 2.0 Security Device */)  // _CID: Compatible ID
        Name (_STR, Unicode ("TPM 2.0 Device"))  // _STR: Description String
        Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
        {
            Memory32Fixed (ReadOnly,
                0xFED40000,         // Address Base
                0x00005000,         // Address Length
                )
        })
 ...etc

I suspect the address length field on your machine is broken. Never mind, because the kernel spotted this and tried to fix it up.