启动 Ubuntu 20.04 时的内核错误消息

启动 Ubuntu 20.04 时的内核错误消息

这是我的笔记本电脑:系统 X555UJ (ASUS-NotebookSKU);处理器 Intel(R) Core(TM) i7-6500U CPU @ 2.50G

我安装了 Ubuntu 20.04。我有 2 个内核:5.4.0-26 和 5.4.0-28。启动时我经常收到错误消息,因此我运行了一些 fwts 测试。结果如下:

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.

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

我只有 Ubuntu 20.04,但在启动时会出现启动菜单。我选择 Ubuntu,然后看到以下内容:

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

我有 2 个内核:5.4.0-26 和 5.4.0-28。即使使用最新内核,系统也能启动,但有时(并非总是)启动时会显示我发布的错误消息。

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

答案1

该错误是由内核的可信平台模块命令响应缓冲区接口驱动程序(参见 Linux 源代码中的 drivers/char/tpm/tpm_crb.c)函数 crb_fixup_cmd_size() 发出的。注释中指出:

“解决损坏的 BIOS 问题,这些 BIOS 从 ACPI 区域返回的值与寄存器的值不一致。信任 ACPI 区域。此类损坏的系统可能无法发送大型 TPM 命令,因为缓冲区将被截断。”

基本上,ACPI AML 包含 I/O 资源信息,可告知内核 I/O 区域存在的位置,但这些信息看起来可疑,内核会尝试解决这个问题。

通常,DSTD 或 SSDT 包含描述 I/O 区域(基址和长度)的 AML。我怀疑 TPM 2.0 _CID 为“MSFT0101”的 _CRS ACPI 对象之一不正确。您可以使用以下方法找到它们:

sudo fwts crsdump -

我的笔记本电脑上有以下内容:

\_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

或者使用以下命令反汇编 AML:

sudo fwts --dis

通常在其中一个 SSDT 表中,您会找到用 AML 描述的相关对象,如下所示:

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

我怀疑你机器上的地址长度字段有问题。没关系,因为内核发现了这个问题并尝试修复它。

答案2

您的 BIOS 当前版本为@303。

为了进行故障排除,我们需要尝试自动重新启动到旧内核,看看是否也收到错误消息。

我们将修改 GRUB,使其启动到最后选择的内核。这样我们就可以重复尝试启动到 5.4.0-26。

terminal...

sudo -H gedit /etc/default/grub# 编辑此文件,忽略任何警告信息

在此文件的顶部,找到以下GRUB_行。编辑/添加以下内容...

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

sudo update-grub# 更新 GRUB

reboot# 重启计算机

在 GRUB 菜单的附加选项菜单中,选择 -26 内核。系统将继续引导 -26 内核,直到我们通过 GRUB 菜单更改它。我们需要确定使用 -26 内核时是否也会出现错误。

更新#1:

如果我们可以证明使用 -26 内核时不会发生错误,我们将重建/boot/initrd.img-5.4.0-28-generic。稍后将提供更多详细信息。

更新 #2:

如果错误不是由 -26 内核引起的...

terminal...

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

ls -al /boot | grep initrd*# 将此输出添加到问题中

reboot# 并在 GRUB 菜单中选择常规的“Ubuntu”选项

相关内容