Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs.py --generate-dtb Linux kernel boot simulation fails for aarch64 with "Exiting @ tick because simulate() limit reached" #18

Closed
cirosantilli2 opened this issue May 17, 2018 · 4 comments
Labels

Comments

@cirosantilli2
Copy link
Owner

cirosantilli2 commented May 17, 2018

https://www.mail-archive.com/[email protected]/msg15539.html

I had both aarch64 and arm working with --dtb-file using: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/0678bd82ac61f0decce3480fef798bd5edbfd0c3#gem5

But now I've learnt about the awesome --generate-dtb option, which would make my setup simpler, and I'd like to use it.

If I replace my --dtb-file with --generate-dtb on an arm simulation, it all worked fine and Linux booted.

However, for a very analogous boot of aarch64 nothing shows on the terminal and gem5 exits with an error.

gem5 revision: 49f96e7b77925837aa5bc84d4c3453ab5f07408e (current master)

full gem5 command line:

M5_PATH='/work/linux-kernel-module-cheat/out/common/gem5/system' \
 '/work/linux-kernel-module-cheat/out/common/gem5/build/ARM/gem5.opt' \
--debug-file=trace.txt \
 -d '/work/linux-kernel-module-cheat/out/aarch64/gem5/m5out' \
'/work/linux-kernel-module-cheat/gem5/gem5/configs/example/fs.py' \
--disk-image='/work/linux-kernel-module-cheat/out/aarch64/buildroot/images/rootfs.ext2' \
--kernel='/work/linux-kernel-module-cheat/out/aarch64/buildroot/build/linux-custom/vmlinux' \
--mem-size='256MB' \
--num-cpus='1' \
--script='/work/linux-kernel-module-cheat/data/readfile' \
 --command-line='earlyprintk=pl011,0x1c090000 console=ttyAMA0 lpj=19988480 rw loglevel=8 mem=256MB root=/dev/sda console_msg_format=syslog nokaslr norandmaps printk.devkmsg=on printk.time=y' \
--generate-dtb \
--machine-type=VExpress_GEM5_V1 \

It boots correctly however I use instead of --generate-dtb:

--dtb-file='/work/linux-kernel-module-cheat/out/common/gem5/system/arm/dt/armv8_gem5_v1_1cpu.dtb' \

Error message:

**** REAL SIMULATION ****
warn: Existing EnergyCtrl, but no enabled DVFSHandler found.
info: Entering event queue @ 0.  Starting simulation...
warn: SCReg: Access to unknown device dcc0:site0:pos0:fn7:dev0
warn: Tried to read RealView I/O at offset 0x60 that doesn't exist
warn: Tried to read RealView I/O at offset 0x48 that doesn't exist
warn: Tried to write RVIO at offset 0xa8 (data 0) that doesn't exist
Exiting @ tick 18446744073709551615 because simulate() limit reached
@cdunham
Copy link

cdunham commented May 17, 2018

Hi Ciro,
You are probably experiencing this problem because the simulated CPU enters a wait state (e.g. via WFI/WFE on Arm) but without any simulated (or otherwise, i.e. user provided) I/O activity, no event ever gets scheduled and time immediately proceeds to its maximum value, resulting in this message.

To avoid this, you need to activate time_sync_enable on the Root object (see src/sim/Root.py:73-75). You will find that this can be enabled using the --timesync argument to fs.py.

Regards,
Curtis

@cdunham
Copy link

cdunham commented May 17, 2018

Ah I see you mention nothing shows on the terminal. Possibly you are running into another issue first.

@cirosantilli2
Copy link
Owner Author

@cdunham thanks for the tip, if I pass --timesync it does not exit anymore with limit reached but rather appears to hang without any output on terminal. Let me know if you manage to reproduce, or have a working aarch64 setup.

@cirosantilli2
Copy link
Owner Author

Can't reproduce anymore on a5bc2291391b0497fdc60fdc960e07bcecebfb8f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants