Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after 6.4.9-zen, tpm was broken #323

Closed
nerimoe opened this issue Aug 12, 2023 · 9 comments
Closed

after 6.4.9-zen, tpm was broken #323

nerimoe opened this issue Aug 12, 2023 · 9 comments

Comments

@nerimoe
Copy link

nerimoe commented Aug 12, 2023

archlinux linux-zen 6.4.10
tpm2.0

图片

and dmesg shows this message
Aug 12 23:00:00 archlinux kernel: tpm_crb: probe of MSFT0101:00 failed with error 378

@nerimoe
Copy link
Author

nerimoe commented Aug 12, 2023

with linux kernel
图片

@damentz
Copy link
Member

damentz commented Aug 12, 2023

You didn't provide information about your system, so I can only assume you're on AMD due to:

4f58e96
7828676

v6.4.11 is slated to remove fTPM support for hwrng, and also any current supported LTS kernels.

@damentz
Copy link
Member

damentz commented Aug 12, 2023

Closing, if you provide any useful info we can reopen if what I assumed is not the case.

@damentz damentz closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2023
@nerimoe
Copy link
Author

nerimoe commented Aug 12, 2023

图片
lenovo ideapad s540 with i7 10710u

@AzureZeng
Copy link

AzureZeng commented Aug 12, 2023

Reproducible in my laptop
image

# azurezeng @ azw-arch-sys in ~ [0:00:45] 
$ journalctl -k --grep=tpm
Aug 12 23:49:59 azw-arch-sys kernel: efi: ACPI=0x99c4d000 ACPI 2.0=0x99c4d014 TPMFinalLog=0x99b79000 ESRT=0x97de1018 SMBIOS=0x97de0000 SMBIOS 3.0=0x97dde000 MOKvar=0x97da3000 
Aug 12 23:49:59 azw-arch-sys kernel: ACPI: TPM2 0x0000000099C38000 000034 (v03 ACRSYS ACRPRDCT 00000002 1025 00040000)
Aug 12 23:49:59 azw-arch-sys kernel: ACPI: Reserving TPM2 table memory at [mem 0x99c38000-0x99c38033]
Aug 12 23:49:59 azw-arch-sys kernel: tpm_crb: probe of MSFT0101:00 failed with error 378
Aug 12 23:49:59 azw-arch-sys systemd[1]: systemd 254.1-1-arch running in system mode (+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified)
Aug 12 23:49:59 azw-arch-sys systemd[1]: TPM2 PCR Machine ID Measurement was skipped because of an unmet condition check (ConditionPathExists=/sys/firmware/efi/efivars/StubPcrKernelImage-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f).
# azurezeng @ azw-arch-sys in ~ [0:01:12] C:1
$ sudo dmesg | grep tpm_crb -A 10
[    0.398635] tpm_crb: probe of MSFT0101:00 failed with error 378
[    0.398652] AMD-Vi: AMD IOMMUv2 functionality not available on this system - This is not a bug.
[    0.398948] ahci 0000:00:17.0: version 3.0
[    0.409217] ahci 0000:00:17.0: AHCI 0001.0301 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
[    0.409221] ahci 0000:00:17.0: flags: 64bit ncq sntf pm clo only pio slum part ems deso sadm sds apst 
[    0.409495] scsi host0: ahci
[    0.409553] ata1: SATA max UDMA/133 abar m2048@0xa1493000 port 0xa1493100 irq 126
[    0.409775] ACPI: bus type drm_connector registered
[    0.410337] usbcore: registered new interface driver usbserial_generic
[    0.410341] usbserial: USB Serial support registered for generic
[    0.410407] rtc_cmos 00:03: RTC can wake from S4

Using linux kernel can solve this bug, so it is certain that this bug is from linux-zen kernel.

@damentz

@damentz
Copy link
Member

damentz commented Aug 12, 2023

I see, seems to be unrelated to AMD, will reopen.

@damentz damentz reopened this Aug 12, 2023
damentz added a commit that referenced this issue Aug 12, 2023
Potentially incomplete patch prompting GitHub issue [1]. Revert since
complete set of patches are in next stable release (v6.4.11).

[1] #323

This reverts commit 7828676.
damentz added a commit that referenced this issue Aug 12, 2023
Revert TPM patch that potentially had side effects per GitHub issue:
#323
@damentz
Copy link
Member

damentz commented Aug 12, 2023

Per the comments in the merge and revert, the cherry picked fix may have been incomplete and depend on other code, so we'll just revert it and wait for the complete set of stable patches in v6.4.11.

This may not be the solution either, but it's the only way we deviated from upstream wrt TPM.

@Hazmi35
Copy link

Hazmi35 commented Aug 12, 2023

Got the same problem in my Intel Laptop, my AMD Desktop doesn't have this issue. linux from Arch doesn't have the problem too, I also get the same tpm_crb: probe of MSFT0101:00 failed with error 378 message.

Staying on v6.4.8 right now.

@nerimoe
Copy link
Author

nerimoe commented Aug 13, 2023

solved in 6.4.10-zen2

@nerimoe nerimoe closed this as completed Aug 13, 2023
heftig pushed a commit that referenced this issue Mar 27, 2024
[ Upstream commit a853450 ]

When calling crypto_finalize_request, BH should be disabled to avoid
triggering the following calltrace:

    ------------[ cut here ]------------
    WARNING: CPU: 2 PID: 74 at crypto/crypto_engine.c:58 crypto_finalize_request+0xa0/0x118
    Modules linked in: cryptodev(O)
    CPU: 2 PID: 74 Comm: firmware:zynqmp Tainted: G           O       6.8.0-rc1-yocto-standard #323
    Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
    pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    pc : crypto_finalize_request+0xa0/0x118
    lr : crypto_finalize_request+0x104/0x118
    sp : ffffffc085353ce0
    x29: ffffffc085353ce0 x28: 0000000000000000 x27: ffffff8808ea8688
    x26: ffffffc081715038 x25: 0000000000000000 x24: ffffff880100db00
    x23: ffffff880100da80 x22: 0000000000000000 x21: 0000000000000000
    x20: ffffff8805b14000 x19: ffffff880100da80 x18: 0000000000010450
    x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
    x14: 0000000000000003 x13: 0000000000000000 x12: ffffff880100dad0
    x11: 0000000000000000 x10: ffffffc0832dcd08 x9 : ffffffc0812416d8
    x8 : 00000000000001f4 x7 : ffffffc0830d2830 x6 : 0000000000000001
    x5 : ffffffc082091000 x4 : ffffffc082091658 x3 : 0000000000000000
    x2 : ffffffc7f9653000 x1 : 0000000000000000 x0 : ffffff8802d20000
    Call trace:
     crypto_finalize_request+0xa0/0x118
     crypto_finalize_aead_request+0x18/0x30
     zynqmp_handle_aes_req+0xcc/0x388
     crypto_pump_work+0x168/0x2d8
     kthread_worker_fn+0xfc/0x3a0
     kthread+0x118/0x138
     ret_from_fork+0x10/0x20
    irq event stamp: 40
    hardirqs last  enabled at (39): [<ffffffc0812416f8>] _raw_spin_unlock_irqrestore+0x70/0xb0
    hardirqs last disabled at (40): [<ffffffc08122d208>] el1_dbg+0x28/0x90
    softirqs last  enabled at (36): [<ffffffc080017dec>] kernel_neon_begin+0x8c/0xf0
    softirqs last disabled at (34): [<ffffffc080017dc0>] kernel_neon_begin+0x60/0xf0
    ---[ end trace 0000000000000000 ]---

Fixes: 4d96f7d ("crypto: xilinx - Add Xilinx AES driver")
Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
damentz pushed a commit that referenced this issue Mar 27, 2024
[ Upstream commit a853450 ]

When calling crypto_finalize_request, BH should be disabled to avoid
triggering the following calltrace:

    ------------[ cut here ]------------
    WARNING: CPU: 2 PID: 74 at crypto/crypto_engine.c:58 crypto_finalize_request+0xa0/0x118
    Modules linked in: cryptodev(O)
    CPU: 2 PID: 74 Comm: firmware:zynqmp Tainted: G           O       6.8.0-rc1-yocto-standard #323
    Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
    pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    pc : crypto_finalize_request+0xa0/0x118
    lr : crypto_finalize_request+0x104/0x118
    sp : ffffffc085353ce0
    x29: ffffffc085353ce0 x28: 0000000000000000 x27: ffffff8808ea8688
    x26: ffffffc081715038 x25: 0000000000000000 x24: ffffff880100db00
    x23: ffffff880100da80 x22: 0000000000000000 x21: 0000000000000000
    x20: ffffff8805b14000 x19: ffffff880100da80 x18: 0000000000010450
    x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
    x14: 0000000000000003 x13: 0000000000000000 x12: ffffff880100dad0
    x11: 0000000000000000 x10: ffffffc0832dcd08 x9 : ffffffc0812416d8
    x8 : 00000000000001f4 x7 : ffffffc0830d2830 x6 : 0000000000000001
    x5 : ffffffc082091000 x4 : ffffffc082091658 x3 : 0000000000000000
    x2 : ffffffc7f9653000 x1 : 0000000000000000 x0 : ffffff8802d20000
    Call trace:
     crypto_finalize_request+0xa0/0x118
     crypto_finalize_aead_request+0x18/0x30
     zynqmp_handle_aes_req+0xcc/0x388
     crypto_pump_work+0x168/0x2d8
     kthread_worker_fn+0xfc/0x3a0
     kthread+0x118/0x138
     ret_from_fork+0x10/0x20
    irq event stamp: 40
    hardirqs last  enabled at (39): [<ffffffc0812416f8>] _raw_spin_unlock_irqrestore+0x70/0xb0
    hardirqs last disabled at (40): [<ffffffc08122d208>] el1_dbg+0x28/0x90
    softirqs last  enabled at (36): [<ffffffc080017dec>] kernel_neon_begin+0x8c/0xf0
    softirqs last disabled at (34): [<ffffffc080017dc0>] kernel_neon_begin+0x60/0xf0
    ---[ end trace 0000000000000000 ]---

Fixes: 4d96f7d ("crypto: xilinx - Add Xilinx AES driver")
Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants