foss-for-synopsys-dwc-arc-processors/linux

Linux kernel for HS68 panics if started from U-Boot

Closed this issue · 1 comments

U-Boot 2023.07-00327-g0d762e2763-dirty (Aug 17 2023 - 01:03:40 -0700)

CPU:   ARC HS6x, ARC64 ISA at 20 MHz
Model: snps,haps
Board: ARC virtual or prototyping platform
DRAM:  256 MiB
Core:  7 devices, 7 uclasses, devicetree: embed
Loading Environment from nowhere... OK
In:    serial@40000000
Out:   serial@40000000
Err:   serial@40000000
Net:   No ethernet found.
haps# bootm 0x8000000
## Booting kernel from Legacy Image at 08000000 ...
   Image Name:   Linux-5.16.0
   Image Type:   ARC Linux Kernel Image (gzip compressed)
   Data Size:    5140249 Bytes = 4.9 MiB
   Load Address: 00000000
   Entry Point:  001d9000
   Verifying Checksum ... OK
Working FDT set to 0
   Uncompressing Kernel Image

Starting kernel ...

Linux version 5.16.0 (abrodkin@us01dwia-amd-64cx1024g-019) (arc64-buildroot-linux-gnu-gcc.br_real (Buildroot 2022.11-290-gc505015626-dirty) 13.1.1 20230516, GNU ld (GNU Binutils) 2.41.50.20230704) #2 SMP PREEMPT Thu Aug 17 01:10:39 PDT 2023
Memory @ 0 [256M]
OF: fdt: Machine model: snps,zebu_hs-smp
earlycon: uart8250 at MMIO32 0x0000000040000000 (options '115200n8')
printk: bootconsole [uart8250] enabled
Failed to get possible-cpus from dtb, pretending all 12 cpus exist

IDENTITY        : ARCVER [0x70] ARCNUM [0x0] CHIPID [ 0x0]
processor [0]   : HS68 (ARC64 ARCv3 ISA)  Dual-Issue
ISA Extn        : atomic ll128 unalign div64
MMU [v10]       : MMU48 hwalk 4 levels, 4k PAGE, JTLB 2048 uD/I 16/16
                 tlb_flush_mm Incr ASID
I-Cache         : 32K, 4way/set, 64B Line, VIPT aliasing
D-Cache         : 32K, 2way/set, 64B Line, PIPT
HW PF           : RD 2 WR 2 OUTS 2 AG 1
Timers          : Timer0 Timer1 RTC [UP 64-bit] GFRC [SMP 64-bit]
Vector Table    : 0x0 [64-bit]
DEBUG           : smaRT ActionPoint 8/full
Extn [SMP]      : ARConnect (v3): 1 cores with IPI IDU DEBUG GFRC
archs-intc      : 16 priority levels (default 1) hw autosave
Zone ranges:
  Normal   [mem 0x0000000000000000-0x000000000fffffff]
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000000fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
percpu: Embedded 16 pages/cpu s24960 r8192 d32384 u65536
pcpu-alloc: s24960 r8192 d32384 u65536 alloc=16*4096
pcpu-alloc: [0] 00 [0] 01 [0] 02 [0] 03 [0] 04 [0] 05 [0] 06 [0] 07
pcpu-alloc: [0] 08 [0] 09 [0] 10 [0] 11
Built 1 zonelists, mobility grouping on.  Total pages: 64512
Kernel command line: earlycon=uart8250,mmio32,0x40000000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1 console=ttyS0,115200n8
Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
mem auto-init: stack:all(zero), heap alloc:off, heap free:off
Memory: 246844K/262144K available (4972K kernel code, 768K rwdata, 904K rodata, 2092K init, 262K bss, 15300K reserved, 0K cma-reserved)
rcu: Preemptible hierarchical RCU implementation.
rcu:    RCU event tracing is enabled.
        Trampoline variant of Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
NR_IRQS: 512
MCIP: IDU supports 8 common irqs
sched_clock: 64 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
clocksource: ARConnect GFRC: mask: 0xffffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
Console: colour dummy device 80x25
Calibrating delay loop... 49.35 BogoMIPS (lpj=246784)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Idle Task [1] (____ptrval____)
Trying to bring up CPU1 ...
Timeout: CPU1 FAILED to come up !!!
Idle Task [2] (____ptrval____)
Trying to bring up CPU2 ...
Timeout: CPU2 FAILED to come up !!!
Idle Task [3] (____ptrval____)
Trying to bring up CPU3 ...
random: fast init done
Timeout: CPU3 FAILED to come up !!!
Idle Task [4] (____ptrval____)
Trying to bring up CPU4 ...
Timeout: CPU4 FAILED to come up !!!
Idle Task [5] (____ptrval____)
Trying to bring up CPU5 ...
Timeout: CPU5 FAILED to come up !!!
Idle Task [6] (____ptrval____)
Trying to bring up CPU6 ...
Timeout: CPU6 FAILED to come up !!!
Idle Task [7] (____ptrval____)
Trying to bring up CPU7 ...
Timeout: CPU7 FAILED to come up !!!
Idle Task [8] (____ptrval____)
Trying to bring up CPU8 ...
Timeout: CPU8 FAILED to come up !!!
Idle Task [9] (____ptrval____)
Trying to bring up CPU9 ...
Timeout: CPU9 FAILED to come up !!!
Idle Task [10] (____ptrval____)
Trying to bring up CPU10 ...
Timeout: CPU10 FAILED to come up !!!
Idle Task [11] (____ptrval____)
Trying to bring up CPU11 ...
Timeout: CPU11 FAILED to come up !!!
smp: Brought up 1 node, 1 CPU
devtmpfs: initialized
random: get_random_u32 called from rhashtable_init+0x198/0x3a8 with crng_init=1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 4096 (order: 7, 524288 bytes, linear)
NET: Registered PF_NETLINK/PF_ROUTE protocol family
DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
clocksource: Switched to clocksource ARConnect GFRC
NET: Registered PF_INET protocol family
IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered PF_UNIX/PF_LOCAL protocol family
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
arc-pct fpga:pct: use noncoherent DMA ops
This core does not have performance counters!
workingset: timestamp_bits=62 max_order=16 bucket_order=0
unpack rootfs image as initramfs...
io scheduler mq-deadline registered
io scheduler kyber registered
simple-pm-bus fpga: use noncoherent DMA ops
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
of_serial 40000000.serial: use noncoherent DMA ops
printk: console [ttyS0] disabled
40000000.serial: ttyS0 at MMIO 0x40000000 (irq = 1, base_baud = 3125000) is a 16550A
printk: console [ttyS0] enabled
printk: console [ttyS0] enabled
printk: bootconsole [uart8250] disabled
printk: bootconsole [uart8250] disabled
NET: Registered PF_PACKET protocol family
NET: Registered PF_KEY protocol family
unpack initramfs done !
Mem-Info:
active_anon:25 inactive_anon:195 isolated_anon:0
 active_file:0 inactive_file:0 isolated_file:0
 unevictable:0 dirty:0 writeback:0
 slab_reclaimable:21 slab_unreclaimable:528
 mapped:0 shmem:230 pagetables:0 bounce:0
 kernel_misc_reclaimable:0
 free:60378 free_pcp:46 free_cma:0
Node 0 active_anon:100kB inactive_anon:780kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:920kB writeback_tmp:0kB kernel_stack:744kB pagetables:0kB all_unreclaimable? no
Normal free:241512kB boost:0kB min:1984kB low:2480kB high:2976kB reserved_highatomic:0KB active_anon:100kB inactive_anon:780kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:262144kB managed:246844kB mlocked:0kB bounce:0kB free_pcp:184kB local_pcp:184kB free_cma:0kB
lowmem_reserve[]: 0 0
Normal: 2*4kB (ME) 2*8kB (UM) 1*16kB (M) 2*32kB (UM) 2*64kB (UM) 1*128kB (E) 2*256kB (UE) 2*512kB (UE) 2*1024kB (UE) 4*2048kB (UME) 56*4096kB (M) = 241512kB
230 total pagecache pages
65536 pages RAM
0 pages HighMem/MovableOnly
3825 pages reserved
Kernel panic - not syncing:Ov
---[ end Kernel panic - not syncing:Ov ]---

See uImage & u-boot binaries in the attachment: images-archs68-2023.08.zip

Please note that the original loader image used for uImage creation boots just fine:

$ nsimdrv -tcf arc.tcf -prop=nsim_mem-dev=uart0,kind=dwuart,base=0x40000000,irq=24 output/images/loader

Console now belongs to UART, hit CRTL-] to return to simulator.
Linux version 5.16.0 (abrodkin@us01dwia-amd-64cx1024g-019) (arc64-buildroot-linux-gnu-gcc.br_real (Buildroot 2022.11-290-gc505015626-dirty) 13.1.1 20230516, GNU ld (GNU Binutils) 2.41.50.20230704) #1 SMP PREEMPT Thu Aug 17 00:40:53 PDT 2023
Memory @ 0 [256M]
OF: fdt: Machine model: snps,zebu_hs-smp
earlycon: uart8250 at MMIO32 0x0000000040000000 (options '115200n8')
printk: bootconsole [uart8250] enabled
Failed to get possible-cpus from dtb, pretending all 12 cpus exist

IDENTITY        : ARCVER [0x70] ARCNUM [0x0] CHIPID [ 0x0]
processor [0]   : HS68 (ARC64 ARCv3 ISA)  Dual-Issue
ISA Extn        : atomic ll128 unalign div64
MMU [v10]       : MMU48 hwalk 4 levels, 4k PAGE, JTLB 2048 uD/I 16/16
                 tlb_flush_mm Incr ASID
I-Cache         : 32K, 4way/set, 64B Line, VIPT aliasing
D-Cache         : 32K, 2way/set, 64B Line, PIPT
HW PF           : RD 2 WR 2 OUTS 2 AG 1
Timers          : Timer0 Timer1 RTC [UP 64-bit] GFRC [SMP 64-bit]
Vector Table    : 0x0 [64-bit]
DEBUG           : smaRT ActionPoint 8/full
Extn [SMP]      : ARConnect (v3): 1 cores with IPI IDU DEBUG GFRC
archs-intc      : 16 priority levels (default 1) hw autosave
Zone ranges:
  Normal   [mem 0x0000000000000000-0x000000000fffffff]
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000000fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
percpu: Embedded 16 pages/cpu s24960 r8192 d32384 u65536
pcpu-alloc: s24960 r8192 d32384 u65536 alloc=16*4096
pcpu-alloc: [0] 00 [0] 01 [0] 02 [0] 03 [0] 04 [0] 05 [0] 06 [0] 07
pcpu-alloc: [0] 08 [0] 09 [0] 10 [0] 11
Built 1 zonelists, mobility grouping on.  Total pages: 64512
Kernel command line: earlycon=uart8250,mmio32,0x40000000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1
Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
mem auto-init: stack:all(zero), heap alloc:off, heap free:off
Memory: 246844K/262144K available (4972K kernel code, 768K rwdata, 904K rodata, 2092K init, 262K bss, 15300K reserved, 0K cma-reserved)
rcu: Preemptible hierarchical RCU implementation.
rcu:    RCU event tracing is enabled.
        Trampoline variant of Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
NR_IRQS: 512
MCIP: IDU supports 8 common irqs
sched_clock: 64 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
clocksource: ARConnect GFRC: mask: 0xffffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
Console: colour dummy device 80x25
Calibrating delay loop... 49.35 BogoMIPS (lpj=246784)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Idle Task [1] (____ptrval____)
Trying to bring up CPU1 ...
Timeout: CPU1 FAILED to come up !!!
Idle Task [2] (____ptrval____)
Trying to bring up CPU2 ...
Timeout: CPU2 FAILED to come up !!!
Idle Task [3] (____ptrval____)
Trying to bring up CPU3 ...
random: fast init done
Timeout: CPU3 FAILED to come up !!!
Idle Task [4] (____ptrval____)
Trying to bring up CPU4 ...
Timeout: CPU4 FAILED to come up !!!
Idle Task [5] (____ptrval____)
Trying to bring up CPU5 ...
Timeout: CPU5 FAILED to come up !!!
Idle Task [6] (____ptrval____)
Trying to bring up CPU6 ...
Timeout: CPU6 FAILED to come up !!!
Idle Task [7] (____ptrval____)
Trying to bring up CPU7 ...
Timeout: CPU7 FAILED to come up !!!
Idle Task [8] (____ptrval____)
Trying to bring up CPU8 ...
Timeout: CPU8 FAILED to come up !!!
Idle Task [9] (____ptrval____)
Trying to bring up CPU9 ...
Timeout: CPU9 FAILED to come up !!!
Idle Task [10] (____ptrval____)
Trying to bring up CPU10 ...
Timeout: CPU10 FAILED to come up !!!
Idle Task [11] (____ptrval____)
Trying to bring up CPU11 ...
Timeout: CPU11 FAILED to come up !!!
smp: Brought up 1 node, 1 CPU
devtmpfs: initialized
random: get_random_u32 called from rhashtable_init+0x198/0x3a8 with crng_init=1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 4096 (order: 7, 524288 bytes, linear)
NET: Registered PF_NETLINK/PF_ROUTE protocol family
DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
clocksource: Switched to clocksource ARConnect GFRC
NET: Registered PF_INET protocol family
IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered PF_UNIX/PF_LOCAL protocol family
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
arc-pct fpga:pct: use noncoherent DMA ops
This core does not have performance counters!
workingset: timestamp_bits=62 max_order=16 bucket_order=0
unpack rootfs image as initramfs...
io scheduler mq-deadline registered
io scheduler kyber registered
simple-pm-bus fpga: use noncoherent DMA ops
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
of_serial 40000000.serial: use noncoherent DMA ops
printk: console [ttyS0] disabled
40000000.serial: ttyS0 at MMIO 0x40000000 (irq = 1, base_baud = 3125000) is a 16550A
printk: console [ttyS0] enabled
printk: console [ttyS0] enabled
printk: bootconsole [uart8250] disabled
printk: bootconsole [uart8250] disabled
NET: Registered PF_PACKET protocol family
NET: Registered PF_KEY protocol family
unpack initramfs done !
Freeing unused kernel image (initmem) memory: 2092K
This architecture does not have kernel memory protection.
Run /init as init process
  with arguments:
    /init
  with environment:
    HOME=/
    TERM=linux
BStarting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Saving random seed: random: dd: uninitialized urandom read (512 bytes read)
OK
Starting network: OK

Welcome to Buildroot
buildroot login: root
#
xxkent commented

This issue is related to u-boot port for ARCv3. I've fixed u-boot port. In a nutshell the problem was related to Linux kernel memory corruption by u-boot.