SYStem call Kvm Virtual Machine, run user-mode program in a KVM virtual machine.
$ cat /etc/shadow
cat: /etc/shadow: Permission denied
$
$ ./syskvm -f -- cat /etc/shadow
root:$6$abcdefgh$1234567890abcdefghijklmnopqrstuvwx:19000:0:99999:7:::
daemon:*:19000:0:99999:7:::
bin:*:19000:0:99999:7:::
sys:*:19000:0:99999:7:::
sync:*:19000:0:99999:7:::
games:*:19000:0:99999:7:::
man:*:19000:0:99999:7:::
lp:*:19000:0:99999:7:::
mail:*:19000:0:99999:7:::
news:*:19000:0:99999:7:::
syskvm:$6$ijklmnop$0987654321ponmlkjihgfedcbazyxwvutsr:19000:0:99999:7:::
In my thesis you can find all the deltails.
$ ./syskvm --help
Usage: syskvm [OPTION...] [ARGS...]
Run user-mode code in a kvm vm
-d, --debug=HOST:PORT Enable debug mode with specified server
-f, --vfiles Enable virtual files
-p, --pin=CORE Pin to specified CPU core
-t, --trace Enable trace mode
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
Report bugs to https://github.com/fabiomurer/syskvm.
compile test:
# in syskvm/tests
$ make
# run it
$ ./syskvm -t -- [test_name] # for ex. ./helloGDB support is only partial (some commands are not yet supported)
For example debug the test hello
in one terminal start syskvm with debug option
# in debug/
$ ./syskvm --debug="127.0.0.1:1234" -t -- ../syskvm/tests/helloin one terminal run gdb in remote mode
# in syskvm/tests/
gdb
(gdb) file hello
Reading symbols from hello...
(gdb) target remote 127.0.0.1:1234
Remote debugging using 127.0.0.1:1234
_start () at hello.c:21
21 void __attribute__((noreturn)) __attribute__((section(".start"))) _start(void) {
...
For benchmarking this implementation a script is provided.
Dependencies
first build syskvm in release mode
# in syskvm/tests
$ bash benchmark.bash [test-name] # es ./hello$ mkdir syskvm_
$ cd syskvm_
$ mkdir debug
$ mkdir release
$ git clone https://github.com/fabiomurer/syskvm.git
$ cd syskvm
$ git submodule init
$ git submodule updatedirectory tree should look like this:
.
└── syskvm_
├── debug
├── release
└── syskvm
in release/ folder
$ cmake ../syskvm/ -DCMAKE_BUILD_TYPE=Release
$ makein debug/ folder
$ cmake ../syskvm/
$ makein debug/ or release/ folder
$ make format
$ make lint