Hi Gogineni. By adding extra entries to x86's system call table, all you
did was tell gem5 those system calls existed so that it could print a more
informative message about them not being implemented. Your second change,
when you added getrandomFunc to the getrandom entry, would work, except you
have to actually implement a getrandomFunc. You can look at the
implementations in src/sim/syscall_emul.hh and src/sim/syscall_emul.cc to
get an idea how to do that.

You are welcome to try to run the python interpreter in SE mode, and you
might get it to work. The python interpreter is large and complex though,
and you might end up spending a lot of time and effort trying to implement
missing system calls, etc, and it may not be worth the trouble. You might
want to try running it in FS mode instead, where the simulated OS handles
all the system calls, etc, like it would on a real machine.

Gabe

On Mon, Oct 18, 2021 at 8:47 AM gogineni kailashnath via gem5-users <
gem5-users@gem5.org> wrote:

> I'm trying to execute a python algorithm 
> (*https://github.com/shariqiqbal2810/maddpg-pytorch
> <https://github.com/shariqiqbal2810/maddpg-pytorch>*) on gem5 in se mode
> in X86. But, at first I got an *error syscall 318 out of range*. So, I
> tried to import the get random function into the syscalltlb64 source code,
> like this:
>
> { 313, "finit_module" },
> { 314, "sched_setattr" },
> { 315, "sched_getattr" },
> { 316, "renameat2" },
> { 317, "seccomp" },
> { 318, "getrandom"},
> { 319, "memfd_create" },
> { 320, "kexec_file_load" },
> { 321, "bpf" },
>
> I'm trying to execute a python algorithm 
> (*https://github.com/shariqiqbal2810/maddpg-pytorch
> <https://github.com/shariqiqbal2810/maddpg-pytorch>*) on gem5 in se mode
> in X86. But, at first I got an *error syscall 318 out of range*. So, I
> tried to import the get random function into the syscalltlb64 source code,
> like this:
>
> { 313, "finit_module" },
> { 314, "sched_setattr" },
> { 315, "sched_getattr" },
> { 316, "renameat2" },
> { 317, "seccomp" },
> { 318, "getrandom"},
> { 319, "memfd_create" },
> { 320, "kexec_file_load" },
> { 321, "bpf" },
>
> Again, I got an error saying syscall 318 unimplemented. So, I just did:
>
>   { 318, "getrandom", getrandomFunc},
>
> Again, the problem continues as I got an error saying:
>
>     {318, "getrandom", <expression error>}, {319, "memfd_create"}, {320, 
> "kexec_file_load"}, {321, "bpf"}}' from '<brace-enclosed initializer list>' 
> to 'gem5::SyscallDescTable<gem5::X86ISA::EmuLinux::SyscallABI64>'
>   374 | };
>       | ^
>       | |
>       | <brace-enclosed initializer list>
> scons: *** [build/X86/arch/x86/linux/syscall_tbl64.o] Error 1
> scons: building terminated because of errors.
> *** Summary of Warnings ***
> Can anyone help me how to solve this problem?
> Note: My linux kernel version is 5.4.0-88-generic and I'm using ubuntu 20.04 
> LTS.
> Thanks for the help
>
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to