Lycheus / HWST128

Complete Memory Safety Accelerator on RISC-V with Metadata Compression (compiler and simulator)
2 stars 0 forks source link

"bad syscall" in proxy kernel. #2

Open wliuxingxiangyu opened 1 year ago

wliuxingxiangyu commented 1 year ago

@Lycheus

Hi, author,

Thanks for your excellent project and paper.

When I try to run the project, I get the following bug. $ spike pk hello bbl loader kenny kernel shadow_space: 000000002a7f8000 bad syscall #278!

The total number of syscalls in the proxy kernel (pk) is smaller than the Linux kernel.

The Linux kernel (SiFive): https://github.com/westerndigitalcorporation/RISC-V-Linux/blob/master/linux/arch/s390/kernel/syscalls/syscall.tbl

The proxy kernel (pk): https://github.com/Lycheus/HWST128/blob/master/hwst-pk/pk/syscall.h https://github.com/Lycheus/HWST128/blob/d23b5787ff1daa2e2c2c7d5c06f1106335f17878/hwst-pk/pk/syscall.c#L496 https://github.com/riscv-software-src/riscv-isa-sim/issues/401

So I am confused about how I can test SPEC 2006 with the proxy kernel. Could you please kindly give me some advice?

Lycheus commented 1 year ago

Hello,

Thank you for your kind words.

There are several situations which can lead to "bad syscall".

  1. The system is running out of memory: The spike version we use in this project is limited to 2G RAM. Thus, running an extra-large program can lead to a bad syscall due to memory allocation failure.
  2. System function calls are not supported: Syscall such as "socket, pthread...etc." are not implemented in spike/pk, which leads to the problem.

Please check out the "example" folder under the HWST128 root folder and run the "run.sh" script to see if your environment setup is set up correctly. Also, can you show me the "hello" program you create, so we can further help you analyse the problem?

Cheer, Kenny