AnsweredAssumed Answered

Linux hangs in Non-secure

Question asked by Ailton Lopes on Jul 26, 2018
Latest reply on Jul 30, 2018 by igorpadykov

Hi, im trying to run linux on the imx6q  SD board and the kernel runs fine when running as secure and when i switch to non secure the kernel hags. I believe that the problem is that the kernel is trying to access some peripheral that doesn't allow non-secure access and it's causing the crash but don't know which one. 

Here is the kernel output.

 

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0 (andersen@andersenbond) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.18
[ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Freescale i.MX6 Quad SABRE Smart Device Board
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 64 MiB at 0x4c000000
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm/kernel/devtree.c:157 arm_dt_init_cpu_maps+0x108/0x170
[ 0.000000] DT /cpu 2 nodes greater than max cores 1, capping them
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.15.0 #26
[ 0.000000] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 0.000000] Backtrace:
[ 0.000000] [<c01068f8>] (dump_backtrace) from [<c0106bc4>] (show_stack+0x18/0x1c)
[ 0.000000] r7:00000009 r6:00000000 r5:c0713448 r4:c0a01f00
[ 0.000000] [<c0106bac>] (show_stack) from [<c054599c>] (dump_stack+0x20/0x28)
[ 0.000000] [<c054597c>] (dump_stack) from [<c011b034>] (__warn+0xd4/0xfc)
[ 0.000000] [<c011af60>] (__warn) from [<c011b098>] (warn_slowpath_fmt+0x3c/0x44)
[ 0.000000] r8:eb9d694c r7:c0718c80 r6:c0713418 r5:00000001 r4:c0713464
[ 0.000000] [<c011b060>] (warn_slowpath_fmt) from [<c0804c3c>] (arm_dt_init_cpu_maps+0x108/0x170)
[ 0.000000] r3:00000002 r2:c0713464
[ 0.000000] r4:00000000
[ 0.000000] [<c0804b34>] (arm_dt_init_cpu_maps) from [<c080414c>] (setup_arch+0x7b8/0xa88)
[ 0.000000] r9:c118e230 r8:c0a1fe68 r7:4fffffff r6:ebffff40 r5:c0a09fe8 r4:c084605c
[ 0.000000] [<c0803994>] (setup_arch) from [<c08009f8>] (start_kernel+0x60/0x40c)
[ 0.000000] r10:10c53c7d r9:412fc09a r8:22000000 r7:c0a07080 r6:10c03c7d r5:00000051
[ 0.000000] r4:c080032c
[ 0.000000] [<c0800998>] (start_kernel) from [<00000000>] ( (null))
[ 0.000000] r10:10c53c7d r9:412fc09a r8:22000000 r7:00000f8c r6:10c03c7d r5:00000051
[ 0.000000] r4:c080032c
[ 0.000000] random: get_random_bytes called from print_oops_end_marker+0x40/0x50 with crng_init=0
[ 0.000000] ---[ end trace 0000000000000000 ]---
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 195072
[ 0.000000] Kernel command line: init=/init console=ttymxc0,115200
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 696588K/786432K available (5120K kernel code, 236K rwdata, 1700K rodata, 2048K init, 75)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (6112 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (2048 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 237 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) (7577 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Running RCU self tests
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] Switching to timer-based delay loop, resolution 333ns
[ 0.000010] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns
[ 0.000040] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
[ 0.002049] Console: colour dummy device 80x30
[ 0.002084] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[ 0.002101] ... MAX_LOCKDEP_SUBCLASSES: 8
[ 0.002116] ... MAX_LOCK_DEPTH: 48
[ 0.002130] ... MAX_LOCKDEP_KEYS: 8191
[ 0.002144] ... CLASSHASH_SIZE: 4096
[ 0.002156] ... MAX_LOCKDEP_ENTRIES: 32768
[ 0.002170] ... MAX_LOCKDEP_CHAINS: 65536
[ 0.002181] ... CHAINHASH_SIZE: 32768
[ 0.002195] memory used by lock dependency info: 4655 kB
[ 0.002208] per task-struct memory footprint: 1536 bytes
[ 0.002264] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=3)
[ 0.002301] pid_max: default: 32768 minimum: 301
[ 0.002589] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.002634] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.004923] CPU: Testing write buffer coherency: ok
[ 0.007925] Setting up static identity map for 0x20100000 - 0x20100078
[ 0.011067] devtmpfs: initialized
[ 0.047417] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.047478] futex hash table entries: 256 (order: 1, 11264 bytes)
[ 0.052091] pinctrl core: initialized pinctrl subsystem
[ 0.054265] NET: Registered protocol family 16
[ 0.074403] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.077615] cpuidle: using governor menu
[ 0.077795] CPU identified as i.MX6Q, silicon rev 1.2
[ 0.130173] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.130205] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.133628] imx6q-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.190120] vgaarb: loaded
[ 0.191247] SCSI subsystem initialized
[ 0.194129] i2c i2c-0: IMX I2C adapter registered
[ 0.194174] i2c i2c-0: can't use DMA, using PIO instead.
[ 0.196330] i2c i2c-1: IMX I2C adapter registered
[ 0.196375] i2c i2c-1: can't use DMA, using PIO instead.
[ 0.197988] i2c i2c-2: IMX I2C adapter registered
[ 0.198032] i2c i2c-2: can't use DMA, using PIO instead.
[ 0.200863] clocksource: Switched to clocksource mxc_timer1
[ 0.201680] VFS: Disk quotas dquot_6.6.0
[ 0.201804] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.517427] hw perfevents: no interrupt-affinity property for /soc/pmu, guessing.
[ 0.517676] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[ 0.522470] Initialise system trusted keyrings
[ 0.523095] workingset: timestamp_bits=30 max_order=18 bucket_order=0
[ 0.539176] fuse init (API version 7.26)
[ 0.543167] random: fast init done
[ 0.555892] Key type asymmetric registered
[ 0.556001] Asymmetric key parser 'x509' registered
[ 0.556142] io scheduler noop registered
[ 0.556172] io scheduler deadline registered
[ 0.556577] io scheduler cfq registered (default)
[ 0.556607] io scheduler mq-deadline registered
[ 0.556627] io scheduler kyber registered
[ 0.559875] OF: PCI: host bridge /soc/pcie@1ffc000 ranges:
[ 0.559955] OF: PCI: IO 0x01f80000..0x01f8ffff -> 0x00000000
[ 0.560095] OF: PCI: MEM 0x01000000..0x01efffff -> 0x01000000
[ 1.681567] imx6q-pcie 1ffc000.pcie: phy link never came up
[ 1.685351] imx6q-pcie 1ffc000.pcie: PCI host bridge to bus 0000:00
[ 1.685398] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 1.685432] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
[ 1.685460] pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
[ 1.686944] PCI: bus0: Fast back to back transfers disabled
[ 1.687330] PCI: bus1: Fast back to back transfers enabled
[ 1.687425] pci 0000:00:00.0: BAR 0: assigned [mem 0x01000000-0x010fffff]
[ 1.687468] pci 0000:00:00.0: BAR 6: assigned [mem 0x01100000-0x0110ffff pref]
[ 1.687496] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 1.688709] pcieport 0000:00:00.0: Signaling PME with IRQ 302
[ 1.689438] pcieport 0000:00:00.0: AER enabled with IRQ 302
[ 1.695907] imx-pgc-pd imx-pgc-power-domain.0: Linked as a consumer to 20dc000.gpc
[ 1.696594] imx-pgc-pd imx-pgc-power-domain.1: Linked as a consumer to 20dc000.gpc
[ 1.699287] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 26, base_baud = 5000000) is a IMX
[ 2.446039] console [ttymxc0] enabled
[ 2.466438] etnaviv gpu-subsystem: bound 134000.gpu (ops gpu_ops)
[ 2.472782] etnaviv gpu-subsystem: bound 130000.gpu (ops gpu_ops)
[ 2.478984] etnaviv gpu-subsystem: bound 2204000.gpu (ops gpu_ops)
[ 2.485269] etnaviv-gpu 134000.gpu: model: GC320, revision: 5007
[ 2.520413] etnaviv-gpu 130000.gpu: model: GC2000, revision: 5108
[ 2.556070] etnaviv-gpu 2204000.gpu: model: GC355, revision: 1215
[ 2.562288] etnaviv-gpu 2204000.gpu: Ignoring GPU with VG and FE2.0
[ 2.571393] [drm] Initialized etnaviv 1.1.0 20151214 for gpu-subsystem on minor 0
[ 2.580833] ------------[ cut here ]------------
[ 2.585591] WARNING: CPU: 0 PID: 1 at ./include/linux/reset.h:67 ipu_probe+0x1cc/0x274
[ 2.593592] Modules linked in:
[ 2.596691] CPU: 0 PID: 1 Comm: swapper Tainted: G W 4.15.0 #26
[ 2.603900] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 2.610451] Backtrace:
[ 2.613000] [<c01068f8>] (dump_backtrace) from [<c0106bc4>] (show_stack+0x18/0x1c)
[ 2.620598] r7:00000009 r6:00000000 r5:c0749538 r4:00000000
[ 2.626346] [<c0106bac>] (show_stack) from [<c054599c>] (dump_stack+0x20/0x28)
[ 2.633659] [<c054597c>] (dump_stack) from [<c011b034>] (__warn+0xd4/0xfc)
[ 2.640568] [<c011af60>] (__warn) from [<c011b12c>] (warn_slowpath_null+0x44/0x50)
[ 2.648215] r8:eb9d3a78 r7:e82e8b40 r6:c045bf38 r5:00000043 r4:c0749538
[ 2.655001] [<c011b0e8>] (warn_slowpath_null) from [<c045bf38>] (ipu_probe+0x1cc/0x274)
[ 2.663085] r6:00000000 r5:e8140810 r4:e8267c10
[ 2.667745] [<c045bd6c>] (ipu_probe) from [<c046c0b0>] (platform_drv_probe+0x58/0xb4)
[ 2.675696] r10:00000000 r9:00000000 r8:c0a312ec r7:fffffdfb r6:c0a312ec r5:fffffffe
[ 2.683630] r4:e8140810
[ 2.686206] [<c046c058>] (platform_drv_probe) from [<c046a5a8>] (driver_probe_device+0x254/0x338)
[ 2.695158] r7:00000000 r6:c119e8ec r5:c119e8e8 r4:e8140810
[ 2.700854] [<c046a354>] (driver_probe_device) from [<c046a740>] (__driver_attach+0xb4/0xb8)
[ 2.709377] r10:c0a31ba8 r9:c046c058 r8:c046c010 r7:00000000 r6:e8140844 r5:c0a312ec
[ 2.717279] r4:e8140810 r3:00000000
[ 2.721126] [<c046a68c>] (__driver_attach) from [<c046888c>] (bus_for_each_dev+0x54/0xa4)
[ 2.729339] r7:00000000 r6:c046a68c r5:c0a312ec r4:00000000
[ 2.735097] [<c0468838>] (bus_for_each_dev) from [<c0469f08>] (driver_attach+0x20/0x28)
[ 2.743185] r6:c0a31ba8 r5:e82e3500 r4:c0a312ec
[ 2.747840] [<c0469ee8>] (driver_attach) from [<c04699e8>] (bus_add_driver+0x178/0x20c)
[ 2.755930] [<c0469870>] (bus_add_driver) from [<c046b0bc>] (driver_register+0x80/0xfc)
[ 2.764150] r7:c064e454 r6:00000000 r5:00000003 r4:c0a312ec
[ 2.769857] [<c046b03c>] (driver_register) from [<c046c1b4>] (__platform_register_drivers+0x5c/0xe4)
[ 2.779239] r5:00000003 r4:00000002
[ 2.782925] [<c046c158>] (__platform_register_drivers) from [<c083aa9c>] (imx_ipu_init+0x1c/0x24)
[ 2.791886] r10:c0800608 r9:c0847858 r8:00000007 r7:c07a7c70 r6:ffffe000 r5:c083aa80
[ 2.799741] r4:00000000
[ 2.802358] [<c083aa80>] (imx_ipu_init) from [<c0101adc>] (do_one_initcall+0x44/0x174)
[ 2.810316] [<c0101a98>] (do_one_initcall) from [<c0800eb8>] (kernel_init_freeable+0x114/0x1d0)
[ 2.819097] r8:00000007 r7:c07a7c70 r6:c0847850 r5:c08539fc r4:c0a3b240
[ 2.825890] [<c0800da4>] (kernel_init_freeable) from [<c0558974>] (kernel_init+0x10/0x114)
[ 2.834241] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0558964
[ 2.842145] r4:00000000
[ 2.844717] [<c0558964>] (kernel_init) from [<c01028d4>] (ret_from_fork+0x14/0x20)
[ 2.852362] r5:c0558964 r4:00000000
[ 2.855977] ---[ end trace 34f87c9ff0f06f1e ]---
[ 2.860627] imx-ipuv3 2400000.ipu: failed to reset: -524
[ 2.866106] imx-ipuv3: probe of 2400000.ipu failed with error -524
[ 2.872770] ------------[ cut here ]------------
[ 2.877438] WARNING: CPU: 0 PID: 1 at ./include/linux/reset.h:67 ipu_probe+0x1cc/0x274
[ 2.885449] Modules linked in:
[ 2.888551] CPU: 0 PID: 1 Comm: swapper Tainted: G W 4.15.0 #26
[ 2.895762] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 2.902360] Backtrace:
[ 2.904862] [<c01068f8>] (dump_backtrace) from [<c0106bc4>] (show_stack+0x18/0x1c)
[ 2.912515] r7:00000009 r6:00000000 r5:c0749538 r4:00000000
[ 2.918213] [<c0106bac>] (show_stack) from [<c054599c>] (dump_stack+0x20/0x28)
[ 2.925522] [<c054597c>] (dump_stack) from [<c011b034>] (__warn+0xd4/0xfc)
[ 2.932483] [<c011af60>] (__warn) from [<c011b12c>] (warn_slowpath_null+0x44/0x50)
[ 2.940085] r8:eb9d55ec r7:e82e8bc0 r6:c045bf38 r5:00000043 r4:c0749538
[ 2.946870] [<c011b0e8>] (warn_slowpath_null) from [<c045bf38>] (ipu_probe+0x1cc/0x274)
[ 2.954955] r6:00000000 r5:e8141810 r4:e8267c10
[ 2.959615] [<c045bd6c>] (ipu_probe) from [<c046c0b0>] (platform_drv_probe+0x58/0xb4)
[ 2.967531] r10:00000000 r9:00000000 r8:c0a312ec r7:fffffdfb r6:c0a312ec r5:fffffffe
[ 2.975436] r4:e8141810
[ 2.978006] [<c046c058>] (platform_drv_probe) from [<c046a5a8>] (driver_probe_device+0x254/0x338)
[ 2.986957] r7:00000000 r6:c119e8ec r5:c119e8e8 r4:e8141810
[ 2.992701] [<c046a354>] (driver_probe_device) from [<c046a740>] (__driver_attach+0xb4/0xb8)
[ 3.001223] r10:c0a31ba8 r9:c046c058 r8:c046c010 r7:00000000 r6:e8141844 r5:c0a312ec
[ 3.009077] r4:e8141810 r3:00000000
[ 3.012733] [<c046a68c>] (__driver_attach) from [<c046888c>] (bus_for_each_dev+0x54/0xa4)
[ 3.020989] r7:00000000 r6:c046a68c r5:c0a312ec r4:00000000
[ 3.026684] [<c0468838>] (bus_for_each_dev) from [<c0469f08>] (driver_attach+0x20/0x28)
[ 3.034764] r6:c0a31ba8 r5:e82e3500 r4:c0a312ec
[ 3.039419] [<c0469ee8>] (driver_attach) from [<c04699e8>] (bus_add_driver+0x178/0x20c)
[ 3.047507] [<c0469870>] (bus_add_driver) from [<c046b0bc>] (driver_register+0x80/0xfc)
[ 3.055590] r7:c064e454 r6:00000000 r5:00000003 r4:c0a312ec
[ 3.061334] [<c046b03c>] (driver_register) from [<c046c1b4>] (__platform_register_drivers+0x5c/0xe4)
[ 3.070491] r5:00000003 r4:00000002
[ 3.074152] [<c046c158>] (__platform_register_drivers) from [<c083aa9c>] (imx_ipu_init+0x1c/0x24)
[ 3.083104] r10:c0800608 r9:c0847858 r8:00000007 r7:c07a7c70 r6:ffffe000 r5:c083aa80
[ 3.091006] r4:00000000
[ 3.093575] [<c083aa80>] (imx_ipu_init) from [<c0101adc>] (do_one_initcall+0x44/0x174)
[ 3.101584] [<c0101a98>] (do_one_initcall) from [<c0800eb8>] (kernel_init_freeable+0x114/0x1d0)
[ 3.110313] r8:00000007 r7:c07a7c70 r6:c0847850 r5:c08539fc r4:c0a3b240
[ 3.117104] [<c0800da4>] (kernel_init_freeable) from [<c0558974>] (kernel_init+0x10/0x114)
[ 3.125452] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0558964
[ 3.133354] r4:00000000
[ 3.135923] [<c0558964>] (kernel_init) from [<c01028d4>] (ret_from_fork+0x14/0x20)
[ 3.143566] r5:c0558964 r4:00000000
[ 3.147170] ---[ end trace 34f87c9ff0f06f1f ]---
[ 3.151866] imx-ipuv3 2800000.ipu: failed to reset: -524
[ 3.157292] imx-ipuv3: probe of 2800000.ipu failed with error -524
[ 3.195224] brd: module loaded
[ 3.225696] loop: module loaded
[ 3.231137] i2c /dev entries driver
[ 3.241801] Loading compiled-in X.509 certificates
[ 3.310325] input: gpio-keys as /devices/soc0/gpio-keys/input/input0
[ 3.325334] Freeing unused kernel memory: 2048K
[ 3.337108] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[ 3.337108]
[ 3.346386] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[ 3.346386]  

Outcomes