gem5-users@gem5.org

The gem5 Users mailing list

View all threads

ARM FS not working when using gem5 standard library

AA
AbdelQader AlKilany
Wed, May 3, 2023 3:22 PM

Hello gem5 community,

I am relatively new to gem5 and I may be missing something very obvious here.

I am trying to run SE and FS simulations on both basic ARM and RISCV configurations and I want to do this using the gem5 standard library.
I have managed to get these all to run without using the standard library.

With the standard library I have managed to get an SE sim to work for both ARM and RISCV.
Also a RISCV FS sim has worked for me.

The problem is the ARM sim with FS mode.

I have tried many different bootloaders, kernels and disk images, both from gem5 resources json(resources.json - public/gem5-resources - Git at Google (googlesource.com)https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/resources.json) and from online (like from https://www.gem5.org/documentation/general_docs/fullsystem/guest_binaries).

I am running the newest version of gem5 (develop branch).

Without using the standard library, this command works for me:

./build/ARM/gem5.opt configs/deprecated/example/fs.py
--cpu-type=AtomicSimple
--bootloader=CustomResources/arm/fs_images/binaries/boot.arm64
--kernel=CustomResources/arm/arm64-vmlinux-5.4.49
--disk=CustomResources/arm/arm64-ubuntu-20220425.img

fsbigLITTLE.py also works fine.

I have tried 2 config scripts, both with the same result essentially.
This one is a slightly modified version of arm-ubuntu-run.py:

from gem5.isas import ISA
from m5.objects import ArmDefaultRelease
from gem5.utils.requires import requires
from gem5.resources.workload import Workload
from gem5.simulate.simulator import Simulator
from m5.objects import VExpress_GEM5_Foundation
from gem5.coherence_protocol import CoherenceProtocol
from gem5.components.boards.arm_board import ArmBoard
from gem5.components.memory import DualChannelDDR4_2400
from gem5.components.processors.cpu_types import CPUTypes
from gem5.components.processors.simple_processor import SimpleProcessor
from gem5.resources.resource import Resource, AbstractResource, DiskImageResource

requires(isa_required=ISA.ARM)

from gem5.components.cachehierarchies.classic.no_cache import NoCache

cache_hierarchy = NoCache()

memory = DualChannelDDR4_2400(size="2GB")

processor = SimpleProcessor(cpu_type=CPUTypes.ATOMIC, num_cores=1, isa=ISA.ARM)

release = ArmDefaultRelease()

platform = VExpress_GEM5_Foundation()

board = ArmBoard(
clk_freq="1GHz",
processor=processor,
memory=memory,
cache_hierarchy=cache_hierarchy,
release=release,
platform=platform,
)

#MY CURRENT REASONING FOR WHATS WRONG IS THE BOOTLOADER IS READ INCORRECTLY
#The reason I use AbstractResource instead of Resource is because Resource for me gets blocked - Abstract has worked for me with RISCV
board.set_kernel_disk_workload(
bootloader=AbstractResource("CustomResources/arm/boot.arm64-20220707"),
kernel=AbstractResource("CustomResources/arm/arm64-vmlinux-5.4.49"),
disk_image=DiskImageResource("CustomResources/arm/arm64-ubuntu-20220425.img"),
)

simulator = Simulator(board=board)
simulator.run()

I have changed the memory, cache hierarchy and workloads to no success.
Also some other random things like memory size, clock frequency etc.

This is output if I use these binary/image combination with stdlib using command:
./build/ARM/gem5.opt configs/example/gem5_library/arm-ubuntu-run.py

....

command line: ./build/ARM/gem5.opt configs/example/gem5_library/arm-ubuntu-run.py

warn: The simulate package is still in a beta state. The gem5 project does not guarantee the APIs within this package will remain consistent across upcoming releases.
Global frequency set at 1000000000000 ticks per second
warn: No dot file generated. Please install pydot to generate the dot file and pdf.
build/ARM/mem/dram_interface.cc:690: warn: DRAM device capacity (16384 Mbytes) does not match the address range assigned (1024 Mbytes)
build/ARM/mem/dram_interface.cc:690: warn: DRAM device capacity (16384 Mbytes) does not match the address range assigned (1024 Mbytes)
build/ARM/sim/kernel_workload.cc:46: info: kernel located at: CustomResources/arm/arm64-vmlinux-5.4.49
build/ARM/base/statistics.hh:279: warn: One of the stats is a legacy stat. Legacy stat is a stat that does not belong to any statistics::Group. Legacy stat is deprecated.
board.vncserver: Listening for connections on port 5900
board.terminal: Listening for connections on port 3456
board.realview.uart1.device: Listening for connections on port 3457
board.realview.uart2.device: Listening for connections on port 3458
board.realview.uart3.device: Listening for connections on port 3459
board.remote_gdb: Listening for connections on port 7000
build/ARM/arch/arm/fs_workload.cc:121: info: Using bootloader at address 0x10
build/ARM/arch/arm/fs_workload.cc:139: info: Using kernel entry physical address at 0x80080000
build/ARM/arch/arm/linux/fs_workload.cc:111: info: Loading DTB file: m5out/device.dtb at address 0x88000000
build/ARM/dev/arm/energy_ctrl.cc:252: warn: Existing EnergyCtrl, but no enabled DVFSHandler found.
build/ARM/sim/simulate.cc:194: info: Entering event queue @ 0.  Starting simulation...
build/ARM/cpu/simple/atomic.cc:508: panic: panic condition pkt.isError() occurred: Data write ([0x2c001000:0x2c001004]) failed: BadAddressError [2c001000:2c001003] (s) UC
Memory Usage: 2731448 KBytes
Program aborted at tick 21000
--- BEGIN LIBC BACKTRACE ---
./build/ARM/gem5.opt(+0x230ecd0)[0x5607b47aecd0]
./build/ARM/gem5.opt(+0x233409c)[0x5607b47d409c]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7fadd9256520]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7fadd92aaa7c]
/lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7fadd9256476]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7fadd923c7f3]
./build/ARM/gem5.opt(+0x7cbc55)[0x5607b2c6bc55]
./build/ARM/gem5.opt(+0x127e574)[0x5607b371e574]
./build/ARM/gem5.opt(+0x1295939)[0x5607b3735939]
./build/ARM/gem5.opt(+0x1bd0d4d)[0x5607b4070d4d]
./build/ARM/gem5.opt(+0x1b7a789)[0x5607b401a789]
./build/ARM/gem5.opt(+0x127c04d)[0x5607b371c04d]
./build/ARM/gem5.opt(+0x23233d2)[0x5607b47c33d2]
./build/ARM/gem5.opt(+0x234bcd8)[0x5607b47ebcd8]
./build/ARM/gem5.opt(+0x234c2cb)[0x5607b47ec2cb]
./build/ARM/gem5.opt(+0x226f0f0)[0x5607b470f0f0]
./build/ARM/gem5.opt(+0x7b4dd4)[0x5607b2c54dd4]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x12b6d3)[0x7fadd9d546d3]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyObject_Call+0x5c)[0x7fadd9d1022c]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x4b26)[0x7fadd9c9f766]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x9d78)[0x7fadd9ca49b8]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x82ae)[0x7fadd9ca2eee]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(PyEval_EvalCode+0xbe)[0x7fadd9dea94e]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c1edd)[0x7fadd9deaedd]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x12eb13)[0x7fadd9d57b13]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x69ee)[0x7fadd9ca162e]
/lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f]
./build/ARM/gem5.opt(+0x22557b7)[0x5607b46f57b7]
./build/ARM/gem5.opt(+0x78604b)[0x5607b2c2604b]
--- END LIBC BACKTRACE ---
Aborted (core dumped)

If I change the bootloader to use boot_foundation (I tried this one because it was what's used in the original script)
It then starts booting up but I get this error instead:

.....
build/ARM/kern/linux/events.cc:63: info: Dumping kernel dmesg buffer to board.workload.dmesg...
build/ARM/kern/linux/events.cc:68: warn: Kernel panic in simulated kernel

If I run ./util/term/m5term port_number (here it was 3456) in another terminal I get this:

==== m5 terminal: Terminal 0 ====
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd070]
[    0.000000] Linux version 5.4.49 (kaustavg@citra) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #1 SMP PREEMPT Thu Apr 28 13:59:17 PDT 2022
[    0.000000] Machine model: V2P-CA15
[    0.000000] Memory limited to 2048MB
[    0.000000] cma: Reserved 16 MiB at 0x00000000ff000000
[    0.000000] percpu: Embedded 22 pages/cpu s49688 r8192 d32232 u90112
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 832075
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] CPU features: detected: ARM erratum 834220
[    0.000000] CPU features: detected: EL2 vector hardening
[    0.000000] ARM_SMCCC_ARCH_WORKAROUND_1 missing from firmware
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516096
[    0.000000] Kernel command line: console=ttyAMA0 lpj=19988480 norandmaps root=/dev/vda rw mem=2147483648
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 2030408K/2097152K available (6846K kernel code, 458K rwdata, 2236K rodata, 448K init, 203K bss, 50360K reserved, 16384K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:            RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=1.
[    0.000000]      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=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 988 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: no VLPI support, direct LPI support
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x000000002f100000
[    0.000000] ITS: No ITS available, not enabling LPIs
[    0.000000] random: get_random_bytes called from start_kernel+0x2ac/0x420 with crng_init=0
[    0.000002] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000185] arch_timer: cp15 and mmio timer(s) running at 25.16MHz (phys/virt).
[    0.000191] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x5cdd39714, max_idle_ns: 440795202620 ns
[    0.000198] sched_clock: 56 bits at 25MHz, resolution 39ns, wraps every 4398046511084ns
[    0.000290] Console: colour dummy device 80x25
[    0.000300] Calibrating delay loop (skipped) preset value.. 9994.24 BogoMIPS (lpj=19988480)
[    0.000308] pid_max: default: 32768 minimum: 301
[    0.000378] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.000388] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.024131] ASID allocator initialised with 128 entries
[    0.032131] rcu: Hierarchical SRCU implementation.
[    0.048151] smp: Bringing up secondary CPUs ...
[    0.048157] smp: Brought up 1 node, 1 CPU
[    0.048161] SMP: Total of 1 processors activated.
[    0.048166] CPU features: detected: Privileged Access Never
[    0.048171] CPU features: detected: User Access Override
[    0.048176] CPU features: detected: 32-bit EL0 Support
[    0.048181] CPU features: detected: Scalable Vector Extension
[    0.048187] CPU features: detected: Data cache clean to the PoU not required for I/D coherence
[    0.048193] CPU features: detected: Address authentication (architected algorithm)
[    0.048198] CPU features: detected: Generic authentication (architected algorithm)
[    0.048556] SVE: maximum available vector length 16 bytes per vector
[    0.048561] SVE: default vector length 16 bytes per vector
[    0.048565] CPU: All CPU(s) started at EL2
[    0.048574] alternatives: patching kernel code
[    0.049978] devtmpfs: initialized
[    0.051367] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.051375] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.052797] NET: Registered protocol family 16
[    0.057817] DMA: preallocated 256 KiB pool for atomic allocations
[    0.137227] cpuidle: using governor menu
[    0.137360] hw-breakpoint: found 16 breakpoint and 16 watchpoint registers.
[    0.137378] Serial: AMBA PL011 UART driver
[    0.137780] OF: amba_device_add() failed (-2) for /watchdog@2a490000
[    0.138187] OF: amba_device_add() failed (-2) for /watchdog@2b060000
[    0.138388] 1c090000.uart: ttyAMA0 at MMIO 0x1c090000 (irq = 13, base_baud = 0) is a PL011 rev3
[    0.138890] printk: console [ttyAMA0] enabled
[    0.139440] 1c0a0000.uart: ttyAMA1 at MMIO 0x1c0a0000 (irq = 14, base_baud = 0) is a PL011 rev3
[    0.139834] 1c0b0000.uart: ttyAMA2 at MMIO 0x1c0b0000 (irq = 15, base_baud = 0) is a PL011 rev3
[    0.140257] 1c0c0000.uart: ttyAMA3 at MMIO 0x1c0c0000 (irq = 16, base_baud = 0) is a PL011 rev3
[    0.140543] OF: amba_device_add() failed (-2) for /kmi@1c060000
[    0.140660] OF: amba_device_add() failed (-2) for /kmi@1c070000
[    0.140779] OF: /watchdog@1c0f0000: could not find phandle
[    0.140790] OF: amba_device_add() failed (-2) for /watchdog@1c0f0000
[    0.140907] OF: /rtc@1c170000: could not find phandle
[    0.140917] OF: amba_device_add() failed (-2) for /rtc@1c170000
[    0.161899] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.161910] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.161921] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.161931] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.164780] vgaarb: loaded
[    0.164928] SCSI subsystem initialized
[    0.168418] usbcore: registered new interface driver usbfs
[    0.168452] usbcore: registered new interface driver hub
[    0.168480] usbcore: registered new device driver usb
[    0.168540] pps_core: LinuxPPS API ver. 1 registered
[    0.168548] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[    0.168567] PTP clock support registered
[    0.169700] clocksource: Switched to clocksource arch_sys_counter
[    0.176470] NET: Registered protocol family 2
[    0.176762] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.176789] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.176934] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
[    0.177141] TCP: Hash tables configured (established 16384 bind 16384)
[    0.177178] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.177216] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.177307] NET: Registered protocol family 1
[    0.193487] RPC: Registered named UNIX socket transport module.
[    0.193495] RPC: Registered udp transport module.
[    0.193503] RPC: Registered tcp transport module.
[    0.193511] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.193520] PCI: CLS 0 bytes, default 64
[    0.193811] kvm [1]: CPU unsupported in non-VHE mode, not initializing
[    0.194563] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[    0.204675] fuse: init (API version 7.31)
[    0.205284] io scheduler mq-deadline registered
[    0.205292] io scheduler kyber registered
[    0.205309] atomic64_test: passed
[    0.206019] pci-host-generic 40000000.pci: host bridge /pci ranges:
[    0.206032] pci-host-generic 40000000.pci:  No bus range found for /pci, using [bus 00-ff]
[    0.206063] pci-host-generic 40000000.pci:    IO 0x50000000..0x5000ffff -> 0x00000000
[    0.206083] pci-host-generic 40000000.pci:  MEM 0x4000000000..0x403fffffff -> 0x00000000
[    0.206128] pci-host-generic 40000000.pci: ECAM at [mem 0x40000000-0x4fffffff] for [bus 00-ff]
[    0.206236] pci-host-generic 40000000.pci: PCI host bridge to bus 0000:00
[    0.206248] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.206260] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    0.206274] pci_bus 0000:00: root bus resource [mem 0x4000000000-0x403fffffff] (bus address [0x00000000-0x3fffffff])
[    0.206312] pci 0000:00:01.0: [1af4:1000] type 00 class 0xff0000
[    0.206331] pci 0000:00:01.0: reg 0x10: [io  0x0000-0x001f]
[    0.206358] pci 0000:00:01.0: reg 0x30: [mem 0x4000000000-0x40000007ff pref]
[    0.206864] pci 0000:00:01.0: BAR 6: assigned [mem 0x4000000000-0x40000007ff pref]
[    0.206877] pci 0000:00:01.0: BAR 0: assigned [io  0x1000-0x101f]
[    0.207528] virtio-pci 0000:00:01.0: enabling device (0000 -> 0001)
[    0.207541] virtio-pci 0000:00:01.0: virtio_pci: leaving for legacy driver
[    0.211820] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.212885] virtio_blk virtio0: [vda] 3906250 512-byte logical blocks (2.00 GB/1.86 GiB)
[    0.218740]  vda: vda1
[    0.228387] libphy: Fixed MDIO Bus: probed
[    0.228395] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    0.228404] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    0.228441] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    0.228449] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    0.228487] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[    0.228496] igb: Copyright (c) 2007-2014 Intel Corporation.
[    0.228536] ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 5.1.0-k
[    0.228545] ixgbe: Copyright (c) 1999-2016 Intel Corporation.
[    0.233357] ixgbevf: Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver - version 4.1.0-k
[    0.233367] ixgbevf: Copyright (c) 2009 - 2018 Intel Corporation.
[    0.237488] i40e: Intel(R) Ethernet Connection XL710 Network Driver - version 2.8.20-k
[    0.237498] i40e: Copyright (c) 2013 - 2019 Intel Corporation.
[    0.241635] ixgb: Intel(R) PRO/10GbE Network Driver - version 1.0.135-k2-NAPI
[    0.241645] ixgb: Copyright (c) 1999-2008 Intel Corporation.
[    0.241682] iavf: Intel(R) Ethernet Adaptive Virtual Function Network Driver - version 3.2.3-k
[    0.241692] Copyright (c) 2013 - 2018 Intel Corporation.
[    0.246088] usbcore: registered new interface driver usb-storage
[    0.246470] mousedev: PS/2 mouse device common for all mice
[    0.246594] IR NEC protocol handler initialized
[    0.246601] IR RC5(x/sz) protocol handler initialized
[    0.246609] IR RC6 protocol handler initialized
[    0.246616] IR JVC protocol handler initialized
[    0.246623] IR Sony protocol handler initialized
[    0.246631] IR SANYO protocol handler initialized
[    0.246638] IR Sharp protocol handler initialized
[    0.246645] IR MCE Keyboard/mouse protocol handler initialized
[    0.246653] IR XMP protocol handler initialized
[    0.247257] usbcore: registered new interface driver usbhid
[    0.247265] usbhid: USB HID core driver
[    0.247355] NET: Registered protocol family 17
[    0.249517] List of all partitions:
[    0.249527] fe00        1953125 vda
[    0.249528]  driver: virtio_blk
[    0.249542]  fe01        1952997 vda1 93d4895b-01
[    0.249544]
[    0.249555] No filesystem could mount root, tried:
[    0.249557]  ext3
[    0.249564]  ext4
[    0.249570]  ext2
[    0.249575]  vfat
[    0.249581]  fuseblk
[    0.249587]
[    0.249598] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(254,0)
[    0.249609] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.49 #1
[    0.249617] Hardware name: V2P-CA15 (DT)
[    0.249623] Call trace:
[    0.249630]  dump_backtrace+0x0/0x140
[    0.249638]  show_stack+0x14/0x20
[    0.249646]  dump_stack+0xa8/0xd0
[    0.249654]  panic+0x150/0x308
[    0.249663]  mount_block_root+0x254/0x288
[    0.249672]  mount_root+0x124/0x15c
[    0.249681]  prepare_namespace+0x12c/0x170
[    0.249691]  kernel_init_freeable+0x1b0/0x1c8
[    0.249700]  kernel_init+0x10/0xfc
[    0.249708]  ret_from_fork+0x10/0x18
[    0.249715] Kernel Offset: disabled
[    0.249722] CPU features: 0x0140,2840629a
[    0.249728] Memory Limit: 2048 MB
[    0.249737] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(254,0) ]---

Because of this I think the problem is the bootloader isn't working with my current config script? Or just a problem with bootloaders and the ArmBoard in general.

Any help would be greatly appreciated!!

Thank you,
Abdal

Hello gem5 community, I am relatively new to gem5 and I may be missing something very obvious here. I am trying to run SE and FS simulations on both basic ARM and RISCV configurations and I want to do this using the gem5 standard library. I have managed to get these all to run without using the standard library. With the standard library I have managed to get an SE sim to work for both ARM and RISCV. Also a RISCV FS sim has worked for me. The problem is the ARM sim with FS mode. I have tried many different bootloaders, kernels and disk images, both from gem5 resources json(resources.json - public/gem5-resources - Git at Google (googlesource.com)<https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/resources.json>) and from online (like from https://www.gem5.org/documentation/general_docs/fullsystem/guest_binaries). I am running the newest version of gem5 (develop branch). Without using the standard library, this command works for me: ./build/ARM/gem5.opt configs/deprecated/example/fs.py \ --cpu-type=AtomicSimple \ --bootloader=CustomResources/arm/fs_images/binaries/boot.arm64 \ --kernel=CustomResources/arm/arm64-vmlinux-5.4.49 \ --disk=CustomResources/arm/arm64-ubuntu-20220425.img fsbigLITTLE.py also works fine. I have tried 2 config scripts, both with the same result essentially. This one is a slightly modified version of arm-ubuntu-run.py: from gem5.isas import ISA from m5.objects import ArmDefaultRelease from gem5.utils.requires import requires from gem5.resources.workload import Workload from gem5.simulate.simulator import Simulator from m5.objects import VExpress_GEM5_Foundation from gem5.coherence_protocol import CoherenceProtocol from gem5.components.boards.arm_board import ArmBoard from gem5.components.memory import DualChannelDDR4_2400 from gem5.components.processors.cpu_types import CPUTypes from gem5.components.processors.simple_processor import SimpleProcessor from gem5.resources.resource import Resource, AbstractResource, DiskImageResource requires(isa_required=ISA.ARM) from gem5.components.cachehierarchies.classic.no_cache import NoCache cache_hierarchy = NoCache() memory = DualChannelDDR4_2400(size="2GB") processor = SimpleProcessor(cpu_type=CPUTypes.ATOMIC, num_cores=1, isa=ISA.ARM) release = ArmDefaultRelease() platform = VExpress_GEM5_Foundation() board = ArmBoard( clk_freq="1GHz", processor=processor, memory=memory, cache_hierarchy=cache_hierarchy, release=release, platform=platform, ) #MY CURRENT REASONING FOR WHATS WRONG IS THE BOOTLOADER IS READ INCORRECTLY #The reason I use AbstractResource instead of Resource is because Resource for me gets blocked - Abstract has worked for me with RISCV board.set_kernel_disk_workload( bootloader=AbstractResource("CustomResources/arm/boot.arm64-20220707"), kernel=AbstractResource("CustomResources/arm/arm64-vmlinux-5.4.49"), disk_image=DiskImageResource("CustomResources/arm/arm64-ubuntu-20220425.img"), ) simulator = Simulator(board=board) simulator.run() I have changed the memory, cache hierarchy and workloads to no success. Also some other random things like memory size, clock frequency etc. This is output if I use these binary/image combination with stdlib using command: ./build/ARM/gem5.opt configs/example/gem5_library/arm-ubuntu-run.py .... command line: ./build/ARM/gem5.opt configs/example/gem5_library/arm-ubuntu-run.py warn: The simulate package is still in a beta state. The gem5 project does not guarantee the APIs within this package will remain consistent across upcoming releases. Global frequency set at 1000000000000 ticks per second warn: No dot file generated. Please install pydot to generate the dot file and pdf. build/ARM/mem/dram_interface.cc:690: warn: DRAM device capacity (16384 Mbytes) does not match the address range assigned (1024 Mbytes) build/ARM/mem/dram_interface.cc:690: warn: DRAM device capacity (16384 Mbytes) does not match the address range assigned (1024 Mbytes) build/ARM/sim/kernel_workload.cc:46: info: kernel located at: CustomResources/arm/arm64-vmlinux-5.4.49 build/ARM/base/statistics.hh:279: warn: One of the stats is a legacy stat. Legacy stat is a stat that does not belong to any statistics::Group. Legacy stat is deprecated. board.vncserver: Listening for connections on port 5900 board.terminal: Listening for connections on port 3456 board.realview.uart1.device: Listening for connections on port 3457 board.realview.uart2.device: Listening for connections on port 3458 board.realview.uart3.device: Listening for connections on port 3459 board.remote_gdb: Listening for connections on port 7000 build/ARM/arch/arm/fs_workload.cc:121: info: Using bootloader at address 0x10 build/ARM/arch/arm/fs_workload.cc:139: info: Using kernel entry physical address at 0x80080000 build/ARM/arch/arm/linux/fs_workload.cc:111: info: Loading DTB file: m5out/device.dtb at address 0x88000000 build/ARM/dev/arm/energy_ctrl.cc:252: warn: Existing EnergyCtrl, but no enabled DVFSHandler found. build/ARM/sim/simulate.cc:194: info: Entering event queue @ 0. Starting simulation... build/ARM/cpu/simple/atomic.cc:508: panic: panic condition pkt.isError() occurred: Data write ([0x2c001000:0x2c001004]) failed: BadAddressError [2c001000:2c001003] (s) UC Memory Usage: 2731448 KBytes Program aborted at tick 21000 --- BEGIN LIBC BACKTRACE --- ./build/ARM/gem5.opt(+0x230ecd0)[0x5607b47aecd0] ./build/ARM/gem5.opt(+0x233409c)[0x5607b47d409c] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7fadd9256520] /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7fadd92aaa7c] /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7fadd9256476] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7fadd923c7f3] ./build/ARM/gem5.opt(+0x7cbc55)[0x5607b2c6bc55] ./build/ARM/gem5.opt(+0x127e574)[0x5607b371e574] ./build/ARM/gem5.opt(+0x1295939)[0x5607b3735939] ./build/ARM/gem5.opt(+0x1bd0d4d)[0x5607b4070d4d] ./build/ARM/gem5.opt(+0x1b7a789)[0x5607b401a789] ./build/ARM/gem5.opt(+0x127c04d)[0x5607b371c04d] ./build/ARM/gem5.opt(+0x23233d2)[0x5607b47c33d2] ./build/ARM/gem5.opt(+0x234bcd8)[0x5607b47ebcd8] ./build/ARM/gem5.opt(+0x234c2cb)[0x5607b47ec2cb] ./build/ARM/gem5.opt(+0x226f0f0)[0x5607b470f0f0] ./build/ARM/gem5.opt(+0x7b4dd4)[0x5607b2c54dd4] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x12b6d3)[0x7fadd9d546d3] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyObject_Call+0x5c)[0x7fadd9d1022c] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x4b26)[0x7fadd9c9f766] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x9d78)[0x7fadd9ca49b8] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x82ae)[0x7fadd9ca2eee] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(PyEval_EvalCode+0xbe)[0x7fadd9dea94e] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c1edd)[0x7fadd9deaedd] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x12eb13)[0x7fadd9d57b13] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x69ee)[0x7fadd9ca162e] /lib/x86_64-linux-gnu/libpython3.10.so.1.0(+0x1c681f)[0x7fadd9def81f] ./build/ARM/gem5.opt(+0x22557b7)[0x5607b46f57b7] ./build/ARM/gem5.opt(+0x78604b)[0x5607b2c2604b] --- END LIBC BACKTRACE --- Aborted (core dumped) If I change the bootloader to use boot_foundation (I tried this one because it was what's used in the original script) It then starts booting up but I get this error instead: ..... build/ARM/kern/linux/events.cc:63: info: Dumping kernel dmesg buffer to board.workload.dmesg... build/ARM/kern/linux/events.cc:68: warn: Kernel panic in simulated kernel If I run ./util/term/m5term port_number (here it was 3456) in another terminal I get this: ==== m5 terminal: Terminal 0 ==== [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd070] [ 0.000000] Linux version 5.4.49 (kaustavg@citra) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #1 SMP PREEMPT Thu Apr 28 13:59:17 PDT 2022 [ 0.000000] Machine model: V2P-CA15 [ 0.000000] Memory limited to 2048MB [ 0.000000] cma: Reserved 16 MiB at 0x00000000ff000000 [ 0.000000] percpu: Embedded 22 pages/cpu s49688 r8192 d32232 u90112 [ 0.000000] Detected PIPT I-cache on CPU0 [ 0.000000] CPU features: detected: ARM erratum 832075 [ 0.000000] CPU features: detected: GIC system register CPU interface [ 0.000000] CPU features: detected: ARM erratum 834220 [ 0.000000] CPU features: detected: EL2 vector hardening [ 0.000000] ARM_SMCCC_ARCH_WORKAROUND_1 missing from firmware [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 516096 [ 0.000000] Kernel command line: console=ttyAMA0 lpj=19988480 norandmaps root=/dev/vda rw mem=2147483648 [ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 2030408K/2097152K available (6846K kernel code, 458K rwdata, 2236K rodata, 448K init, 203K bss, 50360K reserved, 16384K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=1. [ 0.000000] 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=1 [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GICv3: GIC: Using split EOI/Deactivate mode [ 0.000000] GICv3: 988 SPIs implemented [ 0.000000] GICv3: 0 Extended SPIs implemented [ 0.000000] GICv3: Distributor has Range Selector support [ 0.000000] GICv3: 16 PPIs implemented [ 0.000000] GICv3: no VLPI support, direct LPI support [ 0.000000] GICv3: CPU0: found redistributor 0 region 0:0x000000002f100000 [ 0.000000] ITS: No ITS available, not enabling LPIs [ 0.000000] random: get_random_bytes called from start_kernel+0x2ac/0x420 with crng_init=0 [ 0.000002] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.000185] arch_timer: cp15 and mmio timer(s) running at 25.16MHz (phys/virt). [ 0.000191] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x5cdd39714, max_idle_ns: 440795202620 ns [ 0.000198] sched_clock: 56 bits at 25MHz, resolution 39ns, wraps every 4398046511084ns [ 0.000290] Console: colour dummy device 80x25 [ 0.000300] Calibrating delay loop (skipped) preset value.. 9994.24 BogoMIPS (lpj=19988480) [ 0.000308] pid_max: default: 32768 minimum: 301 [ 0.000378] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.000388] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.024131] ASID allocator initialised with 128 entries [ 0.032131] rcu: Hierarchical SRCU implementation. [ 0.048151] smp: Bringing up secondary CPUs ... [ 0.048157] smp: Brought up 1 node, 1 CPU [ 0.048161] SMP: Total of 1 processors activated. [ 0.048166] CPU features: detected: Privileged Access Never [ 0.048171] CPU features: detected: User Access Override [ 0.048176] CPU features: detected: 32-bit EL0 Support [ 0.048181] CPU features: detected: Scalable Vector Extension [ 0.048187] CPU features: detected: Data cache clean to the PoU not required for I/D coherence [ 0.048193] CPU features: detected: Address authentication (architected algorithm) [ 0.048198] CPU features: detected: Generic authentication (architected algorithm) [ 0.048556] SVE: maximum available vector length 16 bytes per vector [ 0.048561] SVE: default vector length 16 bytes per vector [ 0.048565] CPU: All CPU(s) started at EL2 [ 0.048574] alternatives: patching kernel code [ 0.049978] devtmpfs: initialized [ 0.051367] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.051375] futex hash table entries: 256 (order: 2, 16384 bytes, linear) [ 0.052797] NET: Registered protocol family 16 [ 0.057817] DMA: preallocated 256 KiB pool for atomic allocations [ 0.137227] cpuidle: using governor menu [ 0.137360] hw-breakpoint: found 16 breakpoint and 16 watchpoint registers. [ 0.137378] Serial: AMBA PL011 UART driver [ 0.137780] OF: amba_device_add() failed (-2) for /watchdog@2a490000 [ 0.138187] OF: amba_device_add() failed (-2) for /watchdog@2b060000 [ 0.138388] 1c090000.uart: ttyAMA0 at MMIO 0x1c090000 (irq = 13, base_baud = 0) is a PL011 rev3 [ 0.138890] printk: console [ttyAMA0] enabled [ 0.139440] 1c0a0000.uart: ttyAMA1 at MMIO 0x1c0a0000 (irq = 14, base_baud = 0) is a PL011 rev3 [ 0.139834] 1c0b0000.uart: ttyAMA2 at MMIO 0x1c0b0000 (irq = 15, base_baud = 0) is a PL011 rev3 [ 0.140257] 1c0c0000.uart: ttyAMA3 at MMIO 0x1c0c0000 (irq = 16, base_baud = 0) is a PL011 rev3 [ 0.140543] OF: amba_device_add() failed (-2) for /kmi@1c060000 [ 0.140660] OF: amba_device_add() failed (-2) for /kmi@1c070000 [ 0.140779] OF: /watchdog@1c0f0000: could not find phandle [ 0.140790] OF: amba_device_add() failed (-2) for /watchdog@1c0f0000 [ 0.140907] OF: /rtc@1c170000: could not find phandle [ 0.140917] OF: amba_device_add() failed (-2) for /rtc@1c170000 [ 0.161899] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages [ 0.161910] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages [ 0.161921] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages [ 0.161931] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages [ 0.164780] vgaarb: loaded [ 0.164928] SCSI subsystem initialized [ 0.168418] usbcore: registered new interface driver usbfs [ 0.168452] usbcore: registered new interface driver hub [ 0.168480] usbcore: registered new device driver usb [ 0.168540] pps_core: LinuxPPS API ver. 1 registered [ 0.168548] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it> [ 0.168567] PTP clock support registered [ 0.169700] clocksource: Switched to clocksource arch_sys_counter [ 0.176470] NET: Registered protocol family 2 [ 0.176762] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear) [ 0.176789] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear) [ 0.176934] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear) [ 0.177141] TCP: Hash tables configured (established 16384 bind 16384) [ 0.177178] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 0.177216] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 0.177307] NET: Registered protocol family 1 [ 0.193487] RPC: Registered named UNIX socket transport module. [ 0.193495] RPC: Registered udp transport module. [ 0.193503] RPC: Registered tcp transport module. [ 0.193511] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.193520] PCI: CLS 0 bytes, default 64 [ 0.193811] kvm [1]: CPU unsupported in non-VHE mode, not initializing [ 0.194563] workingset: timestamp_bits=62 max_order=19 bucket_order=0 [ 0.204675] fuse: init (API version 7.31) [ 0.205284] io scheduler mq-deadline registered [ 0.205292] io scheduler kyber registered [ 0.205309] atomic64_test: passed [ 0.206019] pci-host-generic 40000000.pci: host bridge /pci ranges: [ 0.206032] pci-host-generic 40000000.pci: No bus range found for /pci, using [bus 00-ff] [ 0.206063] pci-host-generic 40000000.pci: IO 0x50000000..0x5000ffff -> 0x00000000 [ 0.206083] pci-host-generic 40000000.pci: MEM 0x4000000000..0x403fffffff -> 0x00000000 [ 0.206128] pci-host-generic 40000000.pci: ECAM at [mem 0x40000000-0x4fffffff] for [bus 00-ff] [ 0.206236] pci-host-generic 40000000.pci: PCI host bridge to bus 0000:00 [ 0.206248] pci_bus 0000:00: root bus resource [bus 00-ff] [ 0.206260] pci_bus 0000:00: root bus resource [io 0x0000-0xffff] [ 0.206274] pci_bus 0000:00: root bus resource [mem 0x4000000000-0x403fffffff] (bus address [0x00000000-0x3fffffff]) [ 0.206312] pci 0000:00:01.0: [1af4:1000] type 00 class 0xff0000 [ 0.206331] pci 0000:00:01.0: reg 0x10: [io 0x0000-0x001f] [ 0.206358] pci 0000:00:01.0: reg 0x30: [mem 0x4000000000-0x40000007ff pref] [ 0.206864] pci 0000:00:01.0: BAR 6: assigned [mem 0x4000000000-0x40000007ff pref] [ 0.206877] pci 0000:00:01.0: BAR 0: assigned [io 0x1000-0x101f] [ 0.207528] virtio-pci 0000:00:01.0: enabling device (0000 -> 0001) [ 0.207541] virtio-pci 0000:00:01.0: virtio_pci: leaving for legacy driver [ 0.211820] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 0.212885] virtio_blk virtio0: [vda] 3906250 512-byte logical blocks (2.00 GB/1.86 GiB) [ 0.218740] vda: vda1 [ 0.228387] libphy: Fixed MDIO Bus: probed [ 0.228395] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI [ 0.228404] e1000: Copyright (c) 1999-2006 Intel Corporation. [ 0.228441] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k [ 0.228449] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 0.228487] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k [ 0.228496] igb: Copyright (c) 2007-2014 Intel Corporation. [ 0.228536] ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 5.1.0-k [ 0.228545] ixgbe: Copyright (c) 1999-2016 Intel Corporation. [ 0.233357] ixgbevf: Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver - version 4.1.0-k [ 0.233367] ixgbevf: Copyright (c) 2009 - 2018 Intel Corporation. [ 0.237488] i40e: Intel(R) Ethernet Connection XL710 Network Driver - version 2.8.20-k [ 0.237498] i40e: Copyright (c) 2013 - 2019 Intel Corporation. [ 0.241635] ixgb: Intel(R) PRO/10GbE Network Driver - version 1.0.135-k2-NAPI [ 0.241645] ixgb: Copyright (c) 1999-2008 Intel Corporation. [ 0.241682] iavf: Intel(R) Ethernet Adaptive Virtual Function Network Driver - version 3.2.3-k [ 0.241692] Copyright (c) 2013 - 2018 Intel Corporation. [ 0.246088] usbcore: registered new interface driver usb-storage [ 0.246470] mousedev: PS/2 mouse device common for all mice [ 0.246594] IR NEC protocol handler initialized [ 0.246601] IR RC5(x/sz) protocol handler initialized [ 0.246609] IR RC6 protocol handler initialized [ 0.246616] IR JVC protocol handler initialized [ 0.246623] IR Sony protocol handler initialized [ 0.246631] IR SANYO protocol handler initialized [ 0.246638] IR Sharp protocol handler initialized [ 0.246645] IR MCE Keyboard/mouse protocol handler initialized [ 0.246653] IR XMP protocol handler initialized [ 0.247257] usbcore: registered new interface driver usbhid [ 0.247265] usbhid: USB HID core driver [ 0.247355] NET: Registered protocol family 17 [ 0.249517] List of all partitions: [ 0.249527] fe00 1953125 vda [ 0.249528] driver: virtio_blk [ 0.249542] fe01 1952997 vda1 93d4895b-01 [ 0.249544] [ 0.249555] No filesystem could mount root, tried: [ 0.249557] ext3 [ 0.249564] ext4 [ 0.249570] ext2 [ 0.249575] vfat [ 0.249581] fuseblk [ 0.249587] [ 0.249598] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(254,0) [ 0.249609] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.49 #1 [ 0.249617] Hardware name: V2P-CA15 (DT) [ 0.249623] Call trace: [ 0.249630] dump_backtrace+0x0/0x140 [ 0.249638] show_stack+0x14/0x20 [ 0.249646] dump_stack+0xa8/0xd0 [ 0.249654] panic+0x150/0x308 [ 0.249663] mount_block_root+0x254/0x288 [ 0.249672] mount_root+0x124/0x15c [ 0.249681] prepare_namespace+0x12c/0x170 [ 0.249691] kernel_init_freeable+0x1b0/0x1c8 [ 0.249700] kernel_init+0x10/0xfc [ 0.249708] ret_from_fork+0x10/0x18 [ 0.249715] Kernel Offset: disabled [ 0.249722] CPU features: 0x0140,2840629a [ 0.249728] Memory Limit: 2048 MB [ 0.249737] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(254,0) ]--- Because of this I think the problem is the bootloader isn't working with my current config script? Or just a problem with bootloaders and the ArmBoard in general. Any help would be greatly appreciated!! Thank you, Abdal