2

Gem5 se mode is non-os mode, but i am able to execute row-hammer code on it which has commands with os dependencies.But if there is no os in se mode then how are they executed in se mode.

Prakhar Gurawa
  • 373
  • 3
  • 13
  • How have you been able to run rowhammer code on gem5 SE mode? I get this error: `fatal: clone: no spare thread context in system` – parisa Jul 21 '19 at 00:02
  • @parisa you need to increase the number of cores via the gem5 CLI, at least one per forked guest process. – Ciro Santilli Sep 27 '20 at 08:08

1 Answers1

3

Most userland allowed instructions just do the usual thing, which is to change the state of the the CPU slightly: touch registers + cache + memory.

Then when a syscall instruction is reached, the syscall is forwarded to the host which actually takes action.

However, this also requires some extra bookkeeping by the OS, which is why every single syscall must be implemented separately.

If I wanted to learn this :-) I would look at the implementation of a simple syscall like brk:

I would also look into QEMU user mode, I think it will be a similar concept there, but with potentially more material available.

Maybe someone with a better understanding can explain further in more detail, and annotate specific parts of the code further.

Ciro Santilli
  • 3,693
  • 1
  • 18
  • 44
  • Being a newbie in this area i dont know much about syscall. Actually i have run row-hammer code both in fs and se mode to collect logs from DRAMSim2 memory.As i know in fs mode the logs will include that from os , will the logs in se mode contain logs for only program or from other factors also. – Prakhar Gurawa Jun 21 '18 at 09:49
  • @PrakharGurawa sounds cool, send me a link when you have a PoC running on GitHub! – Ciro Santilli Jun 21 '18 at 12:20
  • @PrakharGurawa Did you get an answer to your question -> " will the logs in se mode contain logs for only program or from other factors also" ?? I have the same question. Thanks – szs Sep 25 '19 at 07:43
  • It is important to notice about that QEMU have a KVM mode on linux which is different than normal mode – Y00 May 12 '20 at 10:45