Kernel error messages when booting Ubuntu 20.04

5,072

Solution 1

Your BIOS is current @ 303.

For troubleshooting purposes, we need to try and automatically reboot to an older kernel, to see if we get error messages there too.

We'll modify GRUB such that it'll boot to the last chosen kernel that's been selected. This way we can try booting to 5.4.0-26 repeatably.

In terminal...

sudo -H gedit /etc/default/grub # edit this file, ignore any warning messages

At the top of this file, find the GRUB_ lines. Edit/add the following...

GRUB_DEFAULT=saved    # this is an edit, note the setting before the edit
GRUB_SAVEDEFAULT=true # this is an add

sudo update-grub # update GRUB

reboot # reboot the computer

At the GRUB menu, Additional Options menu, choose the -26 kernel. The system will continue to boot the -26 kernel until we change it via the GRUB menu. We need to determine if the errors also occur when using the -26 kernel.

Update #1:

IF we can prove that the errors don't occur when using the -26 kernel, we'll rebuild /boot/initrd.img-5.4.0-28-generic. More detail later.

Update #2:

IF the errors do NOT occur with the -26 kernel...

In terminal...

sudo update-initramfs -c -k 5.4.0-28-generic # rebuild /boot/initrd.img-5.4.0-28-generic

ls -al /boot | grep initrd* # add this output to question

reboot # and choose the normal "Ubuntu" choice at the GRUB menu

Solution 2

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.

Share:
5,072

Related videos on Youtube

Max.Tu
Author by

Max.Tu

Updated on September 18, 2022

Comments

  • Max.Tu
    Max.Tu over 1 year

    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
    
    
    • Boris Hamanov
      Boris Hamanov about 4 years
      Better to tell us where/when you see the messages, and what the messages are.
    • Boris Hamanov
      Boris Hamanov about 4 years
      Best to put that detail as an edit to your question, rather than in the comments. In the GRUB menu, Additional Options menu, do you have an older kernel that you can boot to? The problem is "Initramfs unpacking failed". We may have to rebuilt this. Also, show me sudo dmidecode -s bios-version and give me the exact make/model # of your computer.
    • Max.Tu
      Max.Tu about 4 years
      I answered (see last details in my question). Thanks
    • Boris Hamanov
      Boris Hamanov about 4 years
      Your BIOS is current. Boot to the GRUB menu. The 2nd line says "Additional Options". Choose it. A list of available kernels should display. An older kernal may be a choice. Choose it and see if it boots.
    • Max.Tu
      Max.Tu about 4 years
      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. I would like to fix the problems under the 5.4.0-28 kernel.
    • Boris Hamanov
      Boris Hamanov about 4 years
      Ah, that's important info that should go into your question. When you boot to the older kernel, do you still occasionally see the error messages? Edit your question and show me ls -al /boot. Do you know how to edit GRUB boot parameters on the fly, at boot time?
    • Max.Tu
      Max.Tu about 4 years
      I added ls -al\boot result. To edit GRUB boot parameters I shoud type "e", I suppose.
    • Boris Hamanov
      Boris Hamanov about 4 years
      You mis-typed the ls -al /boot command. There's a space in front of /boot. Please redo. Also, you didn't answer my question about getting errors when booting the older kernel. I need to know if the errors only occur on the new kernel, or both kernels. And yes, if we get to it, "e" is the correct way to edit grub at boot time. More later on that.
    • Boris Hamanov
      Boris Hamanov about 4 years
      Please see/do my answer. Report back after booting -26 a number of times, to determine if the errors occur there, or not.
    • Boris Hamanov
      Boris Hamanov about 4 years
      Status please...
  • Max.Tu
    Max.Tu about 4 years
    Dear @heynnema, as for now, the booting process of my pc is working fine, luckily. Thank you very much for your kind help!
  • Max.Tu
    Max.Tu about 4 years
    Dear @Colin Ian King, as for now, the booting process of my pc is working fine, luckily. Thank you very much for your kind help!
  • Boris Hamanov
    Boris Hamanov about 4 years
    @Max.Tu Did the update-initramfs command take care of the problem? I need to see the final ls -al command. If my answer was useful, please remember to accept it by clicking the checkmark icon that appears just to the left of my answer. Thanks!
  • Boris Hamanov
    Boris Hamanov about 4 years
    @Max.Tu Status please...
  • Boris Hamanov
    Boris Hamanov about 4 years
    @Max.Tu Status please...
  • Max.Tu
    Max.Tu about 4 years
    Sorry @heynnema, I did not adopt the advice because I switched to another distro. Thank you again and best regards!