Search code examples
gem5

warn: ignoring syscall mprotect(...) during simple gem5 simulation


I built gem5 for X86 and am running simple configs and binaries. To be more specific, I am using following config file gem5/configs/learning_gem5/part1/two_level.py When I use officially provided binaries such as gem5/tests/test-progs/hello/bin/x86/linux/hello, it gives the Hello World output without any warning. As following

Beginning simulation!
info: Entering event queue @ 0.  Starting simulation...
Hello world!
Exiting @ tick 57562000 because exiting with last active thread context

However, when I code and compile the simple hello world example, the output of the simulation still works but it gives some warnings and it takes many more ticks. As,

Beginning simulation!
info: Entering event queue @ 0.  Starting simulation...
warn: ignoring syscall access(...)
info: Increasing stack size by one page.
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
Hello - Custom
Exiting @ tick 883281000 because exiting with last active thread context

What is the reason for this? Is there a way to solve these warnings so that my custom coded binaries take less time (or ticks)?


Solution

  • The syscall is not implemented, but gem5 devs decided it is usually not needed for the program to run normally enough, and so marked as ignore rather than crash. Syscalls are always 1 tick in SE mode, so implementing it generally won't make much of a difference, unless you have good reason to believe otherwise due to side-effects of the call. See also: gem5 syscall emulation arm C hello world fails with "fatal: syscall gettid (#224) unimplemented"