LS1043a and TPM 2.0 , kernel panic on reboot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1043a and TPM 2.0 , kernel panic on reboot

862 Views
florian_manoel
Contributor I

Hi NXP community,

I am trying to start up a Trusted Platform Module (TPM) 2.0 on our custom board based on the Layerscape LS1043a.
I am currently to the point where the TPM is functional, I can use it in U-Boot and in Linux using the 'tpm2-tools'.

However, evey time I execute the command 'reboot', it ends into a 'kernel panic'.

The logs of the kernel panic :
"
root@lpe9403-VPM7001303:/home/admin# reboot
[ OK ] Stopped Syncronise system …ardware clock every 5 minutes.
[ OK ] Stopped Daily Cleanup of Temporary Directories.
Stopping OpenBSD Secure Shell server...
[ OK ] Stopped target Login Prompts.
Stopping Serial Getty on ttyS0...
Stopping Getty on tty1...
Stopping SFP daemon...
Stopping Link Layer Discovery Protocol Agent Daemon....
Stopping Event Manager service...
Stopping Temperature Monitor service...
Stopping Simple Network Ma…ent Protocol (SNMP) Daemon....
Stopping Fail2Ban Service...
Stopping DCP daemon...
[ OK ] Stopped Firmware Update Confirmation.
Stopping containerd container runtime...
[ OK ] Stopped Temperature Monitor service.
[ OK ] Stopped Event Manager service.
[ OK ] Stopped SFP daemon.
[ OK ] Stopped Wait for Network to be Configured.
[ OK ] Stopped DCP daemon.
[ OK ] Stopped Link Layer Discovery Protocol Agent Daemon..
[ OK ] Stopped Simple Network Man…ement Protocol (SNMP) Daemon..
[ OK ] Stopped containerd container runtime.
[ OK ] Stopped Serial Getty on ttyS0.
[ OK ] Stopped Getty on tty1.
[ OK ] Stopped Wait for ntpd to synchronize system clock.
[ OK ] Stopped OpenBSD Secure Shell server.
Stopping Network Time Service...
[ OK ] Removed slice system-getty.slice.
[ OK ] Removed slice system-serial\x2dgetty.slice.
[ OK ] Stopped Network Time Service.
[ OK ] Stopped target Host and Network Name Lookups.
[ OK ] Stopped Fail2Ban Service.
[ OK ] Stopped Session 1 of user admin.
Stopping User Manager for UID 1000...
Stopping Login Service...
[ OK ] Stopped User Manager for UID 1000.
Stopping User Runtime Directory /run/user/1000...
[ OK ] Stopped Login Service.
[ OK ] Unmounted /run/user/1000.
[ OK ] Stopped User Runtime Directory /run/user/1000.
[ OK ] Removed slice User Slice of UID 1000.
Stopping Permit User Sessions...
[ OK ] Stopped Permit User Sessions.
[ OK ] Stopped target Network.
Stopping Network Name Resolution...
[ OK ] Stopped target Remote File Systems.
[ OK ] Stopped Network Name Resolution.
Stopping Network Service...
[ OK ] Stopped Network Service.
[ OK ] Stopped target Network (Pre).
Stopping firewalld - dynamic firewall daemon...
[ OK ] Stopped firewalld - dynamic firewall daemon.
Stopping D-Bus System Message Bus...
[ OK ] Stopped D-Bus System Message Bus.
[ OK ] Stopped target Basic System.
[ OK ] Stopped target Slices.
[ OK ] Removed slice User and Session Slice.
[ OK ] Stopped target Paths.
[ OK ] Stopped target Sockets.
[ OK ] Closed Docker Socket for the API.
[ OK ] Closed lldpad.socket.
[ OK ] Closed SWUpdate socket listener.
[ OK ] Closed sfw_manager socket listener.
[ OK ] Closed D-Bus System Message Bus Socket.
[ OK ] Stopped target System Initialization.
Stopping Update UTMP about System Boot/Shutdown...
[ OK ] Stopped Apply Kernel Variables.
Stopping Load/Save Random Seed...
[ OK ] Stopped target Swap.
[ OK ] Stopped Load Kernel Modules.
[ OK ] Stopped target Local Encrypted Volumes.
[ OK ] Stopped Dispatch Password …ts to Console Directory Watch.
[ OK ] Stopped Forward Password R…uests to Wall Directory Watch.
[ OK ] Stopped Load/Save Random Seed.
[ OK ] Stopped Update UTMP about System Boot/Shutdown.
[ OK ] Stopped Create Volatile Files and Directories.
[ OK ] Stopped target Local File Systems.
Unmounting /etc...
Unmounting /var/log...
Unmounting Home mount userdata...
[ OK ] Unmounted /etc.
[ OK ] Unmounted /var/log.
[ OK ] Unmounted Home mount userdata.
Unmounting /userdata...
[ OK ] Unmounted /userdata.
[ OK ] Reached target Unmount All Filesystems.
[ OK ] Stopped target Local File Systems (Pre).
[ OK ] Stopped Create Static Device Nodes in /dev.
[ OK ] Stopped Create System Users.
[ OK ] Stopped Remount Root and Kernel File Systems.
[ OK ] Reached target Shutdown.
[ OK ] Reached target Final Step.
[ OK ] Started Reboot.
[ OK ] Reached target Reboot.
[ 90.381101] watchdog: watchdog0: watchdog did not stop!
[ 90.390289] systemd-shutdow: 24 output lines suppressed due to ratelimiting
[ 90.433801] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 90.441698] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[ 90.457027] systemd-journald[240]: Received SIGTERM from PID 1 (systemd-shutdow).
[ 90.489771] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[ 90.503171] systemd-shutdown[1]: Hardware watchdog 'GPIO Watchdog', version 0
[ 90.512557] systemd-shutdown[1]: Unmounting file systems.
[ 90.521022] [559]: Remounting '/' read-only in with options '(null)'.
[ 90.542076] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)
[ 90.553954] systemd-shutdown[1]: All filesystems unmounted.
[ 90.559561] systemd-shutdown[1]: Deactivating swaps.
[ 90.564687] systemd-shutdown[1]: All swaps deactivated.
[ 90.569934] systemd-shutdown[1]: Detaching loop devices.
[ 90.578780] systemd-shutdown[1]: All loop devices detached.
[ 90.703456] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000058
[ 90.712252] Mem abort info:
[ 90.715055] ESR = 0x96000005
[ 90.718117] Exception class = DABT (current EL), IL = 32 bits
[ 90.724045] SET = 0, FnV = 0
[ 90.727107] EA = 0, S1PTW = 0
[ 90.730256] Data abort info:
[ 90.733143] ISV = 0, ISS = 0x00000005
[ 90.736987] CM = 0, WnR = 0
[ 90.739949] user pgtable: 4k pages, 39-bit VAs, pgdp = 00000000e614ca82
[ 90.746571] [0000000000000058] pgd=0000000000000000, pud=0000000000000000
[ 90.753371] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 90.758935] Modules linked in: xt_tcpudp(E) ip6t_rpfilter(E) ip6t_REJECT(E) nf_reject_ipv6(E) ipt_REJECT(E) nf_reject_ipv4(E) xt_conntrack(E) nft_counter(E) nft_chain_nat_ipv6(E) nf_nat_ipv6(E) nft_chain_route_ipv6(E) nft_chain_nat_ipv4(E) nf_nat_ipv4(E) nf_nat(E) nft_chain_route_ipv4(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) ip6_tables(E) nft_compat(E) nf_tables(E) nfnetlink(E) audis_info(OE) ip_tables(E) x_tables(E)
[ 90.797087] Process systemd-shutdow (pid: 1, stack limit = 0x00000000b81cffbb)
[ 90.804302] CPU: 0 PID: 1 Comm: systemd-shutdow Tainted: G OE 4.19.165-audis-std #1
[ 90.813163] Hardware name: Siemens LPE9403 (DT)
[ 90.817686] pstate: 40000005 (nZcv daif -PAN -UAO)
[ 90.822475] pc : tpm_transmit+0x1b0/0x738
[ 90.826475] lr : tpm_transmit+0x440/0x738
[ 90.830473] sp : ffffff800803b830
[ 90.833778] x29: ffffff800803b830 x28: 0000000000000000
[ 90.839082] x27: 0000000000000000 x26: 000000000000000c
[ 90.844385] x25: ffffff8008d1ca10 x24: 0000000000000014
[ 90.849689] x23: 0000000000001000 x22: 0000000000001000
[ 90.854993] x21: 0000000000000145 x20: ffffffc877f68000
[ 90.860297] x19: ffffffc874d81000 x18: 0000000000000010
[ 90.865600] x17: 0000000000000000 x16: 0000000000000000
[ 90.870903] x15: ffffffffffffffff x14: ffffff8008f09848
[ 90.876207] x13: ffffff8089052d7f x12: ffffff8009052d87
[ 90.881510] x11: ffffff8008f2d000 x10: ffffff800803b430
[ 90.886813] x9 : 00000000ffffffd0 x8 : ffffff8008626d00
[ 90.892116] x7 : 7972745f6d707420 x6 : 0000000000000003
[ 90.897418] x5 : 0000000000000000 x4 : ffffff800811a0e4
[ 90.902721] x3 : 0000000000000001 x2 : ffffffc83f794040
[ 90.908024] x1 : 0000000000000000 x0 : 0000000000000000
[ 90.913327] Call trace:
[ 90.915765] tpm_transmit+0x1b0/0x738
[ 90.919419] tpm_transmit_cmd+0x64/0xf8
[ 90.923247] tpm2_shutdown+0x88/0xa8
[ 90.926814] tpm_chip_unregister+0xc4/0xe0
[ 90.930902] tpm_tis_spi_remove+0x24/0x40
[ 90.934905] spi_drv_remove+0x3c/0x60
[ 90.938559] device_release_driver_internal+0x1b0/0x248
[ 90.943775] device_release_driver+0x28/0x38
[ 90.948038] bus_remove_device+0xd4/0x148
[ 90.952039] device_del+0x158/0x388
[ 90.955519] device_unregister+0x24/0x78
[ 90.959433] spi_unregister_device+0x38/0x48
[ 90.963694] __unregister+0x20/0x30
[ 90.967174] device_for_each_child+0x58/0x88
[ 90.971436] spi_unregister_controller+0x44/0x160
[ 90.976131] dspi_remove+0x28/0x170
[ 90.979610] dspi_shutdown+0x20/0x30
[ 90.983178] platform_drv_shutdown+0x2c/0x38
[ 90.987439] device_shutdown+0x114/0x1f0
[ 90.991356] kernel_restart_prepare+0x44/0x50
[ 90.995704] kernel_restart+0x20/0x68
[ 90.999358] __se_sys_reboot+0x220/0x248
[ 91.003272] __arm64_sys_reboot+0x24/0x30
[ 91.007275] el0_svc_common+0xa4/0x198
[ 91.011016] el0_svc_handler+0x38/0x78
[ 91.014758] el0_svc+0x8/0xe8
[ 91.017719] Code: 72000400 b9008be0 54001480 f9435e60 (f9402c02)
[ 91.023809] ---[ end trace 2799224cad4a013c ]---
[ 91.028487] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 91.028487]
[ 91.037616] Kernel Offset: disabled
[ 91.041095] CPU features: 0x0,20002004
[ 91.044834] Memory Limit: none
[ 91.047882] Rebooting in 90 seconds..
"

config:
- TPM Infineon SLB9670, SPI connected
- Kernel V4.19.165 (LTS)

Additional information:
- device tree modified to add the TPM
- U-Boot and linux defconfig modified
- TPM initialised in U-Boot
- I can install the toolsuit 'tpm2-tools' and use the functionalities of the TPM / read the internal registers.
- In linux "/dev/tpm0" and "/dev/tpmrm0" are present.

Do you already experienced such a problem ?
What is going wrong ?
How to fix it ?

Thanks,

Florian

0 Kudos
1 Reply