• Stars
    star
    239
  • Rank 168,763 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 1 year ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast and secure RISC-V based virtual machine

PolkaVM

PolkaVM is a general purpose user-level RISC-V based virtual machine.

This project is still unfinished and is a very heavy work-in-progress! Do not use it in production!

Design goals

(Note: not all of these are currently true!)

  • Secure and sandboxed by default. The code running in the VM should run in a separate process, and should not be able to access the host system, even in the presence of an attacker with full remote code execution privileges inside of the VM.
  • Fast to execute. The runtime performance of the code running in the VM should be competitive with state-of-art WebAssembly VMs, at least within the same order of magnitude.
  • Fast to compile, with guaranteed single-pass O(n) compilation. Loading new code into the VM should be near instanteneous.
  • Low memory footprint. Each concurrent instance of the VM should have a baseline memory overhead of no more than 128KB.
  • Small binaries. Programs compiled for this VM should take up as little space as possible.
  • No wasted virtual address space. The VM should not preallocate gigabytes of virtual address space for sandboxing purposes.
  • Fully deterministic. Given the same inputs and the same code the execution should always return exactly the same output.
  • Support for high performance asynchronous gas metering. Gas metering should be cheap, deterministic, and reasonably accurate.
  • Simple. It should be possible for a single programmer to write an interpreter fully compatible with this VM in less than a week.
  • Versioned operational semantics. Any future changes to the semantics that are observable by a guest program will be versioned, and will be explicitly opt-in.
  • Standardized. There should be a spec fully describing the guest-observable operational semantics of this VM.
  • Cross-platform. On unsupported OSes and platforms the VM will run in an interpreted mode.
  • Minimum external dependencies. The VM should be mostly self-contained, fast to compile, and resistant to supply-chain attacks.
  • Built-in tooling for debugging and performance profiling.

Non-goals

  • System level emulation. This VM will never be able to run a normal operating system.
  • Full support for architectures other than amd64 (also known as x86_64) and aarch64 (also known as arm64). Anything else will run in an interpreted mode.
  • Full support for operating systems other than Linux, macOS and Windows. On any other OS the VM will run in an interpreted mode.
  • Floating point support, SIMD, and other more niche RISC-V extensions. These could be added as an opt-in feature in the future if necessary, but this is not currently planned.
  • Support for full 32-register RISC-V ISA. This VM currently only targets the RV32EM.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

bytehound

A memory profiler for Linux.
C
4,446
star
2

stdweb

A standard library for the client-side Web
Rust
3,441
star
3

cargo-web

A Cargo subcommand for the client-side Web
Rust
1,106
star
4

not-perf

A sampling CPU profiler for Linux
Rust
870
star
5

pinky

An NES emulator written in Rust
Rust
771
star
6

speedy

A fast binary serialization framework
Rust
373
star
7

schnellru

A fast and flexible LRU map.
Rust
170
star
8

parcel-plugin-cargo-web

JavaScript
48
star
9

libretro-backend

Libretro API bindings for Rust
Rust
46
star
10

sarek

A work-in-progress, experimental neural network library for Rust
Rust
44
star
11

polkadot-starship

Ruby
24
star
12

polkavm-experiment

An experimental RISC-V recompiler
Rust
18
star
13

hooky

A convenient LD_PRELOAD hooker
Rust
12
star
14

rustc-rv32e

Rust toolchain for RV32E
Shell
10
star
15

rwkv_tokenizer

Python
7
star
16

polkadoom

Yet another DOOM port
C++
7
star
17

libretro-sys

Raw FFI bindings to the libretro API
Rust
6
star
18

static_test

Attribute macro for writing tests which check that a given condition ALWAYS holds true or that a given code path is ALWAYS unreachable
Rust
6
star
19

serde-bench

A simple benchmark of various Rust serialization frameworks
Rust
6
star
20

nsctrld

Nintendo Switch Pro Controller userspace driver
Rust
4
star
21

linux-input

Rust
4
star
22

memory-pool

A global, thread-safe memory pool.
Rust
4
star
23

dspr

A DSP plugin server
C++
3
star
24

unsafe_target_feature

A more convenient `#[target_feature]` replacement
Rust
3
star
25

chromium-build

Shell
2
star
26

softfloat

Rust
2
star
27

cargo-shim

A helper library for Cargo subcommands
Rust
2
star
28

mmalloc

A simple mmap-based allocator
Rust
2
star
29

chrf

Rust
2
star
30

koute.github.io

JavaScript
1
star
31

inputd

Rust
1
star
32

linux-elf-loading-bug

Rust
1
star