Closed qianfei11 closed 10 months ago
The Linux kernel looks in the DTB and tries to enable the CPUs described there.
The Linux kernel looks in the DTB and tries to enable the CPUs described there.
Thanks for replying, I found the dts file related to cpu in linux/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
. This may help.
I tried to edit the DTB files and it seems not realistic and not an easy task.
And I tried the methods used in this issue #3643, change the value of CFG_TEE_CORE_NB_CORE
to 1 and change the return value of get_core_pos()
to 0. The hikey960 board still stucks in the booting process.
Is there any more suggestions to running the whole optee_os and linux kernel with only one core on hikey960 board?
Is there any more suggestions to running the whole optee_os and linux kernel with only one core on hikey960 board?
Add maxcpus=1
to the kernel command line.
Add
maxcpus=1
to the kernel command line.
Thanks for your suggestion!
I edited patches_hikey/grub/grub_uart6.cfg
to add the maxcpus=1
option, and flash the images to the board. the kernel stop to wake up the other 7 cores, but encountered with a new kernel panic:
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.2.0-rc3-dirty (bea1e@bea1e-OptiPlex-5000) (aarch64-linux-gnu-gcc (Arm GNU Toolchain 11.3.Rel1) 11.3.1 20220712, GNU ld (Arm GNU Toolchain 11.3.Rel1) 2.38.20220708) #8 SMP PREEMPT Sat Oct 14 13:05:20 CST 2023
[ 0.000000] Machine model: HiKey960
[ 0.000000] earlycon: pl11 at MMIO 0x00000000fff32000 (options '')
[ 0.000000] printk: bootconsole [pl11] enabled
[ 0.000000] printk: debug: ignoring loglevel setting.
[ 0.000000] efi: EFI v2.60 by EDK II
[ 0.000000] efi: MEMATTR=0xbe79c418 MEMRESERVE=0xba6e6f18
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000021fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x21f7cba00-0x21f7cdfff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x00000000ffffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal [mem 0x0000000100000000-0x000000021fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000001abfffff]
[ 0.000000] node 0: [mem 0x000000001ad88000-0x0000000031ffffff]
[ 0.000000] node 0: [mem 0x0000000032101000-0x000000003dffffff]
[ 0.000000] node 0: [mem 0x0000000040000000-0x0000000089b7ffff]
[ 0.000000] node 0: [mem 0x0000000089cc0000-0x00000000ba49ffff]
[ 0.000000] node 0: [mem 0x00000000ba4a0000-0x00000000ba6dffff]
[ 0.000000] node 0: [mem 0x00000000ba6e0000-0x00000000ba6e7fff]
[ 0.000000] node 0: [mem 0x00000000ba6e8000-0x00000000ba6ebfff]
[ 0.000000] node 0: [mem 0x00000000ba6ec000-0x00000000bf6affff]
[ 0.000000] node 0: [mem 0x00000000bf6b0000-0x00000000bf6effff]
[ 0.000000] node 0: [mem 0x00000000bf6f0000-0x00000000bf6fffff]
[ 0.000000] node 0: [mem 0x00000000bf700000-0x00000000bf74ffff]
[ 0.000000] node 0: [mem 0x00000000bf750000-0x00000000dfffffff]
[ 0.000000] node 0: [mem 0x0000000200000000-0x000000021fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000021fffffff]
[ 0.000000] On node 0, zone DMA: 392 pages in unavailable ranges
[ 0.000000] On node 0, zone DMA: 257 pages in unavailable ranges
[ 0.000000] On node 0, zone DMA: 8192 pages in unavailable ranges
[ 0.000000] On node 0, zone DMA: 320 pages in unavailable ranges
[ 0.000000] cma: Reserved 32 MiB at 0x00000000de000000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: Trusted OS migration not required
[ 0.000000] psci: SMC Calling Convention v1.2
[ 0.000000] percpu: Embedded 30 pages/cpu s82920 r8192 d31768 u122880
[ 0.000000] pcpu-alloc: s82920 r8192 d31768 u122880 alloc=30*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: kernel page table isolation forced ON by KASLR
[ 0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] alternatives: applying boot alternatives
[ 0.000000] Fallback order for Node 0: 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 1023174
[ 0.000000] Policy zone: Normal
[ 0.000000] Kernel command line: BOOT_IMAGE=/Image console=tty0 console=ttyAMA6,115200n8 earlycon=pl011,0xfff32000 root=/dev/disk/by-partlabel/system rootwait rw ignore_loglevel efi=noruntime maxcpus=1
[ 0.000000] Unknown kernel command line parameters "BOOT_IMAGE=/Image", will be passed to user space.
[ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] software IO TLB: area num 8.
[ 0.000000] software IO TLB: mapped [mem 0x00000000da000000-0x00000000de000000] (64MB)
[ 0.000000] Memory: 3915956K/4157660K available (19648K kernel code, 5310K rwdata, 11036K rodata, 11776K init, 633K bss, 208936K reserved, 32768K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[ 0.000000] ftrace: allocating 65492 entries in 256 pages
[ 0.000000] ftrace: allocated 256 pages with 1 groups
[ 0.000000] trace event string verifier disabled
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] Rude variant of Tasks RCU enabled.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] Root IRQ handler: gic_handle_irq
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 0.000000] arch_timer: cp15 timer(s) running at 1.92MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1c570327e, max_idle_ns: 1763180809505 ns
[ 0.000002] sched_clock: 56 bits at 1920kHz, resolution 520ns, wraps every 4398046510977ns
[ 0.008521] clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58334160866034 ns
[ 0.019606] Console: colour dummy device 80x25
[ 0.024135] printk: console [tty0] enabled
[ 0.028848] Calibrating delay loop (skipped), value calculated using timer frequency.. 3.84 BogoMIPS (lpj=7680)
[ 0.039131] pid_max: default: 32768 minimum: 301
[ 0.043905] LSM: initializing lsm=capability,integrity
[ 0.049297] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.056843] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.067026] cblist_init_generic: Setting adjustable number of callback queues.
[ 0.074506] cblist_init_generic: Setting shift to 3 and lim to 1.
[ 0.080771] cblist_init_generic: Setting shift to 3 and lim to 1.
[ 0.087042] cblist_init_generic: Setting shift to 3 and lim to 1.
[ 0.093402] rcu: Hierarchical SRCU implementation.
[ 0.098285] rcu: Max phase no-delay instances is 1000.
[ 0.106083] EFI runtime services will be disabled.
[ 0.111528] smp: Bringing up secondary CPUs ...
[ 0.116188] NR_CPUS = 256
[ 0.118848] Bring up CPU0
[ 0.121513] smp: Brought up 1 node, 1 CPU
[ 0.125593] SMP: Total of 1 processors activated.
[ 0.130384] CPU features: detected: 32-bit EL0 Support
[ 0.135612] CPU features: detected: 32-bit EL1 Support
[ 0.140847] CPU features: detected: CRC32 instructions
[ 0.146170] CPU: All CPU(s) started at EL2
[ 0.150361] alternatives: applying system-wide alternatives
[ 0.158706] devtmpfs: initialized
[ 0.169457] level: 0, command_line: BOOT_IMAGE=/Image console=tty0 console=ttyAMA6,115200n8 earlycon=pl011,0xfff32000 root=/dev/disk/by-partlabel/system rootwait rw ignore_loglevel efi=noruntime maxcpus=1
[ 0.188806] level: 1, command_line: BOOT_IMAGE=/Image console=tty0 console=ttyAMA6,115200n8 earlycon=pl011,0xfff32000 root=/dev/disk/by-partlabel/system rootwait rw ignore_loglevel efi=noruntime maxcpus=1
[ 0.207630] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.217569] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)
[ 0.226635] pinctrl core: initialized pinctrl subsystem
[ 0.234405] DMI not present or invalid.
[ 0.239132] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.245285] level: 2, command_line: BOOT_IMAGE=/Image console=tty0 console=ttyAMA6,115200n8 earlycon=pl011,0xfff32000 root=/dev/disk/by-partlabel/system rootwait rw ignore_loglevel efi=noruntime maxcpus=1
[ 0.264976] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations
[ 0.272304] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.280343] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.288504] audit: initializing netlink subsys (disabled)
[ 0.295704] thermal_sys: Registered thermal governor 'step_wise'
[ 0.295721] thermal_sys: Registered thermal governor 'power_allocator'
[ 0.301917] audit: type=2000 audit(0.152:1): state=initialized audit_enabled=0 res=1
[ 0.316524] cpuidle: using governor menu
[ 0.320602] level: 3, command_line: BOOT_IMAGE=/Image console=tty0 console=ttyAMA6,115200n8 earlycon=pl011,0xfff32000 root=/dev/disk/by-partlabel/system rootwait rw ignore_loglevel efi=noruntime maxcpus=1
[ 0.339364] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.346329] ASID allocator initialised with 32768 entries
[ 0.353577] Serial: AMBA PL011 UART driver
[ 0.382262] hi3660-mbox e896b000.mailbox: Mailbox enabled
[ 0.396628] amba ec801000.funnel: Fixing up cyclic dependency with ecf40000.etm
[ 0.404198] amba ec801000.funnel: Fixing up cyclic dependency with ece40000.etm
[ 0.411677] amba ec801000.funnel: Fixing up cyclic dependency with ecd40000.etm
[ 0.419148] amba ec801000.funnel: Fixing up cyclic dependency with ecc40000.etm
[ 0.426793] amba ec802000.etf: Fixing up cyclic dependency with ec801000.funnel
[ 0.434341] Internal error: synchronous external abort: 0000000096000210 [#1] PREEMPT SMP
[ 0.442668] Modules linked in:
[ 0.445786] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.2.0-rc3-dirty #8
[ 0.452604] Hardware name: HiKey960 (DT)
[ 0.456592] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 0.463674] pc : amba_read_periphid+0xcc/0x230
[ 0.468213] lr : amba_read_periphid+0xb8/0x230
[ 0.472730] sp : ffff80000804bb90
[ 0.476096] x29: ffff80000804bb90 x28: 0000000000000004 x27: ffff800009d51870
[ 0.483357] x26: ffff800009ff00f0 x25: ffff000200886010 x24: 0000000000000001
[ 0.490618] x23: ffff80000997e910 x22: 0000000000000000 x21: 0000000000000000
[ 0.497877] x20: ffff00020095c000 x19: 0000000000001000 x18: ffffffffffffffff
[ 0.505138] x17: 6e75662e30303031 x16: 3038636520687469 x15: ffff00020096588d
[ 0.512399] x14: ffffffffffffffff x13: 0000000000000000 x12: 0101010101010101
[ 0.519659] x11: 7f7f7f7f7f7f7f7f x10: 00000000ed440000 x9 : 0140000000000000
[ 0.526920] x8 : 0040000000000001 x7 : 00008000e526d000 x6 : 0000000000000000
[ 0.534180] x5 : ffff8000481d3000 x4 : 0000000000000000 x3 : ffff8000081d3fe0
[ 0.541441] x2 : 0068000000000f13 x1 : 0000000000000000 x0 : ffff8000081d3000
[ 0.548704] Call trace:
[ 0.551189] amba_read_periphid+0xcc/0x230
[ 0.555354] amba_device_add+0x90/0xb4
[ 0.559168] of_platform_bus_create+0x2bc/0x380
[ 0.563783] of_platform_bus_create+0x1c4/0x380
[ 0.568389] of_platform_populate+0x58/0x104
[ 0.572730] of_platform_default_populate_init+0xd4/0xf4
[ 0.578141] do_one_initcall+0x4c/0x2b0
[ 0.582045] kernel_init_freeable+0x24c/0x2c0
[ 0.586482] kernel_init+0x2c/0x140
[ 0.590032] ret_from_fork+0x10/0x20
[ 0.593673] Code: d1008263 52800004 8b030003 52800006 (b9400062)
[ 0.599878] ---[ end trace 0000000000000000 ]---
[ 0.604594] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 0.612387] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
Though I haven't digged into this error yet. What problem might this error be related to?
This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.
I tried to edit
$(call force,CFG_TEE_CORE_NB_CORE,8)
to$(call force,CFG_TEE_CORE_NB_CORE,1)
, but the operating system will stuck at some point of booting process. Looks like linux tried to wake up another seven cores, but failed. Is this something related to SMP?I found this patch showed that the
CFG_TEE_CORE_NB_CORE
is not changable. Is there any other way to use only one core to run OPTEE OS on hikey960 board?